MeshFields
GPU accelerated mesh-based fields
Public Member Functions | List of all members
MeshField::FieldElement< FieldAccessor, ShapeType, ElementDofHolderAccessor > Struct Template Reference

Supports the evaluation of a field, and other per-element operations, given the definition of the element ((the topological type of mesh entity to operate over (i.e., edge, tri, quad, tet, etc.)) and shape functions used by the field. Operations are expected to be executed concurrently across all (or a subset of) elements in the on-process mesh (e.g., within a parallel for loop). More...

#include <MeshField_Element.hpp>

Public Member Functions

KOKKOS_INLINE_FUNCTION ValArray getValue (int ent, Kokkos::Array< Real, MeshEntDim > localCoord) const
 evaluate the field in the specified element at the specified parametric/local/area coordinate More...
 
KOKKOS_INLINE_FUNCTION Real getJacobian1d (int ent) const
 compute the Jacobian of an edge More...
 
template<typename Matrices >
Kokkos::View< Real * > getJacobianDeterminants (Matrices const &J) const
 
Kokkos::View< Real *** > getJacobians (Kokkos::View< Real ** > localCoords, Kokkos::View< LO * > offsets) const
 Given an array of parametric coordinates 'localCoords', one per mesh element, compute the jacobian within each element. More...
 

Detailed Description

template<typename FieldAccessor, typename ShapeType, typename ElementDofHolderAccessor>
struct MeshField::FieldElement< FieldAccessor, ShapeType, ElementDofHolderAccessor >

Supports the evaluation of a field, and other per-element operations, given the definition of the element ((the topological type of mesh entity to operate over (i.e., edge, tri, quad, tet, etc.)) and shape functions used by the field. Operations are expected to be executed concurrently across all (or a subset of) elements in the on-process mesh (e.g., within a parallel for loop).

Template Parameters
FieldAccessorprovides parenthesis operator to access the field (see CreateLagrangeField and CreateCoordinateField)
ShapeTypeDefines the shape function order and mesh topology (i.e., QuadraticTriangleShape, QuadraticTetrahedronShape, ...)
ElementDofHolderAccessorprovides the mapping from the element indices to the underlying field storage
Todo:
add static asserts for functions provided by the templated types
Parameters
in_numMeshEntsnumber of mesh entities that are associated with the ElementType
fieldInsee FieldAccessor
elmInsee ElementType

Definition at line 148 of file MeshField_Element.hpp.

Member Function Documentation

◆ getJacobian1d()

template<typename FieldAccessor , typename ShapeType , typename ElementDofHolderAccessor >
KOKKOS_INLINE_FUNCTION Real MeshField::FieldElement< FieldAccessor, ShapeType, ElementDofHolderAccessor >::getJacobian1d ( int  ent) const
inline

compute the Jacobian of an edge

@TODO use the same approach taken for 2d

heavily based on SCOREC/core @ 7cd76473 apf/apfVectorElement.cc

Parameters
entthe mesh entity index
Returns
the result of evaluation

Definition at line 242 of file MeshField_Element.hpp.

◆ getJacobianDeterminants()

template<typename FieldAccessor , typename ShapeType , typename ElementDofHolderAccessor >
template<typename Matrices >
Kokkos::View<Real *> MeshField::FieldElement< FieldAccessor, ShapeType, ElementDofHolderAccessor >::getJacobianDeterminants ( Matrices const &  J) const
inline

heavily based on SCOREC/core @ 7cd76473 apf/apfVectorElement.cc

Definition at line 260 of file MeshField_Element.hpp.

◆ getJacobians()

template<typename FieldAccessor , typename ShapeType , typename ElementDofHolderAccessor >
Kokkos::View<Real ***> MeshField::FieldElement< FieldAccessor, ShapeType, ElementDofHolderAccessor >::getJacobians ( Kokkos::View< Real ** >  localCoords,
Kokkos::View< LO * >  offsets 
) const
inline

Given an array of parametric coordinates 'localCoords', one per mesh element, compute the jacobian within each element.

Todo:

add static asserts for values and functions provided by the templated types

consider making this a member function of FieldElement

Parameters
localCoords2D Kokkos::View containing the local/parametric/area coordinates for each element
offsets1D Kokkos::View containing the offsets into localCoords, size = localCoords.extent(0)+1
Returns
Kokkos::View containing the jacobian for all the mesh elements

Definition at line 344 of file MeshField_Element.hpp.

◆ getValue()

template<typename FieldAccessor , typename ShapeType , typename ElementDofHolderAccessor >
KOKKOS_INLINE_FUNCTION ValArray MeshField::FieldElement< FieldAccessor, ShapeType, ElementDofHolderAccessor >::getValue ( int  ent,
Kokkos::Array< Real, MeshEntDim >  localCoord 
) const
inline

evaluate the field in the specified element at the specified parametric/local/area coordinate

Todo:
add expression in documetation for summation of shape function * field values

heavily based on SCOREC/core @ 7cd76473 apf/apfElement.cc

Parameters
entthe mesh entity index
localCoordthe parametric coordinate
Returns
the result of evaluation

Definition at line 192 of file MeshField_Element.hpp.


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