IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS > Class Template Referenceabstract

The FiniteElementSpace class handles the mesh index mapping to vertices and elements and is the base class for other FiniteElementSpace classes (e.g. LagrangeSpace). More...

#include <FiniteElementSpace.h>

Inheritance diagram for ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >:
Collaboration diagram for ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >:

Public Types

typedef Vector< size_t, Dimindices_t
typedef Vector< T, Dimpoint_t
typedef Vector< size_t, numElementVerticesvertex_indices_t
typedef Vector< indices_t, numElementVerticesindices_list_t
typedef Vector< point_t, numElementVerticesvertex_points_t

Public Member Functions

 FiniteElementSpace (UniformCartesian< T, Dim > &mesh, ElementType &ref_element, const QuadratureType &quadrature)
 Construct a new FiniteElementSpace object.
void setMesh (UniformCartesian< T, Dim > &mesh)
KOKKOS_FUNCTION size_t numElements () const
 Mesh and Element operations ///////////////////////////////////////.
KOKKOS_FUNCTION size_t numElementsInDim (const size_t &dim) const
 Get the number of elements in a given dimension.
KOKKOS_FUNCTION indices_t getMeshVertexNDIndex (const size_t &vertex_index) const
 Get the NDIndex of a mesh vertex.
KOKKOS_FUNCTION size_t getMeshVertexIndex (const indices_t &vertex_nd_index) const
 Get the global index of a mesh vertex given its NDIndex.
KOKKOS_FUNCTION indices_t getElementNDIndex (const size_t &elementIndex) const
 Get the NDIndex (vector of indices for each dimension) of a mesh element.
KOKKOS_FUNCTION size_t getElementIndex (const indices_t &ndindex) const
 Get the global index of a mesh element given the NDIndex.
KOKKOS_FUNCTION vertex_indices_t getElementMeshVertexIndices (const indices_t &elementNDIndex) const
 Get all the global vertex indices of an element (given by its NDIndex).
KOKKOS_FUNCTION indices_list_t getElementMeshVertexNDIndices (const indices_t &elementNDIndex) const
 Get all the NDIndices of the vertices of an element (given by its NDIndex).
KOKKOS_FUNCTION vertex_points_t getElementMeshVertexPoints (const indices_t &elementNDIndex) const
 Get all the global vertex points of an element (given by its NDIndex).
virtual KOKKOS_FUNCTION size_t numGlobalDOFs () const =0
 Degree of Freedom operations //////////////////////////////////////.
virtual KOKKOS_FUNCTION size_t getLocalDOFIndex (const size_t &elementIndex, const size_t &globalDOFIndex) const =0
 Get the elements local DOF from the element index and global DOF index.
virtual KOKKOS_FUNCTION size_t getGlobalDOFIndex (const size_t &elementIndex, const size_t &localDOFIndex) const =0
 Get the global DOF index from the element index and local DOF.
virtual KOKKOS_FUNCTION Vector< size_t, NumElementDOFs > getLocalDOFIndices () const =0
 Get the local DOF indices (vector of local DOF indices) They are independent of the specific element because it only depends on the reference element type.
virtual KOKKOS_FUNCTION Vector< size_t, NumElementDOFs > getGlobalDOFIndices (const size_t &elementIndex) const =0
 Get the global DOF indices (vector of global DOF indices) of an element.

Public Attributes

UniformCartesian< T, Dim > & mesh_m
 Member variables //////////////////////////////////////////////////.
ElementType ref_element_m
const QuadratureType & quadrature_m
Vector< size_t, Dimnr_m
Vector< double, Dimhr_m
Vector< double, Dimorigin_m

Static Public Attributes

static constexpr unsigned dim = Dim
static constexpr unsigned numElementVertices = calculateNumElementVertices(Dim)
static constexpr unsigned numElementDOFs = NumElementDOFs

Detailed Description

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
class ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >

The FiniteElementSpace class handles the mesh index mapping to vertices and elements and is the base class for other FiniteElementSpace classes (e.g. LagrangeSpace).

Template Parameters
TThe floating point type
DimThe dimension of the mesh (same dimension as the space)
NumElementDOFsThe number of degrees of freedom per element
QuadratureTypeThe type of the quadrature rule (e.g. MidpointQuadrature, GaussJacobiQuadrature)
FieldLHSThe type of the left hand side field
FieldRHSThe type of the right hand side field (can be the same as FieldLHS)

Definition at line 41 of file FiniteElementSpace.h.

Member Typedef Documentation

◆ indices_list_t

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
typedef Vector<indices_t, numElementVertices> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::indices_list_t

