5#ifndef IPPL_NEDELECSPACE_H
6#define IPPL_NEDELECSPACE_H
16 return static_cast<unsigned>(
static_cast<int>(
Dim)*
power(2,
static_cast<int>(
Dim-1)));
31 template <
typename T,
unsigned Dim,
unsigned Order,
typename ElementType,
32 typename QuadratureType,
typename FieldType>
35 ElementType, QuadratureType, FEMVector<T>, FEMVector<T>> {
45 static constexpr unsigned order = Order;
85 const QuadratureType& quadrature,
const Layout_t& layout);
97 const QuadratureType& quadrature);
134 const size_t& globalDOFIndex)
const override;
145 const size_t& localDOFIndex)
const override;
165 const size_t& elementIndex)
const override;
227 const point_t& localPoint)
const;
242 const point_t& localPoint)
const;
255 template <
typename F>
283 template <
typename F>
typename ippl::detail::ViewType< ippl::Vector< double, Dim >, 1 >::view_type view_type
constexpr T power(T base, unsigned exponent)
constexpr unsigned getNedelecNumElementDOFs(unsigned Dim, unsigned Order)
1D vector used in the context of FEM.
FiniteElementSpace(UniformCartesian< T, Dim > &mesh, ElementType &ref_element, const QuadratureType &quadrature)
FEMVector< T > evaluateLoadVectorFunctor(const F &f) const
Assemble the load vector b of the system Ax = b, given a functional of the rhs. If a field instead of...
KOKKOS_FUNCTION size_t getGlobalDOFIndex(const size_t &elementIndex, const size_t &localDOFIndex) const override
Get the global DOF index from the element index and local DOF.
detail::ViewType< T, 1 >::view_type ViewType
static constexpr unsigned numElementVertices
KOKKOS_FUNCTION Vector< size_t, numElementDOFs > getFEMVectorDOFIndices(const size_t &elementIndex, NDIndex< Dim > ldom) const
Get the DOF indices (vector of indices) corresponding to the position inside the FEMVector of an elem...
FEMVector< T > evaluateAx(FEMVector< T > &x, F &evalFunction) const
Assembly operations ///////////////////////////////////////////////.
FiniteElementSpace< T, Dim, numElementDOFs, ElementType, QuadratureType, FEMVector< T >, FEMVector< T > >::vertex_points_t vertex_points_t
T computeError(const FEMVector< T > &u_h, const F &u_sol) const
Error norm computations ///////////////////////////////////////////.
Kokkos::View< size_t * > elementIndices
void initialize(UniformCartesian< T, Dim > &mesh, const Layout_t &layout)
Initialize a NedelecSpace object created with the default constructor.
NedelecSpace(UniformCartesian< T, Dim > &mesh, ElementType &ref_element, const QuadratureType &quadrature)
Construct a new NedelecSpace object (without layout) This constructor is made to work with the defaul...
void initializeElementIndices(const Layout_t &layout)
Initialize a Kokkos view containing the element indices.
FieldLayout< Dim > Layout_t
KOKKOS_FUNCTION int getBoundarySide(const size_t &dofIdx) const
Returns which side the boundary is on.
FiniteElementSpace< T, Dim, numElementDOFs, ElementType, QuadratureType, FEMVector< T >, FEMVector< T > >::point_t point_t
KOKKOS_FUNCTION point_t getLocalDOFPosition(size_t localDOFIndex) const
Get the cartesion position of a local DOF in the reference element.
KOKKOS_FUNCTION point_t evaluateRefElementShapeFunctionCurl(const size_t &localDOF, const point_t &localPoint) const
Evaluate the curl of the shape function of a local degree of of freedom at ta given point in the refe...
static constexpr unsigned dim
FEMVector< T > createFEMVector3d() const
Implementation of the NedelecSpace::createFEMVector function for 3d.
KOKKOS_FUNCTION size_t numGlobalDOFs() const override
Degree of Freedom operations //////////////////////////////////////.
FEMVector< T > createFEMVector() const
FEMVector conversion and creation//////////////////////////////////.
FiniteElementSpace< T, Dim, numElementDOFs, ElementType, QuadratureType, FEMVector< T >, FEMVector< T > >::indices_t indices_t
KOKKOS_FUNCTION Vector< size_t, numElementDOFs > getGlobalDOFIndices(const indices_t &elementIndex) const
Get the global DOF indices (vector of global DOF indices) of an element.
KOKKOS_FUNCTION bool isDOFOnBoundary(const size_t &dofIdx) const
Check if a DOF is on the boundary of the mesh.
FEMVector< T > evaluateLoadVector(const FEMVector< point_t > &f) const
Assemble the load vector b of the system Ax = b, given a field of the right hand side defined at the ...
KOKKOS_FUNCTION point_t evaluateRefElementShapeFunction(const size_t &localDOF, const point_t &localPoint) const
Basis functions and gradients /////////////////////////////////////.
KOKKOS_FUNCTION Vector< size_t, numElementDOFs > getGlobalDOFIndices(const size_t &elementIndex) const override
Get the global DOF indices (vector of global DOF indices) of an element.
NedelecSpace(UniformCartesian< T, Dim > &mesh, ElementType &ref_element, const QuadratureType &quadrature, const Layout_t &layout)
Construct a new NedelecSpace object.
detail::ViewType< T, 1, Kokkos::MemoryTraits< Kokkos::Atomic > >::view_type AtomicViewType
KOKKOS_FUNCTION size_t getLocalDOFIndex(const size_t &elementIndex, const size_t &globalDOFIndex) const override
Get the elements local DOF from the element index and global DOF index.
KOKKOS_FUNCTION Vector< size_t, numElementDOFs > getFEMVectorDOFIndices(indices_t elementIndex, NDIndex< Dim > ldom) const
Get the DOF indices (vector of indices) corresponding to the position inside the FEMVector of an elem...
KOKKOS_FUNCTION Vector< size_t, numElementDOFs > getLocalDOFIndices() const override
Get the local DOF indices (vector of local DOF indices) They are independent of the specific element ...
static constexpr unsigned numElementDOFs
static constexpr unsigned order
Kokkos::View< point_t * > reconstructToPoints(const Kokkos::View< point_t * > &positions, const FEMVector< T > &coef) const
Reconstructs function values at arbitrary points in the mesh given the Nedelec DOF coefficients.
FEMVector< T > createFEMVector2d() const
Implementation of the NedelecSpace::createFEMVector function for 2d.
Vector< point_t, 12 > localDofPositions_m
Kokkos::View< typename NPtr< T, Dim >::type, Properties... > view_type