Serac  0.1
Serac is an implicit thermal strucural mechanics simulation code.
Public Member Functions | Protected Attributes | List of all members
serac::FiniteElementDual Class Reference

Class for encapsulating the dual vector space of a finite element space (i.e. the space of linear forms as applied to a specific basis set) More...

#include <finite_element_dual.hpp>

Collaboration diagram for serac::FiniteElementDual:
Collaboration graph
[legend]

Public Member Functions

 FiniteElementDual (const FiniteElementDual &rhs)
 Copy constructor. More...
 
 FiniteElementDual (FiniteElementDual &&rhs)
 Move construct a new Finite Element Dual object. More...
 
FiniteElementDualoperator= (FiniteElementDual &&rhs)
 Move assignment. More...
 
FiniteElementDualoperator= (const FiniteElementDual &rhs)
 Copy assignment. More...
 
void fillLinearForm (mfem::ParLinearForm &linear_form) const
 Fill a user-provided linear form based on the underlying true vector. More...
 
void setFromLinearForm (const mfem::ParLinearForm &linear_form)
 Initialize the true vector in the FiniteElementDual based on an input linear form. More...
 
mfem::ParLinearForm & linearForm () const
 Construct a linear form from the finite element dual true vector. More...
 
 FiniteElementVector (const mfem::ParFiniteElementSpace &space, const std::string &name="")
 Minimal constructor for a FiniteElementVector given a finite element space. More...
 
template<typename FunctionSpace >
 FiniteElementVector (mfem::ParMesh &mesh, FunctionSpace, const std::string &name="")
 Construct a new Finite Element Vector object given a templated function space. More...
 
 FiniteElementVector (const FiniteElementVector &rhs)
 Copy constructor. More...
 
 FiniteElementVector (FiniteElementVector &&rhs)
 Move construct a new Finite Element Vector object. More...
 
FiniteElementVectoroperator= (const FiniteElementVector &rhs)
 Copy assignment. More...
 
FiniteElementVectoroperator= (FiniteElementVector &&rhs)
 Move assignment. More...
 
FiniteElementVectoroperator= (const mfem::HypreParVector &rhs)
 Copy assignment from a hypre par vector. More...
 
FiniteElementVectoroperator= (const mfem::Vector &rhs)
 Copy assignment from a hypre par vector. More...
 
FiniteElementVectoroperator= (const double value)
 Set a finite element state to a constant value. More...
 
- Public Member Functions inherited from serac::FiniteElementVector
 FiniteElementVector (const mfem::ParFiniteElementSpace &space, const std::string &name="")
 Minimal constructor for a FiniteElementVector given a finite element space. More...
 
template<typename FunctionSpace >
 FiniteElementVector (mfem::ParMesh &mesh, FunctionSpace, const std::string &name="")
 Construct a new Finite Element Vector object given a templated function space. More...
 
 FiniteElementVector (const FiniteElementVector &rhs)
 Copy constructor. More...
 
 FiniteElementVector (FiniteElementVector &&rhs)
 Move construct a new Finite Element Vector object. More...
 
FiniteElementVectoroperator= (const FiniteElementVector &rhs)
 Copy assignment. More...
 
FiniteElementVectoroperator= (FiniteElementVector &&rhs)
 Move assignment. More...
 
FiniteElementVectoroperator= (const mfem::HypreParVector &rhs)
 Copy assignment from a hypre par vector. More...
 
FiniteElementVectoroperator= (const mfem::Vector &rhs)
 Copy assignment from a hypre par vector. More...
 
MPI_Comm comm () const
 Returns the MPI communicator for the state. More...
 
mfem::ParMesh & mesh ()
 Returns a non-owning reference to the internal mesh object. More...
 
const mfem::ParMesh & mesh () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
mfem::ParFiniteElementSpace & space ()
 Returns a non-owning reference to the internal FESpace. More...
 
const mfem::ParFiniteElementSpace & space () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string name () const
 Returns the name of the FEState (field) More...
 
FiniteElementVectoroperator= (const double value)
 Set a finite element state to a constant value. More...
 
virtual ~FiniteElementVector ()
 Destroy the Finite Element Vector object.
 

Protected Attributes

std::unique_ptr< mfem::ParLinearForm > linear_form_
 An optional container for a linear form (L-vector) view of the finite element dual. More...
 
- Protected Attributes inherited from serac::FiniteElementVector
std::reference_wrapper< mfem::ParMesh > mesh_
 A reference to the mesh object on which the field is defined.
 
std::unique_ptr< mfem::FiniteElementCollection > coll_
 Handle to the FiniteElementCollection, which is owned by MFEMSidreDataCollection. More...
 
std::unique_ptr< mfem::ParFiniteElementSpace > space_
 Handle to the mfem::ParFiniteElementSpace, which is owned by MFEMSidreDataCollection.
 
std::string name_ = ""
 The name of the finite element vector.
 

Detailed Description

Class for encapsulating the dual vector space of a finite element space (i.e. the space of linear forms as applied to a specific basis set)

Definition at line 28 of file finite_element_dual.hpp.

Constructor & Destructor Documentation

◆ FiniteElementDual() [1/2]

serac::FiniteElementDual::FiniteElementDual ( const FiniteElementDual rhs)
inline

Copy constructor.

Parameters
[in]rhsThe input Dual used for construction

Definition at line 39 of file finite_element_dual.hpp.

