MeshFields
GPU accelerated mesh-based fields
Public Member Functions | List of all members
MeshField::Field< Slice > Class Template Reference

Provides access to individual entries of a single Field provided by MeshField::makeField and helper functions that operate on the entire Field. More...

#include <MeshField_Field.hpp>

Public Member Functions

KOKKOS_INLINE_FUNCTION size_t size (int i) const
 get the size/extent of the specified rank More...
 
KOKKOS_INLINE_FUNCTION auto & operator() (int s) const
 
Kokkos::View< base_type * > serialize () const
 copy the Field into a single rank Kokkos View More...
 
void serialize (Kokkos::View< base_type * > &serial) const
 copy the Field into a given Kokkos View More...
 
void deserialize (const Kokkos::View< const base_type * > &serialized)
 copy the given Kokkos View into the Field More...
 
template<class View >
void set (View &view)
 

Detailed Description

template<class Slice>
class MeshField::Field< Slice >

Provides access to individual entries of a single Field provided by MeshField::makeField and helper functions that operate on the entire Field.

Each Field stores DOFs associated with exactly one topological mesh entity type. For example, a quadratic field over triangles will have one Field for DOFs at the vertices and another for the DOFs at edges.

Template Parameters
Sliceis the underlying storage object provided by the KokkosController or CabanaController
Parameters
Slicesee Slice template parameter

Definition at line 46 of file MeshField_Field.hpp.

Member Function Documentation

◆ deserialize()

template<class Slice >
void MeshField::Field< Slice >::deserialize ( const Kokkos::View< const base_type * > &  serialized)
inline

copy the given Kokkos View into the Field

See linearIdxToTensorIdx

Parameters
serial(in/out) the Kokkow View to copy into

Definition at line 200 of file MeshField_Field.hpp.

◆ operator()()

template<class Slice >
KOKKOS_INLINE_FUNCTION auto& MeshField::Field< Slice >::operator() ( int  s) const
inline

access the underlying field at the specified index

Definition at line 124 of file MeshField_Field.hpp.

◆ serialize() [1/2]

template<class Slice >
Kokkos::View<base_type *> MeshField::Field< Slice >::serialize ( ) const
inline

copy the Field into a single rank Kokkos View

See linearIdxToTensorIdx

Returns
the Kokkos View

Definition at line 172 of file MeshField_Field.hpp.

◆ serialize() [2/2]

template<class Slice >
void MeshField::Field< Slice >::serialize ( Kokkos::View< base_type * > &  serial) const
inline

copy the Field into a given Kokkos View

The Kokkos View needs to have extent = the product of the Field extents. See linearIdxToTensorIdx

Parameters
serial(in/out) the Kokkow View to copy into

Definition at line 187 of file MeshField_Field.hpp.

◆ set()

template<class Slice >
template<class View >
void MeshField::Field< Slice >::set ( View &  view)
inline

sets field(i,j,...) = view(i,j,...) for all i,j,... up to rank 5.

Todo:
check datatype of View
Template Parameters
Viewto copy from, must have matching extent and rank

Definition at line 278 of file MeshField_Field.hpp.

◆ size()

template<class Slice >
KOKKOS_INLINE_FUNCTION size_t MeshField::Field< Slice >::size ( int  i) const
inline

get the size/extent of the specified rank

Parameters
i(in) the rank to query
Returns
the size/extent

Definition at line 118 of file MeshField_Field.hpp.


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