OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ippl::Field< T, Dim, Mesh, Centering, ViewArgs > Class Template Reference

#include <Field.h>

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

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 = typename detail::CreateUniformType< base_type, typename view_type::uniform_type >::type
 
using Domain_t = NDIndex< Dim >
 Domain type specifying the index region. More...
 
typedef view_type::memory_space memory_space
 
typedef view_type::execution_space execution_space
 
using HostMirror = typename view_type::host_mirror_type
 
using policy_type = typename RangePolicy< Dim, PolicyArgs... >::policy_type
 
using halo_type = detail::HaloCells< T, Dim, ViewArgs... >
 
using value_type = T
 

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. More...
 
view_type dview_m
 Actual field data. More...
 
Domain_t owned_m
 Domain of the data. More...
 
halo_type halo_m
 
Layout_tlayout_m
 How the arrays are laid out. More...
 

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 = NDIndex<Dim>
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 = detail::HaloCells<T, Dim, ViewArgs...>
inherited

Definition at line 57 of file BareField.h.

◆ HostMirror

using ippl::BareField< T, Dim, ViewArgs >::HostMirror = typename view_type::host_mirror_type
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 = typename RangePolicy<Dim, PolicyArgs...>::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 = typename detail::CreateUniformType<base_type, typename view_type::uniform_type>::type

Definition at line 30 of file Field.h.

◆ value_type

using ippl::BareField< T, Dim, ViewArgs >::value_type = T
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.

◆ 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 ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::bc_m, and Dim.

Member Function Documentation

◆ accumulateHalo()

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

Definition at line 128 of file BareField.hpp.

◆ accumulateHalo_noghost()

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

Definition at line 129 of file BareField.hpp.

◆ 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

◆ fillHalo()

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

Definition at line 127 of file BareField.hpp.

◆ 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.

◆ getCommunicator()

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

Definition at line 131 of file BareField.h.

◆ getDomain()

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

Definition at line 140 of file BareField.h.

◆ getFieldBC()

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

◆ 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.

◆ getHalo()

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

Definition at line 142 of file BareField.h.

◆ getHostMirror()

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

Definition at line 173 of file BareField.h.

◆ getIndex()

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

Definition at line 139 of file BareField.h.

◆ getLayout()

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

Definition at line 134 of file BareField.h.

◆ getNghost()

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

Definition at line 125 of file BareField.h.

◆ 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.

◆ getView() [1/2]

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

Definition at line 169 of file BareField.h.

◆ getView() [2/2]

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

Definition at line 171 of file BareField.h.

◆ getVolumeAverage()

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

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.

◆ getVolumeIntegral()

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

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.

◆ 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

Definition at line 101 of file BareField.hpp.

◆ 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.

Referenced by FieldContainer< T, Dim >::initializeFields().

◆ max()

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

Definition at line 203 of file BareField.hpp.

◆ min()

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

Definition at line 204 of file BareField.hpp.

◆ 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.

◆ 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

Definition at line 205 of file BareField.hpp.

◆ 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

Definition at line 92 of file BareField.hpp.

◆ 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.

References ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::bc_m, and ippl::BConds< Field, Dim >::findBCNeighbors().

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

Here is the call graph for this function:

◆ setup()

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

Allocate field.

Definition at line 222 of file BareField.hpp.

◆ 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.

◆ sum()

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

Definition at line 202 of file BareField.hpp.

◆ 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 
)

◆ write() [1/2]

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

Print the BareField

Parameters
infInform object

Definition at line 200 of file BareField.hpp.

◆ write() [2/2]

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

Print the BareField.

Parameters
outstream

Definition at line 194 of file BareField.hpp.

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

◆ dim

constexpr 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.

◆ halo_m

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

Definition at line 217 of file BareField.h.

◆ 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.

◆ 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 ippl::Field< T, Dim, Mesh, Centering, ViewArgs >::get_mesh().

◆ 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.

◆ owned_m

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

Domain of the data.

Definition at line 215 of file BareField.h.


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