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

A container for the boundary condition information relating to a specific physics module. More...

#include <boundary_condition_manager.hpp>

Public Member Functions

 BoundaryConditionManager (const mfem::ParMesh &mesh)
 Construct a new Boundary Condition Manager object. More...
 
void addEssential (const std::set< int > &ess_bdr, serac::GeneralCoefficient ess_bdr_coef, mfem::ParFiniteElementSpace &space, const std::optional< int > component={})
 Set the essential boundary conditions from a list of boundary markers and a coefficient. More...
 
void addEssential (const mfem::Array< int > &true_dofs, std::shared_ptr< mfem::VectorCoefficient > ess_bdr_coef, mfem::ParFiniteElementSpace &space)
 Set a list of true degrees of freedom from a vector coefficient. More...
 
void addNatural (const std::set< int > &nat_bdr, serac::GeneralCoefficient nat_bdr_coef, mfem::ParFiniteElementSpace &space, const std::optional< int > component={})
 Set the natural boundary conditions from a list of boundary markers and a coefficient. More...
 
template<typename Tag >
void addGeneric (const std::set< int > &bdr_attr, serac::GeneralCoefficient bdr_coef, const Tag tag, mfem::ParFiniteElementSpace &space, const std::optional< int > component={})
 Set a generic boundary condition from a list of boundary markers and a coefficient. More...
 
const mfem::Array< int > & allEssentialTrueDofs () const
 Returns all the true degrees of freedom associated with all the essential BCs. More...
 
const mfem::Array< int > & allEssentialLocalDofs () const
 Returns all the local degrees of freedom associated with all the essential BCs. More...
 
std::unique_ptr< mfem::HypreParMatrix > eliminateAllEssentialDofsFromMatrix (mfem::HypreParMatrix &matrix) const
 Eliminates all essential BCs from a matrix. More...
 
std::vector< BoundaryCondition > & essentials ()
 Accessor for the essential BC objects.
 
std::vector< BoundaryCondition > & naturals ()
 Accessor for the natural BC objects.
 
std::vector< BoundaryCondition > & generics ()
 Accessor for the generic BC objects.
 
const std::vector< BoundaryCondition > & essentials () const
 Accessor for the essential BC objects.
 
const std::vector< BoundaryCondition > & naturals () const
 Accessor for the natural BC objects.
 
const std::vector< BoundaryCondition > & generics () const
 Accessor for the generic BC objects.
 
template<typename Tag >
auto genericsWithTag (const Tag tag)
 View over all "other"/generic boundary conditions with a specific tag. More...
 

Detailed Description

A container for the boundary condition information relating to a specific physics module.

Definition at line 156 of file boundary_condition_manager.hpp.

Constructor & Destructor Documentation

◆ BoundaryConditionManager()

serac::BoundaryConditionManager::BoundaryConditionManager ( const mfem::ParMesh &  mesh)
inlineexplicit

Construct a new Boundary Condition Manager object.

Parameters
meshThe mesh for the underlying physics module

Definition at line 163 of file boundary_condition_manager.hpp.

Member Function Documentation

◆ addEssential() [1/2]

void serac::BoundaryConditionManager::addEssential ( const mfem::Array< int > &  true_dofs,
std::shared_ptr< mfem::VectorCoefficient >  ess_bdr_coef,
mfem::ParFiniteElementSpace &  space 
)

Set a list of true degrees of freedom from a vector coefficient.

Parameters
[in]true_dofsThe true degrees of freedom to set with a Dirichlet condition
[in]ess_bdr_coefThe vector coefficient that evaluates to the Dirichlet condition
[in]spaceThe finite element space to which the BC should be applied
Note
The coefficient is required to be vector-valued. However, only the dofs specified in the true_dofs array will be set. This means that if the true_dofs array only contains dofs for a specific vector component in a vector-valued finite element space, only that component will be set.

Definition at line 40 of file boundary_condition_manager.cpp.

