Class to store weak form components (bilinear and linear forms, and optionally mixed and nonlinear forms) and build methods. More...
#include <EquationSystem.h>
Public Member Functions | |
EquationSystem ()=default | |
~EquationSystem () override | |
virtual void | AddTestVariableNameIfMissing (const std::string &test_var_name) |
Add test variable to EquationSystem. More... | |
virtual void | AddCoupledVariableNameIfMissing (const std::string &coupled_var_name) |
Add coupled variable to EquationSystem. More... | |
virtual void | AddKernel (std::shared_ptr< MFEMKernel > kernel) |
Add kernels. More... | |
virtual void | AddIntegratedBC (std::shared_ptr< MFEMIntegratedBC > kernel) |
virtual void | AddEssentialBC (std::shared_ptr< MFEMEssentialBC > bc) |
virtual void | Init (Moose::MFEM::GridFunctions &gridfunctions, const Moose::MFEM::FESpaces &fespaces, mfem::AssemblyLevel assembly_level) |
Initialise. More... | |
virtual void | BuildLinearForms () |
Build linear forms and eliminate constrained DoFs. More... | |
virtual void | ApplyEssentialBCs () |
virtual void | EliminateCoupledVariables () |
virtual void | BuildBilinearForms () |
Build bilinear forms. More... | |
virtual void | BuildMixedBilinearForms () |
virtual void | BuildEquationSystem () |
virtual void | FormLinearSystem (mfem::OperatorHandle &op, mfem::BlockVector &trueX, mfem::BlockVector &trueRHS) |
Form linear system, with essential boundary conditions accounted for. More... | |
virtual void | FormSystem (mfem::OperatorHandle &op, mfem::BlockVector &trueX, mfem::BlockVector &trueRHS) |
virtual void | FormLegacySystem (mfem::OperatorHandle &op, mfem::BlockVector &trueX, mfem::BlockVector &trueRHS) |
virtual void | BuildJacobian (mfem::BlockVector &trueX, mfem::BlockVector &trueRHS) |
Build linear system, with essential boundary conditions accounted for. More... | |
void | Mult (const mfem::Vector &u, mfem::Vector &residual) const override |
Compute residual y = Mu. More... | |
mfem::Operator & | GetGradient (const mfem::Vector &u) const override |
Compute J = M + grad_H(u) More... | |
virtual void | RecoverFEMSolution (mfem::BlockVector &trueX, Moose::MFEM::GridFunctions &gridfunctions) |
Update variable from solution vector after solve. More... | |
const std::vector< std::string > & | TrialVarNames () const |
const std::vector< std::string > & | TestVarNames () const |
Public Attributes | |
std::vector< mfem::Array< int > > | _ess_tdof_lists |
Protected Member Functions | |
void | DeleteAllBlocks () |
Deletes the HypreParMatrix associated with any pointer stored in _h_blocks, and then proceeds to delete all dynamically allocated memory for _h_blocks itself, resetting all dimensions to zero. More... | |
bool | VectorContainsName (const std::vector< std::string > &the_vector, const std::string &name) const |
template<class FormType > | |
void | ApplyDomainBLFIntegrators (const std::string &trial_var_name, const std::string &test_var_name, std::shared_ptr< FormType > form, Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< MFEMKernel >>>> &kernels_map) |
Template method for applying BilinearFormIntegrators on domains from kernels to a BilinearForm, or MixedBilinearForm. More... | |
void | ApplyDomainLFIntegrators (const std::string &test_var_name, std::shared_ptr< mfem::ParLinearForm > form, Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< MFEMKernel >>>> &kernels_map) |
template<class FormType > | |
void | ApplyBoundaryBLFIntegrators (const std::string &trial_var_name, const std::string &test_var_name, std::shared_ptr< FormType > form, Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< MFEMIntegratedBC >>>> &integrated_bc_map) |
void | ApplyBoundaryLFIntegrators (const std::string &test_var_name, std::shared_ptr< mfem::ParLinearForm > form, Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< MFEMIntegratedBC >>>> &integrated_bc_map) |
Protected Attributes | |
std::vector< std::string > | _coupled_var_names |
Names of all trial variables of kernels and boundary conditions added to this EquationSystem. More... | |
std::vector< std::string > | _trial_var_names |
Subset of _coupled_var_names of all variables corresponding to gridfunctions with degrees of freedom that comprise the state vector of this EquationSystem. More... | |
std::vector< std::string > | _eliminated_var_names |
Names of all coupled variables without a corresponding test variable. More... | |
Moose::MFEM::GridFunctions | _eliminated_variables |
Pointers to coupled variables not part of the reduced EquationSystem. More... | |
std::vector< std::string > | _test_var_names |
Names of all test variables corresponding to linear forms in this equation system. More... | |
std::vector< mfem::ParFiniteElementSpace * > | _test_pfespaces |
Pointers to finite element spaces associated with test variables. More... | |
std::vector< mfem::ParFiniteElementSpace * > | _coupled_pfespaces |
Pointers to finite element spaces associated with coupled variables. More... | |
Moose::MFEM::NamedFieldsMap< mfem::ParBilinearForm > | _blfs |
Moose::MFEM::NamedFieldsMap< mfem::ParLinearForm > | _lfs |
Moose::MFEM::NamedFieldsMap< mfem::ParNonlinearForm > | _nlfs |
Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< mfem::ParMixedBilinearForm > > | _mblfs |
std::vector< std::unique_ptr< mfem::ParGridFunction > > | _var_ess_constraints |
Gridfunctions holding essential constraints from Dirichlet BCs. More... | |
mfem::Array2D< const mfem::HypreParMatrix * > | _h_blocks |
Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< MFEMKernel > > > > | _kernels_map |
Arrays to store kernels to act on each component of weak form. More... | |
Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< MFEMIntegratedBC > > > > | _integrated_bc_map |
Arrays to store integrated BCs to act on each component of weak form. More... | |
Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< MFEMEssentialBC > > > | _essential_bc_map |
Arrays to store essential BCs to act on each component of weak form. More... | |
mfem::OperatorHandle | _jacobian |
mfem::AssemblyLevel | _assembly_level |
Private Member Functions | |
virtual void | SetTrialVariableNames () |
Set trial variable names from subset of coupled variables that have an associated test variable. More... | |
Friends | |
class | EquationSystemProblemOperator |
class | TimeDomainEquationSystemProblemOperator |
Class to store weak form components (bilinear and linear forms, and optionally mixed and nonlinear forms) and build methods.
Definition at line 30 of file EquationSystem.h.
|
default |
|
override |
Definition at line 18 of file EquationSystem.C.
|
virtual |
Add coupled variable to EquationSystem.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 40 of file EquationSystem.C.
Referenced by Moose::MFEM::TimeDependentEquationSystem::AddCoupledVariableNameIfMissing(), AddIntegratedBC(), and AddKernel().
|
virtual |
Definition at line 114 of file EquationSystem.C.
|
virtual |
Definition at line 91 of file EquationSystem.C.
|
virtual |
Add kernels.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 68 of file EquationSystem.C.
Referenced by Moose::MFEM::TimeDependentEquationSystem::AddKernel().
|
virtual |
Add test variable to EquationSystem.
Definition at line 47 of file EquationSystem.C.
Referenced by AddEssentialBC(), AddIntegratedBC(), AddKernel(), and Moose::MFEM::TimeDependentEquationSystem::AddKernel().
|
protected |
Definition at line 245 of file EquationSystem.h.
|
inlineprotected |
Definition at line 271 of file EquationSystem.h.
Referenced by BuildLinearForms().
|
protected |
Template method for applying BilinearFormIntegrators on domains from kernels to a BilinearForm, or MixedBilinearForm.
Definition at line 197 of file EquationSystem.h.
|
inlineprotected |
Definition at line 221 of file EquationSystem.h.
Referenced by BuildLinearForms().
|
virtual |
Definition at line 164 of file EquationSystem.C.
Referenced by BuildLinearForms().
|
virtual |
Build bilinear forms.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 381 of file EquationSystem.C.
Referenced by Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), and BuildEquationSystem().
|
virtual |
Definition at line 441 of file EquationSystem.C.
Referenced by Moose::MFEM::EquationSystemProblemOperator::Init(), Moose::MFEM::TimeDomainEquationSystemProblemOperator::Init(), and Moose::MFEM::TimeDependentEquationSystem::UpdateEquationSystem().
|
virtual |
Build linear system, with essential boundary conditions accounted for.
Definition at line 320 of file EquationSystem.C.
Referenced by Moose::MFEM::TimeDomainEquationSystemProblemOperator::BuildEquationSystemOperator(), and Moose::MFEM::EquationSystemProblemOperator::Solve().
|
virtual |
Build linear forms and eliminate constrained DoFs.
Definition at line 354 of file EquationSystem.C.
Referenced by BuildEquationSystem().
|
virtual |
Definition at line 402 of file EquationSystem.C.
Referenced by BuildEquationSystem().
|
protected |
Deletes the HypreParMatrix associated with any pointer stored in _h_blocks, and then proceeds to delete all dynamically allocated memory for _h_blocks itself, resetting all dimensions to zero.
Definition at line 21 of file EquationSystem.C.
Referenced by FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), and ~EquationSystem().
|
virtual |
Definition at line 197 of file EquationSystem.C.
Referenced by BuildLinearForms().
|
virtual |
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 258 of file EquationSystem.C.
Referenced by FormLinearSystem().
|
virtual |
Form linear system, with essential boundary conditions accounted for.
Definition at line 214 of file EquationSystem.C.
Referenced by BuildJacobian().
|
virtual |
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 235 of file EquationSystem.C.
Referenced by FormLinearSystem().
|
override |
Compute J = M + grad_H(u)
Definition at line 336 of file EquationSystem.C.
|
virtual |
Initialise.
Definition at line 127 of file EquationSystem.C.
|
override |
Compute residual y = Mu.
Definition at line 328 of file EquationSystem.C.
|
virtual |
Update variable from solution vector after solve.
Definition at line 342 of file EquationSystem.C.
Referenced by Moose::MFEM::EquationSystemProblemOperator::Solve().
|
privatevirtual |
Set trial variable names from subset of coupled variables that have an associated test variable.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 54 of file EquationSystem.C.
Referenced by Init().
|
inline |
Definition at line 92 of file EquationSystem.h.
Referenced by Moose::MFEM::EquationSystemProblemOperator::SetGridFunctions(), and Moose::MFEM::TimeDomainEquationSystemProblemOperator::SetGridFunctions().
|
inline |
Definition at line 91 of file EquationSystem.h.
Referenced by Moose::MFEM::EquationSystemProblemOperator::SetGridFunctions(), and Moose::MFEM::TimeDomainEquationSystemProblemOperator::SetGridFunctions().
|
protected |
Definition at line 30 of file EquationSystem.C.
Referenced by AddCoupledVariableNameIfMissing(), AddTestVariableNameIfMissing(), SetTrialVariableNames(), and Moose::MFEM::TimeDependentEquationSystem::SetTrialVariableNames().
|
friend |
Definition at line 34 of file EquationSystem.h.
|
friend |
Definition at line 35 of file EquationSystem.h.
|
protected |
Definition at line 192 of file EquationSystem.h.
Referenced by BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), BuildMixedBilinearForms(), FormLinearSystem(), and Init().
|
protected |
Definition at line 132 of file EquationSystem.h.
Referenced by BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), FormSystem(), Moose::MFEM::TimeDependentEquationSystem::FormSystem(), and Moose::MFEM::TimeDependentEquationSystem::SetTimeStep().
|
protected |
Pointers to finite element spaces associated with coupled variables.
Definition at line 129 of file EquationSystem.h.
Referenced by BuildMixedBilinearForms(), and Init().
|
protected |
Names of all trial variables of kernels and boundary conditions added to this EquationSystem.
Definition at line 115 of file EquationSystem.h.
Referenced by AddCoupledVariableNameIfMissing(), BuildMixedBilinearForms(), Init(), SetTrialVariableNames(), and Moose::MFEM::TimeDependentEquationSystem::SetTrialVariableNames().
|
protected |
Names of all coupled variables without a corresponding test variable.
Definition at line 121 of file EquationSystem.h.
Referenced by EliminateCoupledVariables(), Init(), SetTrialVariableNames(), and Moose::MFEM::TimeDependentEquationSystem::SetTrialVariableNames().
|
protected |
Pointers to coupled variables not part of the reduced EquationSystem.
Definition at line 123 of file EquationSystem.h.
Referenced by EliminateCoupledVariables(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormSystem(), and Init().
std::vector<mfem::Array<int> > Moose::MFEM::EquationSystem::_ess_tdof_lists |
Definition at line 89 of file EquationSystem.h.
Referenced by ApplyEssentialBCs(), FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), FormSystem(), and Moose::MFEM::TimeDependentEquationSystem::FormSystem().
|
protected |
Arrays to store essential BCs to act on each component of weak form.
Named according to test variable.
Definition at line 188 of file EquationSystem.h.
Referenced by AddEssentialBC(), and ApplyEssentialBCs().
|
protected |
Definition at line 175 of file EquationSystem.h.
Referenced by DeleteAllBlocks(), FormLegacySystem(), and Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem().
|
protected |
Arrays to store integrated BCs to act on each component of weak form.
Named according to test and trial variables.
Definition at line 185 of file EquationSystem.h.
Referenced by AddIntegratedBC(), BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), and BuildLinearForms().
|
mutableprotected |
Definition at line 190 of file EquationSystem.h.
Referenced by BuildJacobian(), GetGradient(), and Mult().
|
protected |
Arrays to store kernels to act on each component of weak form.
Named according to test and trial variables.
Definition at line 180 of file EquationSystem.h.
Referenced by AddKernel(), BuildBilinearForms(), BuildLinearForms(), and BuildMixedBilinearForms().
|
protected |
Definition at line 133 of file EquationSystem.h.
Referenced by BuildLinearForms(), EliminateCoupledVariables(), FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), FormSystem(), and Moose::MFEM::TimeDependentEquationSystem::FormSystem().
|
protected |
Definition at line 136 of file EquationSystem.h.
Referenced by BuildMixedBilinearForms(), EliminateCoupledVariables(), and FormLegacySystem().
|
protected |
Definition at line 134 of file EquationSystem.h.
|
protected |
Pointers to finite element spaces associated with test variables.
Definition at line 127 of file EquationSystem.h.
Referenced by ApplyEssentialBCs(), BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), BuildLinearForms(), BuildMixedBilinearForms(), FormLegacySystem(), and Init().
|
protected |
Names of all test variables corresponding to linear forms in this equation system.
Definition at line 125 of file EquationSystem.h.
Referenced by AddTestVariableNameIfMissing(), ApplyEssentialBCs(), BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), BuildLinearForms(), BuildMixedBilinearForms(), EliminateCoupledVariables(), FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), FormLinearSystem(), FormSystem(), Moose::MFEM::TimeDependentEquationSystem::FormSystem(), Init(), Moose::MFEM::TimeDependentEquationSystem::SetTimeStep(), SetTrialVariableNames(), Moose::MFEM::TimeDependentEquationSystem::SetTrialVariableNames(), and TestVarNames().
|
protected |
Subset of _coupled_var_names of all variables corresponding to gridfunctions with degrees of freedom that comprise the state vector of this EquationSystem.
This will differ from _coupled_var_names when time derivatives or other eliminated variables are present.
Definition at line 119 of file EquationSystem.h.
Referenced by FormLegacySystem(), FormLinearSystem(), RecoverFEMSolution(), SetTrialVariableNames(), Moose::MFEM::TimeDependentEquationSystem::SetTrialVariableNames(), and TrialVarNames().
|
protected |
Gridfunctions holding essential constraints from Dirichlet BCs.
Definition at line 173 of file EquationSystem.h.
Referenced by ApplyEssentialBCs(), FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), FormSystem(), Moose::MFEM::TimeDependentEquationSystem::FormSystem(), and Init().