Serac
0.1
Serac is an implicit thermal strucural mechanics simulation code.
|
Boundary condition information bundle. More...
#include <boundary_condition.hpp>
Public Member Functions | |
BoundaryCondition (GeneralCoefficient coef, const std::optional< int > component, const mfem::ParFiniteElementSpace &space, const std::set< int > &attrs) | |
Constructor for setting up a boundary condition using a set of attributes. More... | |
BoundaryCondition (GeneralCoefficient coef, const std::optional< int > component, const mfem::ParFiniteElementSpace &space, const mfem::Array< int > &true_dofs) | |
Minimal constructor for setting the true DOFs directly. More... | |
template<typename Tag > | |
bool | tagEquals (const Tag tag) const |
Determines whether a boundary condition is associated with a tag. More... | |
template<typename Tag > | |
void | setTag (const Tag tag) |
Sets the tag for the BC. More... | |
const mfem::Array< int > & | markers () const |
Returns a non-owning reference to the array of boundary attribute markers. | |
mfem::Array< int > & | markers () |
Returns a non-owning reference to the array of boundary attribute markers. | |
const mfem::VectorCoefficient & | vectorCoefficient () const |
Accessor for the underlying vector coefficient. More... | |
mfem::VectorCoefficient & | vectorCoefficient () |
Accessor for the underlying vector coefficient. More... | |
const mfem::Coefficient & | scalarCoefficient () const |
Accessor for the underlying scalar coefficient. More... | |
mfem::Coefficient & | scalarCoefficient () |
Accessor for the underlying scalar coefficient. More... | |
const mfem::Array< int > & | getTrueDofList () const |
Returns the DOF indices for an essential boundary condition. More... | |
const mfem::Array< int > & | getLocalDofList () const |
Returns the DOF indices for an essential boundary condition. More... | |
void | setDofs (mfem::Vector &state, const double time=0.0) const |
Projects the associated coefficient over a solution vector on the DOFs constrained by the boundary condition. More... | |
void | apply (mfem::HypreParMatrix &k_mat, mfem::Vector &rhs, mfem::Vector &state) const |
Modify the system of equations \(Ax=b\) by replacing equations that correspond to essential boundary conditions with ones that prescribe the desired values. The rows of the matrix containing essential dofs are set to zero with a one on the diagonal. To preserve symmetry, the off-diagonal entries of associated columns of A are also zeroed out, and b is modified accordingly. This function is equivalent to: More... | |
Boundary condition information bundle.
Definition at line 30 of file boundary_condition.hpp.
serac::BoundaryCondition::BoundaryCondition | ( | GeneralCoefficient | coef, |
const std::optional< int > | component, | ||
const mfem::ParFiniteElementSpace & | space, | ||
const std::set< int > & | attrs | ||
) |
Constructor for setting up a boundary condition using a set of attributes.
[in] | coef | Either a mfem::Coefficient or mfem::VectorCoefficient representing the BC |
[in] | component | The zero-indexed vector component if the BC applies to just one component, should be null for all components |
[in] | attrs | The set of boundary condition attributes in the mesh that the BC applies to |
[in] | space | The finite element space on which this BC is applied. This is used to calculate the DOFs from the attribute list. |
Definition at line 13 of file boundary_condition.cpp.
serac::BoundaryCondition::BoundaryCondition | ( | GeneralCoefficient | coef, |
const std::optional< int > | component, | ||
const mfem::ParFiniteElementSpace & | space, | ||
const mfem::Array< int > & | true_dofs | ||
) |
Minimal constructor for setting the true DOFs directly.
[in] | coef | Either a mfem::Coefficient or mfem::VectorCoefficient representing the BC |
[in] | component | The zero-indexed vector component if the BC applies to just one component, should be null for all components |
[in] | true_dofs | The vector indices of the relevant DOFs |
[in] | space | The finite element space on which this BC is applied. |
Definition at line 31 of file boundary_condition.cpp.
void serac::BoundaryCondition::apply | ( | mfem::HypreParMatrix & | k_mat, |
mfem::Vector & | rhs, | ||
mfem::Vector & | state | ||
) | const |
Modify the system of equations \(Ax=b\) by replacing equations that correspond to essential boundary conditions with ones that prescribe the desired values. The rows of the matrix containing essential dofs are set to zero with a one on the diagonal. To preserve symmetry, the off-diagonal entries of associated columns of A are also zeroed out, and b is modified accordingly. This function is equivalent to:
\[ A = \tilde{A} + A_e (\tilde{A} + A_e) x = b \tilde{A} x = b - A_e x \]
where \( A_e \) contains the eliminated columns of \( A \) for the essential degrees of freedom. Note that these equations only apply to the non-essential dofs. For the essential rows, \( A \) is modified to contain one on the diagonal and the right hand side is modified to contain the essential value originally contained in \( x \). If \( A \) is given as the input k_mat , \( A_e \) is returned in k_mat .
[in,out] | k_mat | A stiffness (system) matrix. The rows and cols of the essential dofs will be set to zero with a one on the diagonal after the return of this method. |
[in,out] | rhs | The RHS vector for the system. At return, this vector contains \( b - A_e x \). |
[in] | state | The state from which the solution DOF values are extracted and used to modify k_mat |
Definition at line 130 of file boundary_condition.cpp.
|
inline |
Returns the DOF indices for an essential boundary condition.
Definition at line 150 of file boundary_condition.hpp.
|
inline |
Returns the DOF indices for an essential boundary condition.
Definition at line 142 of file boundary_condition.hpp.
mfem::Coefficient & serac::BoundaryCondition::scalarCoefficient | ( | ) |
Accessor for the underlying scalar coefficient.
This method performs an internal check to verify the underlying GeneralCoefficient is in fact a scalar.
Definition at line 147 of file boundary_condition.cpp.
const mfem::Coefficient & serac::BoundaryCondition::scalarCoefficient | ( | ) | const |
Accessor for the underlying scalar coefficient.
This method performs an internal check to verify the underlying GeneralCoefficient is in fact a scalar.
Definition at line 136 of file boundary_condition.cpp.
void serac::BoundaryCondition::setDofs | ( | mfem::Vector & | state, |
const double | time = 0.0 |
||
) | const |
Projects the associated coefficient over a solution vector on the DOFs constrained by the boundary condition.
[in] | time | The time at which to project the boundary condition |
[in,out] | state | The field to project over |
Definition at line 95 of file boundary_condition.cpp.
|
inline |
Sets the tag for the BC.
Tag | The template type for the tag (label) |
[in] | tag | The new tag |
Definition at line 78 of file boundary_condition.hpp.
|
inline |
Determines whether a boundary condition is associated with a tag.
Tag | The type of the tag to compare against |
[in] | tag | The tag to compare against |
Definition at line 62 of file boundary_condition.hpp.
mfem::VectorCoefficient & serac::BoundaryCondition::vectorCoefficient | ( | ) |
Accessor for the underlying vector coefficient.
This method performs an internal check to verify the underlying GeneralCoefficient is in fact a vector.
Definition at line 169 of file boundary_condition.cpp.
const mfem::VectorCoefficient & serac::BoundaryCondition::vectorCoefficient | ( | ) | const |
Accessor for the underlying vector coefficient.
This method performs an internal check to verify the underlying GeneralCoefficient is in fact a vector.
Definition at line 158 of file boundary_condition.cpp.