Definition at line 59 of file FiniteElementSpace.h.

◆ indices_t

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
typedef Vector<size_t, Dim> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::indices_t

Definition at line 51 of file FiniteElementSpace.h.

◆ point_t

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
typedef Vector<T, Dim> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::point_t

Definition at line 54 of file FiniteElementSpace.h.

◆ vertex_indices_t

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
typedef Vector<size_t, numElementVertices> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::vertex_indices_t

Definition at line 57 of file FiniteElementSpace.h.

◆ vertex_points_t

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
typedef Vector<point_t, numElementVertices> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::vertex_points_t

Definition at line 61 of file FiniteElementSpace.h.

Constructor & Destructor Documentation

◆ FiniteElementSpace()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::FiniteElementSpace ( UniformCartesian< T, Dim > & mesh,
ElementType & ref_element,
const QuadratureType & quadrature )

Construct a new FiniteElementSpace object.

Parameters
meshThe mesh object
ref_elementThe reference element object
quadratureThe quadrature rule object

Definition at line 6 of file FiniteElementSpace.hpp.

References Dim, ippl::Mesh< T, Dim >::Dimension, FiniteElementSpace(), hr_m, mesh_m, nr_m, origin_m, quadrature_m, and ref_element_m.

Referenced by FiniteElementSpace(), getElementIndex(), getElementMeshVertexIndices(), getElementMeshVertexNDIndices(), getElementMeshVertexPoints(), and getMeshVertexIndex().

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

Member Function Documentation

◆ getElementIndex()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION size_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getElementIndex ( const indices_t & ndindex) const

Get the global index of a mesh element given the NDIndex.

Parameters
ndindexindices_t (Vector<size_t, Dim>) - vector of indices for each direction
Returns
size_t - the index of the element

Definition at line 154 of file FiniteElementSpace.hpp.

References Dim, and FiniteElementSpace().

Here is the call graph for this function:

◆ getElementMeshVertexIndices()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::vertex_indices_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getElementMeshVertexIndices ( const indices_t & elementNDIndex) const

Get all the global vertex indices of an element (given by its NDIndex).

Parameters
elementNDIndexThe NDIndex of the element
Returns
vertex_indices_t (Vector<size_t, numElementVertices>) - vector of vertex indices

Definition at line 178 of file FiniteElementSpace.hpp.

References Dim, FiniteElementSpace(), and nr_m.

Here is the call graph for this function:

◆ getElementMeshVertexNDIndices()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::indices_list_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getElementMeshVertexNDIndices ( const indices_t & elementNDIndex) const

Get all the NDIndices of the vertices of an element (given by its NDIndex).

Parameters
elementNDIndexThe NDIndex of the element
Returns
indices_list_t (Vector<Vector<size_t, Dim>, numElementVertices>) - vector of vertex NDIndices

Definition at line 230 of file FiniteElementSpace.hpp.

References Dim, and FiniteElementSpace().

Referenced by getElementMeshVertexPoints().

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

◆ getElementMeshVertexPoints()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::vertex_points_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getElementMeshVertexPoints ( const indices_t & elementNDIndex) const

Get all the global vertex points of an element (given by its NDIndex).

Parameters
elementNDIndexThe NDIndex of the element
Returns
vertex_points_t (Vector<Vector<T, Dim>, numElementVertices>) -

Definition at line 270 of file FiniteElementSpace.hpp.

References Dim, ippl::Vector< T, Dim >::dim, FiniteElementSpace(), ippl::NDIndex< Dim >::first(), getElementMeshVertexNDIndices(), hr_m, and origin_m.

Here is the call graph for this function:

◆ getElementNDIndex()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::indices_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getElementNDIndex ( const size_t & elementIndex) const

Get the NDIndex (vector of indices for each dimension) of a mesh element.

Parameters
elementIndexindices_t (Vector<size_t, Dim>) - The index of the element
Returns
indices_t (Vector<size_t, Dim>) - vector of indices for each dimension

Definition at line 121 of file FiniteElementSpace.hpp.

References getElementNDIndex().

Referenced by getElementNDIndex().

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

◆ getGlobalDOFIndex()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
virtual KOKKOS_FUNCTION size_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getGlobalDOFIndex ( const size_t & elementIndex,
const size_t & localDOFIndex ) const
pure virtual

◆ getGlobalDOFIndices()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
virtual KOKKOS_FUNCTION Vector< size_t, NumElementDOFs > ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getGlobalDOFIndices ( const size_t & elementIndex) const
pure virtual

