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

Class for encapsulating the data associated with a vector derived from a MFEM finite element space. Specifically, it contains the information needed for both primal finite element state fields and dual finite element vectors. More...

#include <finite_element_vector.hpp>

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

Public Member Functions

 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::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 data associated with a vector derived from a MFEM finite element space. Specifically, it contains the information needed for both primal finite element state fields and dual finite element vectors.

Namely: Mesh, FiniteElementCollection, FiniteElementSpace, name, and a HypreParVector containing the true degrees of freedom for the field.

Definition at line 49 of file finite_element_vector.hpp.

Constructor & Destructor Documentation

◆ FiniteElementVector() [1/4]

serac::FiniteElementVector::FiniteElementVector ( const mfem::ParFiniteElementSpace &  space,
const std::string &  name = "" 
)

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 12 of file finite_element_vector.cpp.

◆ FiniteElementVector() [2/4]

template<typename FunctionSpace >
serac::FiniteElementVector::FiniteElementVector ( mfem::ParMesh &  mesh,
FunctionSpace  ,
const std::string &  name = "" 
)
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.

◆ FiniteElementVector() [3/4]

serac::FiniteElementVector::FiniteElementVector ( const FiniteElementVector rhs)
inline

Copy constructor.

Parameters
[in]rhsThe input vector used for construction

Definition at line 109 of file finite_element_vector.hpp.

◆ FiniteElementVector() [4/4]

serac::FiniteElementVector::FiniteElementVector ( FiniteElementVector &&  rhs)

Move construct a new Finite Element Vector object.

Parameters
[in]rhsThe input vector used for construction

Definition at line 32 of file finite_element_vector.cpp.

Member Function Documentation

◆ comm()

MPI_Comm serac::FiniteElementVector::comm ( ) const
inline

Returns the MPI communicator for the state.

Returns
The underlying MPI communicator

Definition at line 157 of file finite_element_vector.hpp.

◆ mesh()

mfem::ParMesh& serac::FiniteElementVector::mesh ( )
inline

Returns a non-owning reference to the internal mesh object.

Returns
The underlying mesh

Definition at line 163 of file finite_element_vector.hpp.

◆ name()

std::string serac::FiniteElementVector::name ( ) const
inline

Returns the name of the FEState (field)

Returns
The name of the finite element vector

Definition at line 179 of file finite_element_vector.hpp.

◆ operator=() [1/5]

FiniteElementVector & serac::FiniteElementVector::operator= ( const double  value)

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 83 of file finite_element_vector.cpp.

◆ operator=() [2/5]

FiniteElementVector & serac::FiniteElementVector::operator= ( const FiniteElementVector rhs)

Copy assignment.

Parameters
rhsThe right hand side input vector
Returns
The assigned FiniteElementVector

Definition at line 59 of file finite_element_vector.cpp.

◆ operator=() [3/5]

FiniteElementVector & serac::FiniteElementVector::operator= ( const mfem::HypreParVector &  rhs)

Copy assignment from a hypre par vector.

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

Definition at line 43 of file finite_element_vector.cpp.

◆ operator=() [4/5]

FiniteElementVector & serac::FiniteElementVector::operator= ( const mfem::Vector &  rhs)

Copy assignment from a hypre par vector.

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

Definition at line 53 of file finite_element_vector.cpp.

◆ operator=() [5/5]

FiniteElementVector & serac::FiniteElementVector::operator= ( FiniteElementVector &&  rhs)

Move assignment.

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

Definition at line 70 of file finite_element_vector.cpp.

◆ space()

mfem::ParFiniteElementSpace& serac::FiniteElementVector::space ( )
inline

Returns a non-owning reference to the internal FESpace.

Returns
The underlying finite element space

Definition at line 171 of file finite_element_vector.hpp.

Member Data Documentation

◆ coll_

std::unique_ptr<mfem::FiniteElementCollection> serac::FiniteElementVector::coll_
protected

Handle to the FiniteElementCollection, which is owned by MFEMSidreDataCollection.

Note
Must be const as FESpaces store a const reference to their FEColls

Definition at line 206 of file finite_element_vector.hpp.


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