◆ addEssential() [2/2]

void serac::BoundaryConditionManager::addEssential ( const std::set< int > &  ess_bdr,
serac::GeneralCoefficient  ess_bdr_coef,
mfem::ParFiniteElementSpace &  space,
const std::optional< int >  component = {} 
)

Set the essential boundary conditions from a list of boundary markers and a coefficient.

Parameters
[in]ess_bdrThe set of essential BC attributes
[in]ess_bdr_coefThe essential BC value coefficient
[in]spaceThe finite element space to which the BC should be applied
[in]componentThe component to set (null implies all components are set)

Definition at line 16 of file boundary_condition_manager.cpp.

◆ addGeneric()

template<typename Tag >
void serac::BoundaryConditionManager::addGeneric ( const std::set< int > &  bdr_attr,
serac::GeneralCoefficient  bdr_coef,
const Tag  tag,
mfem::ParFiniteElementSpace &  space,
const std::optional< int >  component = {} 
)
inline

Set a generic boundary condition from a list of boundary markers and a coefficient.

Template Parameters
Thetype of the tag to use
Parameters
[in]bdr_attrThe set of mesh attributes denoting a natural boundary
[in]bdr_coefThe coefficient defining the natural boundary function
[in]tagThe tag for the generic boundary condition, for identification purposes
[in]spaceThe finite element space to which the BC should be applied
[in]componentThe component to set (null implies all components are set)
Precondition
Template type "Tag" must be an enumeration

Definition at line 213 of file boundary_condition_manager.hpp.

◆ addNatural()

void serac::BoundaryConditionManager::addNatural ( const std::set< int > &  nat_bdr,
serac::GeneralCoefficient  nat_bdr_coef,
mfem::ParFiniteElementSpace &  space,
const std::optional< int >  component = {} 
)

Set the natural boundary conditions from a list of boundary markers and a coefficient.

Parameters
[in]nat_bdrThe set of mesh attributes denoting a natural boundary
[in]nat_bdr_coefThe coefficient defining the natural boundary function
[in]spaceThe finite element space to which the BC should be applied
[in]componentThe component to set (null implies all components are set)

Definition at line 33 of file boundary_condition_manager.cpp.

◆ allEssentialLocalDofs()

const mfem::Array<int>& serac::BoundaryConditionManager::allEssentialLocalDofs ( ) const
inline

Returns all the local degrees of freedom associated with all the essential BCs.

Returns
A const reference to the list of local DOF indices, without duplicates and sorted

Definition at line 237 of file boundary_condition_manager.hpp.

◆ allEssentialTrueDofs()

const mfem::Array<int>& serac::BoundaryConditionManager::allEssentialTrueDofs ( ) const
inline

Returns all the true degrees of freedom associated with all the essential BCs.

Returns
A const reference to the list of true DOF indices, without duplicates and sorted

Definition at line 225 of file boundary_condition_manager.hpp.

◆ eliminateAllEssentialDofsFromMatrix()

std::unique_ptr<mfem::HypreParMatrix> serac::BoundaryConditionManager::eliminateAllEssentialDofsFromMatrix ( mfem::HypreParMatrix &  matrix) const
inline

Eliminates all essential BCs from a matrix.

Parameters
[in,out]matrixThe matrix to eliminate from, will be modified
Returns
The eliminated matrix entries
Note
The sum of the eliminated matrix and the modified parameter is equal to the initial state of the parameter

Definition at line 252 of file boundary_condition_manager.hpp.

◆ genericsWithTag()

template<typename Tag >
auto serac::BoundaryConditionManager::genericsWithTag ( const Tag  tag)
inline

View over all "other"/generic boundary conditions with a specific tag.

Template Parameters
TagThe template type for the tag
Parameters
tagThe tag to filter with
Precondition
Tag must be an enumeration type

Definition at line 290 of file boundary_condition_manager.hpp.


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