5#ifndef IPPL_NEDELECSPACE_H
6#define IPPL_NEDELECSPACE_H
10#include "FEM/FEMQuadratureData.h"
11#include "FEM/FEMVector.h"
12#include "FEM/FiniteElementSpace.h"
14constexpr unsigned getNedelecNumElementDOFs(
unsigned Dim, [[maybe_unused]]
unsigned Order) {
17 return static_cast<unsigned>(
static_cast<int>(Dim) * power(2,
static_cast<int>(Dim - 1)));
32 template <
typename T,
unsigned Dim,
unsigned Order,
typename ElementType,
33 typename QuadratureType,
typename FieldType>
37 QuadratureType, FEMVector<T>, FEMVector<T>> {
40 static constexpr unsigned numElementDOFs = getNedelecNumElementDOFs(Dim, Order);
43 static constexpr unsigned dim =
48 static constexpr unsigned order = Order;
51 static constexpr unsigned numElementVertices =
56 typedef typename FiniteElementSpace<T, Dim, numElementDOFs, ElementType, QuadratureType,
60 typedef typename FiniteElementSpace<T, Dim, numElementDOFs, ElementType, QuadratureType,
63 typedef typename FiniteElementSpace<T, Dim, numElementDOFs, ElementType, QuadratureType,
71 typedef typename detail::ViewType<T, 1>::view_type ViewType;
88 const QuadratureType& quadrature,
const Layout_t& layout);
100 const QuadratureType& quadrature);
146 const size_t& globalDOFIndex)
const override;
157 const size_t& localDOFIndex)
const override;
177 const size_t& elementIndex)
const override;
239 const point_t& localPoint)
const;
253 const size_t& localDOF,
const point_t& localPoint)
const;
267 template <
typename F>
294 template <
typename F>
355 template <
typename F>
412 Kokkos::View<size_t*> elementIndices;
435#include "FEM/NedelecSpace.hpp"
1D vector used in the context of FEM.
Definition FEMVector.h:34
Definition FieldLayout.h:166
The FiniteElementSpace class handles the mesh index mapping to vertices and elements and is the base ...
Definition FiniteElementSpace.h:41
A class representing a Nedelec space for finite element methods on a structured, rectilinear grid.
Definition NedelecSpace.h:37
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...
Definition NedelecSpace.hpp:610
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.
Definition NedelecSpace.hpp:188
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...
Definition NedelecSpace.hpp:343
NDIndex< Dim > getLocalNDIndex() const
Return the local NDIndex of this rank's subdomain.
Definition NedelecSpace.h:124
FEMVector< T > evaluateAx(FEMVector< T > &x, F &evalFunction) const
Assembly operations ///////////////////////////////////////////////.
Definition NedelecSpace.hpp:372
T computeError(const FEMVector< T > &u_h, const F &u_sol) const
Error norm computations ///////////////////////////////////////////.
Definition NedelecSpace.hpp:912
void initialize(UniformCartesian< T, Dim > &mesh, const Layout_t &layout)
Initialize a NedelecSpace object created with the default constructor.
Definition NedelecSpace.hpp:43
void initializeElementIndices(const Layout_t &layout)
Initialize a Kokkos view containing the element indices.
Definition NedelecSpace.hpp:73
KOKKOS_FUNCTION int getBoundarySide(const size_t &dofIdx) const
Returns which side the boundary is on.
Definition NedelecSpace.hpp:1091
KOKKOS_FUNCTION point_t getLocalDOFPosition(size_t localDOFIndex) const
Get the cartesion position of a local DOF in the reference element.
Definition NedelecSpace.hpp:355
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...
Definition NedelecSpace.hpp:761
KOKKOS_FUNCTION size_t numGlobalDOFs() const override
Degree of Freedom operations //////////////////////////////////////.
Definition NedelecSpace.hpp:138
FEMVector< T > createFEMVector() const
FEMVector conversion and creation//////////////////////////////////.
Definition NedelecSpace.hpp:815
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.
Definition NedelecSpace.hpp:1003
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 ...
Definition NedelecSpace.hpp:494
KOKKOS_FUNCTION point_t evaluateRefElementShapeFunction(const size_t &localDOF, const point_t &localPoint) const
Basis functions and gradients /////////////////////////////////////.
Definition NedelecSpace.hpp:706
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.
Definition NedelecSpace.hpp:267
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.
Definition NedelecSpace.hpp:157
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 ...
Definition NedelecSpace.hpp:201
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.
Definition NedelecSpace.hpp:830
Definition ViewTypes.h:44