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) |
| Add BC associated with essentially constrained DoFs on boundaries. More... | |
| virtual void | Init (Moose::MFEM::GridFunctions &gridfunctions, mfem::AssemblyLevel assembly_level) |
| Initialise. More... | |
| virtual void | BuildLinearForms () |
| Build linear forms and eliminate constrained DoFs. More... | |
| virtual void | ApplyEssentialBC (const std::string &test_var_name, mfem::ParGridFunction &trial_gf, mfem::Array< int > &global_ess_markers) |
| Apply essential BC(s) associated with test_var_name to set true DoFs of trial_gf and update markers of all essential boundaries. More... | |
| virtual void | ApplyEssentialBCs () |
| Update all essentially constrained true DoF markers and values on boundaries. More... | |
| virtual void | EliminateCoupledVariables () |
| Perform trivial eliminations of coupled variables lacking corresponding test variables. More... | |
| virtual void | BuildBilinearForms () |
| Build bilinear forms (diagonal Jacobian contributions) More... | |
| virtual void | BuildMixedBilinearForms () |
| Build mixed bilinear forms (off-diagonal Jacobian contributions) More... | |
| virtual void | BuildEquationSystem () |
| Build all forms comprising this EquationSystem. More... | |
| void | AssembleJacobian (Moose::MFEM::NamedFieldsMap< mfem::ParBilinearForm > &jac_blfs, Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< mfem::ParMixedBilinearForm >> &jac_mblfs, Moose::MFEM::NamedFieldsMap< mfem::ParLinearForm > &rhs_lfs, std::vector< mfem::Array< int >> &ess_tdof_lists, std::vector< std::unique_ptr< mfem::ParGridFunction >> &var_ess_constraints, mfem::OperatorHandle &op, mfem::BlockVector &trueX, mfem::BlockVector &trueRHS) |
| Form Jacobian operator based on on- and off-diagonal bilinear form contributions, populate solution and RHS vectors of true DoFs, and apply constraints. More... | |
| 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.
Definition at line 38 of file EquationSystem.C.
Referenced by AddIntegratedBC(), AddKernel(), Moose::MFEM::TimeDependentEquationSystem::AddKernel(), and Moose::MFEM::TimeDependentEquationSystem::SetTrialVariableNames().
|
virtual |
Add BC associated with essentially constrained DoFs on boundaries.
Definition at line 112 of file EquationSystem.C.
|
virtual |
Definition at line 89 of file EquationSystem.C.
|
virtual |
Add kernels.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 66 of file EquationSystem.C.
Referenced by Moose::MFEM::TimeDependentEquationSystem::AddKernel().
|
virtual |
Add test variable to EquationSystem.
Definition at line 45 of file EquationSystem.C.
Referenced by AddIntegratedBC(), AddKernel(), and Moose::MFEM::TimeDependentEquationSystem::AddKernel().
|
protected |
Definition at line 269 of file EquationSystem.h.
|
inlineprotected |
Definition at line 295 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 221 of file EquationSystem.h.
|
inlineprotected |
Definition at line 245 of file EquationSystem.h.
Referenced by BuildLinearForms().
|
virtual |
Apply essential BC(s) associated with test_var_name to set true DoFs of trial_gf and update markers of all essential boundaries.
Definition at line 159 of file EquationSystem.C.
Referenced by ApplyEssentialBCs(), and Moose::MFEM::TimeDependentEquationSystem::ApplyEssentialBCs().
|
virtual |
Update all essentially constrained true DoF markers and values on boundaries.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 180 of file EquationSystem.C.
Referenced by BuildLinearForms().
| void Moose::MFEM::EquationSystem::AssembleJacobian | ( | Moose::MFEM::NamedFieldsMap< mfem::ParBilinearForm > & | jac_blfs, |
| Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap< mfem::ParMixedBilinearForm >> & | jac_mblfs, | ||
| Moose::MFEM::NamedFieldsMap< mfem::ParLinearForm > & | rhs_lfs, | ||
| std::vector< mfem::Array< int >> & | ess_tdof_lists, | ||
| std::vector< std::unique_ptr< mfem::ParGridFunction >> & | var_ess_constraints, | ||
| mfem::OperatorHandle & | op, | ||
| mfem::BlockVector & | trueX, | ||
| mfem::BlockVector & | trueRHS | ||
| ) |
Form Jacobian operator based on on- and off-diagonal bilinear form contributions, populate solution and RHS vectors of true DoFs, and apply constraints.
Definition at line 261 of file EquationSystem.C.
Referenced by FormLegacySystem(), and Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem().
|
virtual |
Build bilinear forms (diagonal Jacobian contributions)
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 395 of file EquationSystem.C.
Referenced by Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), and BuildEquationSystem().
|
virtual |
Build all forms comprising this EquationSystem.
Definition at line 457 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 334 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 368 of file EquationSystem.C.
Referenced by BuildEquationSystem().
|
virtual |
Build mixed bilinear forms (off-diagonal Jacobian contributions)
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 416 of file EquationSystem.C.
Referenced by BuildEquationSystem(), and Moose::MFEM::TimeDependentEquationSystem::BuildMixedBilinearForms().
|
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 AssembleJacobian(), and ~EquationSystem().
|
virtual |
Perform trivial eliminations of coupled variables lacking corresponding test variables.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 197 of file EquationSystem.C.
Referenced by BuildLinearForms(), and Moose::MFEM::TimeDependentEquationSystem::EliminateCoupledVariables().
|
virtual |
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 326 of file EquationSystem.C.
Referenced by FormLinearSystem().
|
virtual |
Form linear system, with essential boundary conditions accounted for.
Definition at line 217 of file EquationSystem.C.
Referenced by BuildJacobian().
|
virtual |
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 238 of file EquationSystem.C.
Referenced by FormLinearSystem().
|
override |
Compute J = M + grad_H(u)
Definition at line 350 of file EquationSystem.C.
|
virtual |
Initialise.
Reimplemented in Moose::MFEM::TimeDependentEquationSystem.
Definition at line 124 of file EquationSystem.C.
Referenced by Moose::MFEM::TimeDependentEquationSystem::Init().
|
override |
Compute residual y = Mu.
Definition at line 342 of file EquationSystem.C.
|
virtual |
Update variable from solution vector after solve.
Definition at line 356 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 52 of file EquationSystem.C.
Referenced by Init().
|
inline |
Definition at line 116 of file EquationSystem.h.
Referenced by Moose::MFEM::EquationSystemProblemOperator::SetGridFunctions(), and Moose::MFEM::TimeDomainEquationSystemProblemOperator::SetGridFunctions().
|
inline |
Definition at line 115 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 216 of file EquationSystem.h.
Referenced by BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), BuildMixedBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildMixedBilinearForms(), FormLinearSystem(), and Init().
|
protected |
Definition at line 156 of file EquationSystem.h.
Referenced by BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::EliminateCoupledVariables(), FormLegacySystem(), FormSystem(), and Moose::MFEM::TimeDependentEquationSystem::SetTimeStep().
|
protected |
Pointers to finite element spaces associated with coupled variables.
Definition at line 153 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 139 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 145 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 147 of file EquationSystem.h.
Referenced by Moose::MFEM::TimeDependentEquationSystem::ApplyEssentialBCs(), EliminateCoupledVariables(), Moose::MFEM::TimeDependentEquationSystem::EliminateCoupledVariables(), and Init().
| std::vector<mfem::Array<int> > Moose::MFEM::EquationSystem::_ess_tdof_lists |
Definition at line 113 of file EquationSystem.h.
Referenced by ApplyEssentialBCs(), Moose::MFEM::TimeDependentEquationSystem::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 212 of file EquationSystem.h.
Referenced by AddEssentialBC(), and ApplyEssentialBC().
|
protected |
Definition at line 199 of file EquationSystem.h.
Referenced by AssembleJacobian(), and DeleteAllBlocks().
|
protected |
Arrays to store integrated BCs to act on each component of weak form.
Named according to test and trial variables.
Definition at line 209 of file EquationSystem.h.
Referenced by AddIntegratedBC(), BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), and BuildLinearForms().
|
mutableprotected |
Definition at line 214 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 204 of file EquationSystem.h.
Referenced by AddKernel(), BuildBilinearForms(), BuildLinearForms(), and BuildMixedBilinearForms().
|
protected |
Definition at line 157 of file EquationSystem.h.
Referenced by BuildLinearForms(), EliminateCoupledVariables(), Moose::MFEM::TimeDependentEquationSystem::EliminateCoupledVariables(), FormLegacySystem(), Moose::MFEM::TimeDependentEquationSystem::FormLegacySystem(), FormSystem(), and Moose::MFEM::TimeDependentEquationSystem::FormSystem().
|
protected |
Definition at line 160 of file EquationSystem.h.
Referenced by BuildMixedBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildMixedBilinearForms(), EliminateCoupledVariables(), and FormLegacySystem().
|
protected |
Definition at line 158 of file EquationSystem.h.
|
protected |
Pointers to finite element spaces associated with test variables.
Definition at line 151 of file EquationSystem.h.
Referenced by AssembleJacobian(), BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), BuildLinearForms(), BuildMixedBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildMixedBilinearForms(), and Init().
|
protected |
Names of all test variables corresponding to linear forms in this equation system.
Definition at line 149 of file EquationSystem.h.
Referenced by AddTestVariableNameIfMissing(), ApplyEssentialBCs(), Moose::MFEM::TimeDependentEquationSystem::ApplyEssentialBCs(), AssembleJacobian(), BuildBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildBilinearForms(), BuildLinearForms(), BuildMixedBilinearForms(), Moose::MFEM::TimeDependentEquationSystem::BuildMixedBilinearForms(), EliminateCoupledVariables(), Moose::MFEM::TimeDependentEquationSystem::EliminateCoupledVariables(), FormLinearSystem(), FormSystem(), Moose::MFEM::TimeDependentEquationSystem::FormSystem(), Init(), Moose::MFEM::TimeDependentEquationSystem::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 143 of file EquationSystem.h.
Referenced by AssembleJacobian(), Moose::MFEM::TimeDependentEquationSystem::BuildMixedBilinearForms(), FormLinearSystem(), RecoverFEMSolution(), SetTrialVariableNames(), Moose::MFEM::TimeDependentEquationSystem::SetTrialVariableNames(), and TrialVarNames().
|
protected |
Gridfunctions holding essential constraints from Dirichlet BCs.
Definition at line 197 of file EquationSystem.h.
Referenced by ApplyEssentialBCs(), Moose::MFEM::TimeDependentEquationSystem::ApplyEssentialBCs(), FormLegacySystem(), FormSystem(), and Init().
1.8.14