◆ getLocalDOFIndex()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
virtual KOKKOS_FUNCTION size_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getLocalDOFIndex ( const size_t & elementIndex,
const size_t & globalDOFIndex ) const
pure virtual

◆ getLocalDOFIndices()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
virtual KOKKOS_FUNCTION Vector< size_t, NumElementDOFs > ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getLocalDOFIndices ( ) const
pure virtual

◆ getMeshVertexIndex()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION size_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getMeshVertexIndex ( const indices_t & vertex_nd_index) const

Get the global index of a mesh vertex given its NDIndex.

Parameters
vertex_nd_indexindices_t (Vector<size_t, Dim>) - The NDIndex of the vertex (vector of indices for each dimension).
Returns
size_t - unsigned integer index of the mesh vertex

Definition at line 99 of file FiniteElementSpace.hpp.

References Dim, dim, and FiniteElementSpace().

Here is the call graph for this function:

◆ getMeshVertexNDIndex()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::indices_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::getMeshVertexNDIndex ( const size_t & vertex_index) const

Get the NDIndex of a mesh vertex.

Parameters
vertex_indexsize_t - The index of the vertex
Returns
indices_t (Vector<size_t, Dim>) - Returns the NDIndex (vector of indices for each dimension)

Definition at line 68 of file FiniteElementSpace.hpp.

References getMeshVertexNDIndex().

Referenced by getMeshVertexNDIndex().

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

◆ numElements()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION size_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::numElements ( ) const

Mesh and Element operations ///////////////////////////////////////.

Get the number of elements in the mesh of the space

Returns
size_t - unsigned integer number of elements

Definition at line 44 of file FiniteElementSpace.hpp.

References Dim, nr_m, and numElements().

Referenced by numElements().

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

◆ numElementsInDim()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
KOKKOS_FUNCTION size_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::numElementsInDim ( const size_t & dim) const

Get the number of elements in a given dimension.

Parameters
dimsize_t - representing the dimension
Returns
size_t - unsigned integer number of elements in the given dimension

Definition at line 59 of file FiniteElementSpace.hpp.

References dim, nr_m, and numElementsInDim().

Referenced by numElementsInDim().

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

◆ numGlobalDOFs()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
virtual KOKKOS_FUNCTION size_t ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::numGlobalDOFs ( ) const
pure virtual

◆ setMesh()

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
void ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::setMesh ( UniformCartesian< T, Dim > & mesh)

Definition at line 26 of file FiniteElementSpace.hpp.

References Dim, ippl::Mesh< T, Dim >::Dimension, hr_m, mesh_m, nr_m, origin_m, and setMesh().

Referenced by setMesh().

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

Member Data Documentation

◆ dim

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
unsigned ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::dim = Dim
staticconstexpr

Definition at line 43 of file FiniteElementSpace.h.

Referenced by getMeshVertexIndex(), and numElementsInDim().

◆ hr_m

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
Vector<double, Dim> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::hr_m

Definition at line 231 of file FiniteElementSpace.h.

Referenced by FiniteElementSpace(), getElementMeshVertexPoints(), and setMesh().

◆ mesh_m

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
UniformCartesian<T, Dim>& ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::mesh_m

Member variables //////////////////////////////////////////////////.

Definition at line 227 of file FiniteElementSpace.h.

Referenced by FiniteElementSpace(), and setMesh().

◆ nr_m

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
Vector<size_t, Dim> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::nr_m

◆ numElementDOFs

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
unsigned ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::numElementDOFs = NumElementDOFs
staticconstexpr

Definition at line 48 of file FiniteElementSpace.h.

◆ numElementVertices

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
unsigned ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::numElementVertices = calculateNumElementVertices(Dim)
staticconstexpr

Definition at line 47 of file FiniteElementSpace.h.

◆ origin_m

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
Vector<double, Dim> ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::origin_m

Definition at line 232 of file FiniteElementSpace.h.

Referenced by FiniteElementSpace(), getElementMeshVertexPoints(), and setMesh().

◆ quadrature_m

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
const QuadratureType& ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::quadrature_m

Definition at line 229 of file FiniteElementSpace.h.

Referenced by FiniteElementSpace().

◆ ref_element_m

template<typename T, unsigned Dim, unsigned NumElementDOFs, typename ElementType, typename QuadratureType, typename FieldLHS, typename FieldRHS>
ElementType ippl::FiniteElementSpace< T, Dim, NumElementDOFs, ElementType, QuadratureType, FieldLHS, FieldRHS >::ref_element_m

Definition at line 228 of file FiniteElementSpace.h.

Referenced by FiniteElementSpace().


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