|
MeshFields
GPU accelerated mesh-based fields
|
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 Types | |
| using | DofArray = Kokkos::Array< typename baseType< typename FieldAccessor::BaseType >::type, ShapeType::numNodes *NumComponents > |
| every dof of one element, indexed [node * NumComponents + comp] | |
| using | LocalGradArray = Kokkos::Array< typename baseType< typename FieldAccessor::BaseType >::type, MeshEntDim *NumComponents > |
| parametric gradients of every component at one point, indexed [direction * NumComponents + comp] | |
| using | JacobianArray = Kokkos::Array< Real, MeshEntDim *MeshEntDim > |
| the Jacobian at one point, row-major with J[i][j] = dx_j/dxi_i | |
Public Member Functions | |
| KOKKOS_INLINE_FUNCTION DofArray | gatherDofs (int ent) const |
| gather element's dofs into an array More... | |
| KOKKOS_INLINE_FUNCTION DofArray | coefficients (int ent) const |
| the coefficients of one element on its reference basis More... | |
| template<typename Coefficients > | |
| KOKKOS_INLINE_FUNCTION ValArray | valueFromCoefficients (Coefficients const &c, Kokkos::Array< Real, MeshEntDim > localCoord) const |
| compute dot product between the basis functions and the coefficients I.e., $$\sum_{A=1}^{N} c_A N_A$$ More... | |
| template<typename Coefficients > | |
| KOKKOS_INLINE_FUNCTION LocalGradArray | localGradientFromCoefficients (Coefficients const &c, Kokkos::Array< Real, MeshEntDim > localCoord) const |
| compute dot product between the basis function gradients and the coefficients I.e., $$\sum_{A=1}^{N} c_A N_{A,x}$$ More... | |
| template<typename Coefficients , typename ShapeGradients > | |
| KOKKOS_INLINE_FUNCTION LocalGradArray | localGradientFromShapeGradients (Coefficients const &c, ShapeGradients const &shapeGrads) const |
| localGradientFromCoefficients with the shape function gradients already evaluated, so they can be shared with a geometry that uses the same shape More... | |
| 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 JacobianArray | jacobianFromNodeValues (NodeArray const &x, Kokkos::Array< Real, MeshEntDim > localCoord) const |
| compute the Jacobian at a parametric coordinate from the node coordinates More... | |
| template<typename ShapeGradients > | |
| KOKKOS_INLINE_FUNCTION JacobianArray | jacobianFromShapeGradients (NodeArray const &x, ShapeGradients const &grads) const |
| jacobianFromNodeValues with the shape function gradients already evaluated, so they can be shared with a field that uses the same shape 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... | |
Static Public Member Functions | |
| static constexpr KOKKOS_FUNCTION auto | getTopology () |
| the topology of the element's reference element | |
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).
| FieldAccessor | provides parenthesis operator to access the field (see CreateLagrangeField and CreateCoordinateField) |
| ShapeType | Defines the shape function order and mesh topology (i.e., QuadraticTriangleShape, QuadraticTetrahedronShape, ...) |
| ElementDofHolderAccessor | provides the mapping from the element indices to the underlying field storage |
| in_numMeshEnts | number of mesh entities that are associated with the ElementType |
| fieldIn | see FieldAccessor |
| elmIn | see ElementType |
Definition at line 149 of file MeshField_Element.hpp.
|
inline |
the coefficients of one element on its reference basis
The coefficients depend only on the element, not on the evaluation point, so compute them once per element and pass them to valueFromCoefficients and localGradientFromCoefficients for each point. For a FieldElement the stored dofs are the coefficients; elements whose dofs must be transformed to the reference element (e.g., the Bell element) override this.
| ent | the mesh entity index |
Definition at line 232 of file MeshField_Element.hpp.
|
inline |
gather element's dofs into an array
| ent | the mesh entity index |
Definition at line 202 of file MeshField_Element.hpp.
|
inline |
compute the Jacobian of an edge
@TODO use the same approach taken for 2d
heavily based on SCOREC/core @ 7cd76473 apf/apfVectorElement.cc
| ent | the mesh entity index |
Definition at line 398 of file MeshField_Element.hpp.
|
inline |
heavily based on SCOREC/core @ 7cd76473 apf/apfVectorElement.cc
Definition at line 416 of file MeshField_Element.hpp.
|
inline |
Given an array of parametric coordinates 'localCoords', one per mesh element, compute the jacobian within each element.
add static asserts for values and functions provided by the templated types
consider making this a member function of FieldElement
| localCoords | 2D Kokkos::View containing the local/parametric/area coordinates for each element |
| offsets | 1D Kokkos::View containing the offsets into localCoords, size = localCoords.extent(0)+1 |
Definition at line 574 of file MeshField_Element.hpp.
|
inline |
evaluate the field in the specified element at the specified parametric/local/area coordinate
Prefer coefficients and valueFromCoefficients when evaluating an element at more than one point.
| ent | the mesh entity index |
| localCoord | the parametric coordinate |
Definition at line 319 of file MeshField_Element.hpp.
|
inline |
compute the Jacobian at a parametric coordinate from the node coordinates
The field must be a coordinate field.
heavily based on SCOREC/core @ 7cd76473 apf/apfVectorElement.cc
| x | node coordinates from getNodeValues |
| localCoord | the parametric coordinate |
Definition at line 358 of file MeshField_Element.hpp.
|
inline |
jacobianFromNodeValues with the shape function gradients already evaluated, so they can be shared with a field that uses the same shape
| x | node coordinates from getNodeValues |
| grads | shapeFn.getLocalGradients at the parametric coordinate |
Definition at line 373 of file MeshField_Element.hpp.
|
inline |
compute dot product between the basis function gradients and the coefficients I.e., $$\sum_{A=1}^{N} c_A N_{A,x}$$
The result is the gradient with respect to the parametric coordinates, not the physical coordinates; mapping it to the physical element requires the geometry's Jacobian.
| c | coefficients from coefficients(ent) |
| localCoord | the parametric coordinate |
Definition at line 276 of file MeshField_Element.hpp.
|
inline |
localGradientFromCoefficients with the shape function gradients already evaluated, so they can be shared with a geometry that uses the same shape
| c | coefficients from coefficients(ent) |
| shapeGrads | shapeFn.getLocalGradients at the parametric coordinate |
Definition at line 292 of file MeshField_Element.hpp.
|
inline |
compute dot product between the basis functions and the coefficients I.e., $$\sum_{A=1}^{N} c_A N_A$$
heavily based on SCOREC/core @ 7cd76473 apf/apfElement.cc
| c | coefficients from coefficients(ent) |
| localCoord | the parametric coordinate |
Definition at line 249 of file MeshField_Element.hpp.