32 return holds_alternative<std::shared_ptr<mfem::Coefficient>>(coef);
40 return holds_alternative<std::shared_ptr<mfem::VectorCoefficient>>(coef);
51 using mfem::Vector::Print;
136 void fillGridFunction(mfem::ParGridFunction& grid_function)
const { grid_function.SetFromTrueDofs(*
this); }
148 void setFromGridFunction(
const mfem::ParGridFunction& grid_function) { grid_function.GetTrueDofs(*
this); }
159 void project(mfem::VectorCoefficient& coef, mfem::Array<int>& dof_list);
171 void project(mfem::Coefficient& coef, mfem::Array<int>& dof_list, std::optional<int> component = {});
183 void project(mfem::Coefficient& coef);
186 void project(mfem::VectorCoefficient& coef);
197 void projectOnBoundary(mfem::Coefficient& coef,
const mfem::Array<int>& markers);
200 void projectOnBoundary(mfem::VectorCoefficient& coef,
const mfem::Array<int>& markers);
Class for encapsulating the critical MFEM components of a primal finite element field.
FiniteElementState & operator=(FiniteElementState &&rhs)
Move assignment.
void projectOnBoundary(mfem::Coefficient &coef, const mfem::Array< int > &markers)
Project a coefficient on a specific set of marked boundaries.
FiniteElementState(FiniteElementState &&rhs)
Move construct a new Finite Element State object.
std::unique_ptr< mfem::ParGridFunction > grid_func_
An optional container for a grid function (L-vector) view of the finite element state.
void setFromGridFunction(const mfem::ParGridFunction &grid_function)
Initialize the true vector in the FiniteElementState based on an input grid function.
FiniteElementState(const FiniteElementState &rhs)
Copy constructor.
FiniteElementState & operator=(const mfem::HypreParVector &rhs)
Copy assignment with HypreParVector.
void fillGridFunction(mfem::ParGridFunction &grid_function) const
Fill a user-provided grid function based on the underlying true vector.
mfem::ParGridFunction & gridFunction() const
Construct a grid function from the finite element state true vector.
FiniteElementState & operator=(const FiniteElementState &rhs)
Copy assignment.
FiniteElementState & operator=(double rhs)
Copy assignment with double.
void project(mfem::VectorCoefficient &coef, mfem::Array< int > &dof_list)
Project a vector coefficient onto a set of dofs.
FiniteElementState & operator=(const mfem::Vector &rhs)
Copy assignment with mfem::Vector.
Class for encapsulating the data associated with a vector derived from a MFEM finite element space....
FiniteElementVector & operator=(const FiniteElementVector &rhs)
Copy assignment.
FiniteElementVector(const mfem::ParFiniteElementSpace &space, const std::string &name="")
Minimal constructor for a FiniteElementVector given a finite element space.
This file contains the declaration of structure that manages vectors derived from an MFEM finite elem...
Accelerator functionality.
variant< std::shared_ptr< mfem::Coefficient >, std::shared_ptr< mfem::VectorCoefficient > > GeneralCoefficient
A sum type for encapsulating either a scalar or vector coeffient.
bool is_vector_valued(const GeneralCoefficient &coef)
convenience function for querying the type stored in a GeneralCoefficient
bool is_scalar_valued(const GeneralCoefficient &coef)
convenience function for querying the type stored in a GeneralCoefficient
double computeL2Error(const FiniteElementState &state, mfem::VectorCoefficient &exact_solution)
Find the L2 norm of the error of a vector-valued finite element state with respect to an exact soluti...
constexpr SERAC_HOST_DEVICE auto norm(const isotropic_tensor< T, m, m > &I)
compute the Frobenius norm (sqrt(tr(dot(transpose(I), I)))) of an isotropic tensor
This file contains the declaration of a two-element variant type.