IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::Field< T, Dim, Mesh, Centering, ViewArgs > Class Template Reference

#include <Field.h>

Inheritance diagram for ippl::Field< T, Dim, Mesh, Centering, ViewArgs >:
Collaboration diagram for ippl::Field< T, Dim, Mesh, Centering, ViewArgs >:

Public Types

using Mesh_t = Mesh
using Centering_t = Cell
using Layout_t = FieldLayout<Dim>
using BareField_t = BareField<T, Dim, ViewArgs...>
using view_type = typename BareField_t::view_type
using BConds_t = BConds<Field<T, Dim, Mesh, Centering, ViewArgs...>, Dim>
using uniform_type
using Domain_t
 Domain type specifying the index region.
typedef view_type::memory_space memory_space
typedef view_type::execution_space execution_space
using HostMirror
using policy_type
using halo_type
using value_type

Public Member Functions

 Field ()
 Field (const Field &)=default
Field deepCopy () const
virtual ~Field ()=default
 Field (Mesh_t &, Layout_t &, int nghost=1)
void initialize (Mesh_t &, Layout_t &, int nghost=1)
void updateLayout (Layout_t &, int nghost=1)
void setFieldBC (BConds_t &bc)
KOKKOS_INLINE_FUNCTION Mesh_tget_mesh () const
T getVolumeIntegral () const
T getVolumeAverage () const
BConds_tgetFieldBC ()
void resize (Args... args)
void initialize (Layout_t &l, int nghost=1)
detail::size_type size (unsigned d) const
const Domain_tgetOwned () const
const Domain_t getAllocated () const
int getNghost () const
void fillHalo ()
void accumulateHalo ()
void accumulateHalo_noghost (int nghost=1)
auto & getCommunicator () const
Layout_tgetLayout () const
const IndexgetIndex (unsigned d) const
const NDIndex< Dim > & getDomain () const
halo_typegetHalo ()
KOKKOS_INLINE_FUNCTION T operator() (Args... args) const
view_typegetView ()
const view_typegetView () const
HostMirror getHostMirror () const
policy_type< execution_space, PolicyArgs... > getFieldRangePolicy (const int nghost=0) const
void write (std::ostream &out=std::cout) const
void write (Inform &inf) const
T sum (int nghost=0) const
T max (int nghost=0) const
T min (int nghost=0) const
T prod (int nghost=0) const
KOKKOS_INLINE_FUNCTION auto operator[] (size_t i) const

Static Public Attributes

static constexpr unsigned dim

Private Types

template<typename... Props>
using base_type = Field<T, Dim, Mesh, Centering, Props...>

Private Member Functions

void setup ()

Private Attributes

Mesh_tmesh_m
BConds_t bc_m
int nghost_m
 Number of ghost layers on each field boundary.
view_type dview_m
 Actual field data.
Domain_t owned_m
 Domain of the data.
halo_type halo_m
Layout_tlayout_m
 How the arrays are laid out.

Detailed Description

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
class ippl::Field< T, Dim, Mesh, Centering, ViewArgs >

Definition at line 18 of file Field.h.

Member Typedef Documentation

◆ BareField_t

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::BareField_t = BareField<T, Dim, ViewArgs...>

Definition at line 26 of file Field.h.

◆ base_type

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
template<typename... Props>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::base_type = Field<T, Dim, Mesh, Centering, Props...>
private

Definition at line 20 of file Field.h.

◆ BConds_t

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::BConds_t = BConds<Field<T, Dim, Mesh, Centering, ViewArgs...>, Dim>

Definition at line 28 of file Field.h.

◆ Centering_t

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::Centering_t = Cell

Definition at line 24 of file Field.h.

◆ Domain_t

using ippl::BareField< T, Dim, ViewArgs >::Domain_t
inherited

Domain type specifying the index region.

Definition at line 47 of file BareField.h.

◆ execution_space

typedef view_type::execution_space ippl::BareField< T, Dim, ViewArgs >::execution_space
inherited

Definition at line 52 of file BareField.h.

◆ halo_type

using ippl::BareField< T, Dim, ViewArgs >::halo_type
inherited

Definition at line 57 of file BareField.h.

◆ HostMirror

using ippl::BareField< T, Dim, ViewArgs >::HostMirror
inherited

Definition at line 53 of file BareField.h.

