IPPL API Reference
Independent Parallel Particle Layer C++ API
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, Dim > indices_t
 
typedef Vector< T, Dim > point_t
 
typedef Vector< size_t, numElementVertices > vertex_indices_t
 
typedef Vector< indices_t, numElementVertices > indices_list_t
 
typedef Vector< point_t, numElementVertices > vertex_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, Dim > nr_m
 
Vector< double, Dim > hr_m
 
Vector< double, Dim > origin_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)

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

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

◆ 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

◆ 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

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

◆ 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

◆ 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

Get the global DOF index from the element index and local DOF.

Parameters
elementIndexsize_t - The index of the element
localDOFIndexsize_t - The local DOF index
Returns
size_t - The global DOF index

Implemented in ippl::LagrangeSpace< T, Dim, Order, ElementType, QuadratureType, FieldLHS, FieldRHS >, ippl::LagrangeSpace< Tlhs, Dim, 1, ElementType, QuadratureType, FieldLHS, FieldLHS >, ippl::NedelecSpace< T, Dim, Order, ElementType, QuadratureType, FieldType >, and ippl::NedelecSpace< T, Dim, 1, ElementType, QuadratureType, FieldType >.

◆ 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

Get the global DOF indices (vector of global DOF indices) of an element.

Parameters
elementIndexsize_t - The index of the element
Returns
Vector<size_t, NumElementDOFs> - The global DOF indices

Implemented in ippl::LagrangeSpace< T, Dim, Order, ElementType, QuadratureType, FieldLHS, FieldRHS >, ippl::LagrangeSpace< Tlhs, Dim, 1, ElementType, QuadratureType, FieldLHS, FieldLHS >, ippl::NedelecSpace< T, Dim, Order, ElementType, QuadratureType, FieldType >, and ippl::NedelecSpace< T, Dim, 1, ElementType, QuadratureType, FieldType >.

◆ 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

Get the elements local DOF from the element index and global DOF index.

Parameters
elementIndexsize_t - The index of the element
globalDOFIndexsize_t - The global DOF index
Returns
size_t - The local DOF index

Implemented in ippl::LagrangeSpace< T, Dim, Order, ElementType, QuadratureType, FieldLHS, FieldRHS >, ippl::LagrangeSpace< Tlhs, Dim, 1, ElementType, QuadratureType, FieldLHS, FieldLHS >, ippl::NedelecSpace< T, Dim, Order, ElementType, QuadratureType, FieldType >, and ippl::NedelecSpace< T, Dim, 1, ElementType, QuadratureType, FieldType >.

◆ 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

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.

Returns
Vector<size_t, NumElementDOFs> - The local DOF indices

Implemented in ippl::LagrangeSpace< T, Dim, Order, ElementType, QuadratureType, FieldLHS, FieldRHS >, ippl::LagrangeSpace< Tlhs, Dim, 1, ElementType, QuadratureType, FieldLHS, FieldLHS >, ippl::NedelecSpace< T, Dim, Order, ElementType, QuadratureType, FieldType >, and ippl::NedelecSpace< T, Dim, 1, ElementType, QuadratureType, FieldType >.

◆ 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

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

◆ 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

◆ 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

◆ 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

Degree of Freedom operations //////////////////////////////////////.

Get the number of global degrees of freedom in the space

Returns
size_t - unsigned integer number of global degrees of freedom

Implemented in ippl::LagrangeSpace< T, Dim, Order, ElementType, QuadratureType, FieldLHS, FieldRHS >, ippl::LagrangeSpace< Tlhs, Dim, 1, ElementType, QuadratureType, FieldLHS, FieldLHS >, ippl::NedelecSpace< T, Dim, Order, ElementType, QuadratureType, FieldType >, and ippl::NedelecSpace< T, Dim, 1, ElementType, QuadratureType, FieldType >.


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