◆ FiniteElementDual() [2/2]

serac::FiniteElementDual::FiniteElementDual ( FiniteElementDual &&  rhs)
inline

Move construct a new Finite Element Dual object.

Parameters
[in]rhsThe input vector used for construction

Definition at line 52 of file finite_element_dual.hpp.

Member Function Documentation

◆ fillLinearForm()

void serac::FiniteElementDual::fillLinearForm ( mfem::ParLinearForm &  linear_form) const
inline

Fill a user-provided linear form based on the underlying true vector.

This distributes true vector dofs to the finite element (local) dofs by multiplying the true dofs by the restriction transpose operator.

See also
MFEM documentation for details
Parameters
linear_formThe linear form used to initialize the underlying true vector.

Definition at line 95 of file finite_element_dual.hpp.

◆ FiniteElementVector() [1/4]

serac::FiniteElementVector::FiniteElementVector
inline

Copy constructor.

Parameters
[in]rhsThe input vector used for construction

Definition at line 109 of file finite_element_vector.hpp.

◆ FiniteElementVector() [2/4]

serac::FiniteElementVector::FiniteElementVector

Minimal constructor for a FiniteElementVector given a finite element space.

Parameters
[in]spaceThe space to use for the finite element state. This space is deep copied into the new FE state
[in]nameThe name of the field

Definition at line 56 of file finite_element_vector.cpp.

◆ FiniteElementVector() [3/4]

serac::FiniteElementVector::FiniteElementVector

Move construct a new Finite Element Vector object.

Parameters
[in]rhsThe input vector used for construction

Definition at line 119 of file finite_element_vector.cpp.

◆ FiniteElementVector() [4/4]

template<typename FunctionSpace >
serac::FiniteElementVector::FiniteElementVector ( typename FunctionSpace  )
inline

Construct a new Finite Element Vector object given a templated function space.

Template Parameters
FunctionSpacewhat kind of interpolating functions to use
Parameters
meshThe mesh used to construct the finite element state
nameThe name of the new finite element state field

Definition at line 66 of file finite_element_vector.hpp.

◆ linearForm()

mfem::ParLinearForm& serac::FiniteElementDual::linearForm ( ) const
inline

Construct a linear form from the finite element dual true vector.

Returns
The constructed linear form

Definition at line 122 of file finite_element_dual.hpp.

◆ operator=() [1/7]

FiniteElementVector & serac::FiniteElementVector::operator=

Set a finite element state to a constant value.

Parameters
valueThe constant to set the finite element state to
Returns
The modified finite element state
Note
This sets the true degrees of freedom and then broadcasts to the shared grid function entries. This means that if a different value is given on different processors, a shared DOF will be set to the owning processor value.

Definition at line 189 of file finite_element_vector.cpp.

◆ operator=() [2/7]

FiniteElementDual& serac::FiniteElementDual::operator= ( const FiniteElementDual rhs)
inline

Copy assignment.

Parameters
rhsThe right hand side input Dual
Returns
The assigned FiniteElementDual

Definition at line 75 of file finite_element_dual.hpp.

◆ operator=() [3/7]

FiniteElementVector & serac::FiniteElementVector::operator=

Copy assignment.

Parameters
rhsThe right hand side input vector
Returns
The assigned FiniteElementVector

Definition at line 127 of file finite_element_vector.cpp.

◆ operator=() [4/7]

FiniteElementVector & serac::FiniteElementVector::operator=

Copy assignment from a hypre par vector.

Parameters
rhsThe rhs input hypre par vector
Returns
The copy assigned input vector

Definition at line 143 of file finite_element_vector.cpp.

◆ operator=() [5/7]

FiniteElementVector & serac::FiniteElementVector::operator=

Copy assignment from a hypre par vector.

Parameters
rhsThe rhs input hypre par vector
Returns
The copy assigned input vector

Definition at line 151 of file finite_element_vector.cpp.

◆ operator=() [6/7]

FiniteElementDual& serac::FiniteElementDual::operator= ( FiniteElementDual &&  rhs)
inline

Move assignment.

Parameters
rhsThe right hand side input Dual
Returns
The assigned FiniteElementDual

Definition at line 63 of file finite_element_dual.hpp.

◆ operator=() [7/7]

FiniteElementVector & serac::FiniteElementVector::operator=

Move assignment.

Parameters
rhsThe right hand side input vector
Returns
The move assigned input vector

Definition at line 135 of file finite_element_vector.cpp.

◆ setFromLinearForm()

void serac::FiniteElementDual::setFromLinearForm ( const mfem::ParLinearForm &  linear_form)
inline

Initialize the true vector in the FiniteElementDual based on an input linear form.

This distributes the linear form dofs to the true vector dofs by multiplying by the prolongation transpose operator.

See also
MFEM documentation for details
Note
The underlying MFEM call should really be const
Parameters
linear_formThe linear form used to initialize the underlying true vector.

Definition at line 112 of file finite_element_dual.hpp.

Member Data Documentation

◆ linear_form_

std::unique_ptr<mfem::ParLinearForm> serac::FiniteElementDual::linear_form_
mutableprotected

An optional container for a linear form (L-vector) view of the finite element dual.

If a user requests it, it is constructed and potentially reused during subsequent calls. It is not updated unless specifically requested via the linearForm method.

Definition at line 139 of file finite_element_dual.hpp.


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