◆ Layout_t

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::Layout_t = FieldLayout<Dim>

Definition at line 25 of file Field.h.

◆ memory_space

typedef view_type::memory_space ippl::BareField< T, Dim, ViewArgs >::memory_space
inherited

Definition at line 51 of file BareField.h.

◆ Mesh_t

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::Mesh_t = Mesh

Definition at line 23 of file Field.h.

◆ policy_type

using ippl::BareField< T, Dim, ViewArgs >::policy_type
inherited

Definition at line 55 of file BareField.h.

◆ uniform_type

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::uniform_type
Initial value:

Definition at line 30 of file Field.h.

◆ value_type

using ippl::BareField< T, Dim, ViewArgs >::value_type
inherited

Definition at line 59 of file BareField.h.

◆ view_type

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
using ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::view_type = typename BareField_t::view_type

Definition at line 27 of file Field.h.

Constructor & Destructor Documentation

◆ Field() [1/3]

template<class T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::Field ( )

Definition at line 19 of file Field.hpp.

References bc_m, and mesh_m.

Referenced by deepCopy(), Field(), and initialize().

Here is the caller graph for this function:

◆ Field() [2/3]

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::Field ( const Field< T, Dim, Mesh, Centering, ViewArgs > & )
default

◆ ~Field()

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
virtual ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::~Field ( )
virtualdefault

◆ Field() [3/3]

template<class T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::Field ( Mesh_t & m,
Layout_t & l,
int nghost = 1 )

Definition at line 37 of file Field.hpp.

References bc_m, Dim, Field(), and mesh_m.

Here is the call graph for this function:

Member Function Documentation

◆ accumulateHalo()

void ippl::BareField< T, Dim, ViewArgs >::accumulateHalo ( )
inherited

◆ accumulateHalo_noghost()

void ippl::BareField< T, Dim, ViewArgs >::accumulateHalo_noghost ( int nghost = 1)
inherited

◆ deepCopy()

template<class T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
Field< T, Dim, Mesh, Centering, ViewArgs... > ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::deepCopy ( ) const

Creates a new Field with the same properties and contents

Returns
A deep copy of the field

Definition at line 26 of file Field.hpp.

References Dim, Field(), ippl::BareField< T, Dim, ViewArgs... >::getLayout(), ippl::BareField< T, Dim, ViewArgs... >::getNghost(), and mesh_m.

Referenced by ippl::adapted_powermethod(), ippl::preconditioner< Field >::init_fields(), ippl::polynomial_chebyshev_preconditioner< Field, OperatorF >::operator()(), ippl::preconditioner< Field >::operator()(), ippl::richardson_preconditioner_alt< Field, OperatorF, InvDiagF >::operator()(), and ippl::powermethod().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fillHalo()

void ippl::BareField< T, Dim, ViewArgs >::fillHalo ( )
inherited

◆ get_mesh()

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
KOKKOS_INLINE_FUNCTION Mesh_t & ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::get_mesh ( ) const
inline

◆ getAllocated()

const Domain_t ippl::BareField< T, Dim, ViewArgs >::getAllocated ( ) const
inlineinherited

Index domain of the allocated field.

Returns
the allocated index domain (including ghost cells)

Definition at line 123 of file BareField.h.

References nghost_m, and owned_m.

◆ getCommunicator()

auto & ippl::BareField< T, Dim, ViewArgs >::getCommunicator ( ) const
inlineinherited

Definition at line 131 of file BareField.h.

References ippl::FieldLayout< Dim >::comm, and ippl::BareField< T, Dim, ViewArgs >::getLayout().

Here is the call graph for this function:

◆ getDomain()

const NDIndex< Dim > & ippl::BareField< T, Dim, ViewArgs >::getDomain ( ) const
inlineinherited

Definition at line 140 of file BareField.h.

References ippl::FieldLayout< Dim >::getDomain(), and ippl::BareField< T, Dim, ViewArgs >::getLayout().

Here is the call graph for this function:

◆ getFieldBC()

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
BConds_t & ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::getFieldBC ( )
inline

Definition at line 78 of file Field.h.

Referenced by ippl::curl(), ippl::div(), ippl::grad(), ippl::hess(), ippl::laplace(), ippl::lower_laplace(), ippl::poisson(), ippl::upper_and_lower_laplace(), and ippl::upper_laplace().

Here is the caller graph for this function:

◆ getFieldRangePolicy()

policy_type< execution_space, PolicyArgs... > ippl::BareField< T, Dim, ViewArgs >::getFieldRangePolicy ( const int nghost = 0) const
inlineinherited

Generate the range policy for iterating over the field, excluding ghost layers

Template Parameters
PolicyArgs...additional template parameters for the range policy
Parameters
nghostNumber of ghost layers to include in the range policy (default 0)
Returns
Range policy for iterating over the field and nghost of the ghost layers

Definition at line 183 of file BareField.h.

References dview_m, ippl::getRangePolicy(), nghost_m, and PAssert_LE.

Here is the call graph for this function:

◆ getHalo()

halo_type & ippl::BareField< T, Dim, ViewArgs >::getHalo ( )
inlineinherited

Definition at line 142 of file BareField.h.

References halo_m.

◆ getHostMirror()

HostMirror ippl::BareField< T, Dim, ViewArgs >::getHostMirror ( ) const
inlineinherited

Definition at line 173 of file BareField.h.

References dview_m.

Referenced by dumpVTK(), and dumpVTK().

Here is the caller graph for this function:

◆ getIndex()

const Index & ippl::BareField< T, Dim, ViewArgs >::getIndex ( unsigned d) const
inlineinherited

Definition at line 139 of file BareField.h.

References ippl::FieldLayout< Dim >::getDomain(), and ippl::BareField< T, Dim, ViewArgs >::getLayout().

Here is the call graph for this function:

◆ getLayout()

Layout_t & ippl::BareField< T, Dim, ViewArgs >::getLayout ( ) const
inlineinherited

Definition at line 134 of file BareField.h.

References layout_m, and PAssert.

Referenced by ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::deepCopy().

Here is the caller graph for this function:

◆ getNghost()

int ippl::BareField< T, Dim, ViewArgs >::getNghost ( ) const
inlineinherited

Definition at line 125 of file BareField.h.

References nghost_m.

Referenced by ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::deepCopy().

Here is the caller graph for this function:

◆ getOwned()

const Domain_t & ippl::BareField< T, Dim, ViewArgs >::getOwned ( ) const
inlineinherited

Index domain of the local field.

Returns
the index domain.

Definition at line 117 of file BareField.h.

References owned_m.

◆ getView() [1/2]

view_type & ippl::BareField< T, Dim, ViewArgs >::getView ( )
inlineinherited

Definition at line 169 of file BareField.h.

References dview_m.

Referenced by dumpVTK(), and dumpVTK().

Here is the caller graph for this function:

◆ getView() [2/2]

const view_type & ippl::BareField< T, Dim, ViewArgs >::getView ( ) const
inlineinherited

Definition at line 171 of file BareField.h.

References dview_m.

◆ getVolumeAverage()

template<class T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
T ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::getVolumeAverage ( ) const

Use the midpoint rule to calculate the field's volume average

Returns
Integral of the field divided by the mesh volume

Definition at line 66 of file Field.hpp.

References getVolumeIntegral(), and mesh_m.

Here is the call graph for this function:

◆ getVolumeIntegral()

template<class T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
T ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::getVolumeIntegral ( ) const

Use the midpoint rule to calculate the field's volume integral

Returns
Integral of the field over its domain

Definition at line 60 of file Field.hpp.

References mesh_m, and ippl::BareField< T, Dim, ViewArgs... >::sum().

Referenced by getVolumeAverage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize() [1/2]

void ippl::BareField< T, Dim, ViewArgs >::initialize ( Layout_t & l,
int nghost = 1 )
inherited

Initialize the field, if it was constructed from the default constructor. This should NOT be called if the field was constructed by providing a FieldLayout.

Parameters
lof field
nghostnumber of ghost layers

Referenced by ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::initialize().

Here is the caller graph for this function:

◆ initialize() [2/2]

template<class T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
void ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::initialize ( Mesh_t & m,
Layout_t & l,
int nghost = 1 )

Definition at line 49 of file Field.hpp.

References bc_m, Dim, Field(), ippl::BareField< T, Dim, ViewArgs... >::initialize(), and mesh_m.

Here is the call graph for this function:

◆ max()

T ippl::BareField< T, Dim, ViewArgs >::max ( int nghost = 0) const
inherited

◆ min()

T ippl::BareField< T, Dim, ViewArgs >::min ( int nghost = 0) const
inherited

