65 template <
typename FunctionSpace>
68 const int dim =
mesh.Dimension();
70 const auto ordering = mfem::Ordering::byNODES;
72 switch (FunctionSpace::family) {
74 coll_ = std::make_unique<mfem::H1_FECollection>(FunctionSpace::order, dim);
77 coll_ = std::make_unique<mfem::ND_FECollection>(FunctionSpace::order, dim);
80 coll_ = std::make_unique<mfem::RT_FECollection>(FunctionSpace::order, dim);
84 coll_ = std::make_unique<mfem::L2_FECollection>(FunctionSpace::order, dim, mfem::BasisType::GaussLobatto);
87 SLIC_ERROR_ROOT(
"Unknown finite element space requested.");
91 space_ = std::make_unique<mfem::ParFiniteElementSpace>(&
mesh,
coll_.get(), FunctionSpace::components, ordering);
94 HypreParVector new_vector(
space_.get());
97 auto* parallel_vec = new_vector.StealParVector();
98 WrapHypreParVector(parallel_vec);
101 HypreParVector::operator=(0.0);
111 HypreParVector::operator=(rhs);
173 const mfem::ParFiniteElementSpace&
space()
const {
return *
space_; }
200 std::reference_wrapper<mfem::ParMesh>
mesh_;
206 std::unique_ptr<mfem::FiniteElementCollection>
coll_;
211 std::unique_ptr<mfem::ParFiniteElementSpace>
space_;
Class for encapsulating the data associated with a vector derived from a MFEM finite element space....
std::string name_
The name of the finite element vector.
std::unique_ptr< mfem::FiniteElementCollection > coll_
Handle to the FiniteElementCollection, which is owned by MFEMSidreDataCollection.
FiniteElementVector(const FiniteElementVector &rhs)
Copy constructor.
MPI_Comm comm() const
Returns the MPI communicator for the state.
mfem::ParFiniteElementSpace & space()
Returns a non-owning reference to the internal FESpace.
virtual ~FiniteElementVector()
Destroy the Finite Element Vector object.
const mfem::ParMesh & mesh() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const mfem::ParFiniteElementSpace & space() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
FiniteElementVector & operator=(const FiniteElementVector &rhs)
Copy assignment.
std::reference_wrapper< mfem::ParMesh > mesh_
A reference to the mesh object on which the field is defined.
FiniteElementVector(mfem::ParMesh &mesh, FunctionSpace, const std::string &name="")
Construct a new Finite Element Vector object given a templated function space.
std::unique_ptr< mfem::ParFiniteElementSpace > space_
Handle to the mfem::ParFiniteElementSpace, which is owned by MFEMSidreDataCollection.
std::string name() const
Returns the name of the FEState (field)
FiniteElementVector(const mfem::ParFiniteElementSpace &space, const std::string &name="")
Minimal constructor for a FiniteElementVector given a finite element space.
mfem::ParMesh & mesh()
Returns a non-owning reference to the internal mesh object.
Implementation of the quadrature-function-based functional enabling rapid development of FEM formulat...
Accelerator functionality.
double innerProduct(const FiniteElementVector &v1, const FiniteElementVector &v2)
Find the inner prodcut between two finite element vectors across all dofs.
SERAC_HOST_DEVICE auto max(dual< gradient_type > a, double b)
Implementation of max for dual numbers.
SERAC_HOST_DEVICE auto min(dual< gradient_type > a, double b)
Implementation of min for dual numbers.
double avg(const FiniteElementVector &fe_vector)
Find the average value of a finite element vector across all dofs.
ElementType
The type of a finite element basis function.
@ H1
Nodal scalar-valued basis functions.
@ HDIV
Raviart-Thomas (continuous normal) vector-valued basis functions.
@ HCURL
Nedelec (continuous tangent) vector-valued basis functions.
Discontinuous elements of order p.
Arbitrary-rank tensor class.
This file contains the declaration of a two-element variant type.