◆ operator()()

KOKKOS_INLINE_FUNCTION T ippl::BareField< T, Dim, ViewArgs >::operator() ( Args... args) const
inlineinherited

Assign another field.

Template Parameters
Args...variadic template to specify an access index for a view element.
Parameters
argsview indices
Returns
a view element

Definition at line 165 of file BareField.h.

References ippl::BareField< T, Dim, ViewArgs >::dview_m.

◆ operator[]()

KOKKOS_INLINE_FUNCTION auto ippl::detail::Expression< BareField< T, Dim, ViewArgs... >, N >::operator[] ( size_t i) const
inlineinherited

Access single element of the expression

Definition at line 32 of file IpplExpressions.h.

◆ prod()

T ippl::BareField< T, Dim, ViewArgs >::prod ( int nghost = 0) const
inherited

◆ resize()

void ippl::BareField< T, Dim, ViewArgs >::resize ( Args... args)
inherited

Dimension independent view resize function which calls Kokkos.

Template Parameters
Args...variadic template specifying the individiual dimension arguments

◆ setFieldBC()

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
void ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::setFieldBC ( BConds_t & bc)
inline

Definition at line 58 of file Field.h.

◆ setup()

void ippl::BareField< T, Dim, ViewArgs >::setup ( )
privateinherited

Allocate field.

◆ size()

detail::size_type ippl::BareField< T, Dim, ViewArgs >::size ( unsigned d) const
inlineinherited

Local field size.

Parameters
dthe dimension
Returns
the number of grid points in the given dimension.

Definition at line 111 of file BareField.h.

References owned_m.

◆ sum()

T ippl::BareField< T, Dim, ViewArgs >::sum ( int nghost = 0) const
inherited

Referenced by ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::getVolumeIntegral().

Here is the caller graph for this function:

◆ updateLayout()

template<class T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
void ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::updateLayout ( Layout_t & l,
int nghost = 1 )

Definition at line 71 of file Field.hpp.

References ippl::BareField< T, Dim, ViewArgs... >::updateLayout().

Referenced by ChargedParticles< PLayout, T, Dim >::updateLayout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [1/2]

void ippl::BareField< T, Dim, ViewArgs >::write ( Inform & inf) const
inherited

Print the BareField

Parameters
infInform object

◆ write() [2/2]

void ippl::BareField< T, Dim, ViewArgs >::write ( std::ostream & out = std::cout) const
inherited

Print the BareField.

Parameters
outstream

Member Data Documentation

◆ bc_m

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
BConds_t ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::bc_m
private

Definition at line 87 of file Field.h.

Referenced by Field(), Field(), and initialize().

◆ dim

unsigned ippl::BareField< T, Dim, ViewArgs >::dim
staticconstexprinherited

Definition at line 60 of file BareField.h.

◆ dview_m

view_type ippl::BareField< T, Dim, ViewArgs >::dview_m
privateinherited

Actual field data.

Definition at line 212 of file BareField.h.

Referenced by getFieldRangePolicy(), getHostMirror(), getView(), getView(), and operator=().

◆ halo_m

halo_type ippl::BareField< T, Dim, ViewArgs >::halo_m
privateinherited

Definition at line 217 of file BareField.h.

Referenced by getHalo().

◆ layout_m

Layout_t* ippl::BareField< T, Dim, ViewArgs >::layout_m
privateinherited

How the arrays are laid out.

Definition at line 225 of file BareField.h.

Referenced by getLayout().

◆ mesh_m

template<typename T, unsigned Dim, class Mesh, class Centering, class... ViewArgs>
Mesh_t* ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::mesh_m
private

Definition at line 84 of file Field.h.

Referenced by deepCopy(), Field(), Field(), getVolumeAverage(), getVolumeIntegral(), and initialize().

◆ nghost_m

int ippl::BareField< T, Dim, ViewArgs >::nghost_m
privateinherited

Number of ghost layers on each field boundary.

Definition at line 209 of file BareField.h.

Referenced by getAllocated(), getFieldRangePolicy(), getNghost(), and operator=().

◆ owned_m

Domain_t ippl::BareField< T, Dim, ViewArgs >::owned_m
privateinherited

Domain of the data.

Definition at line 215 of file BareField.h.

Referenced by getAllocated(), getOwned(), and size().


The documentation for this class was generated from the following files: