https://mooseframework.inl.gov
Public Member Functions | Public Attributes | Protected Attributes | Private Attributes | List of all members
Moose::MFEM::EquationSystemProblemOperator Class Reference

Steady-state problem operator with an equation system. More...

#include <EquationSystemProblemOperator.h>

Inheritance diagram for Moose::MFEM::EquationSystemProblemOperator:
[legend]

Public Member Functions

 EquationSystemProblemOperator (MFEMProblem &problem)
 
void SetGridFunctions () override
 
void Init (mfem::BlockVector &X) override
 
virtual void Solve () override
 
Moose::MFEM::EquationSystemGetEquationSystem () const override
 Returns a pointer to the operator's equation system. More...
 
void Mult (const mfem::Vector &, mfem::Vector &) const override
 
virtual void SetTestVariablesFromTrueVectors ()
 
virtual void SetTrialVariablesFromTrueVectors ()
 

Public Attributes

mfem::Array< int_block_true_offsets
 
mfem::BlockVector _true_x
 
mfem::BlockVector _true_rhs
 
mfem::OperatorHandle _equation_system_operator
 

Protected Attributes

MFEMProblem_problem
 Reference to the current problem. More...
 
MFEMProblemData_problem_data
 
std::vector< std::string > _test_var_names
 Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector during solve. More...
 
std::vector< mfem::ParGridFunction * > _test_variables
 
const mfem::Vector * _test_true_vector = nullptr
 
std::vector< std::string > _trial_var_names
 Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector during solve. More...
 
std::vector< mfem::ParGridFunction * > _trial_variables
 

Private Attributes

std::shared_ptr< Moose::MFEM::EquationSystem_equation_system {nullptr}
 

Detailed Description

Steady-state problem operator with an equation system.

Definition at line 19 of file EquationSystemProblemOperator.h.

Constructor & Destructor Documentation

◆ EquationSystemProblemOperator()

Moose::MFEM::EquationSystemProblemOperator::EquationSystemProblemOperator ( MFEMProblem problem)
inline

Definition at line 22 of file EquationSystemProblemOperator.h.

24  {
25  }
std::shared_ptr< Moose::MFEM::EquationSystem > _equation_system
ProblemOperator(MFEMProblem &problem)
std::shared_ptr< Moose::MFEM::EquationSystem > eqn_system

Member Function Documentation

◆ GetEquationSystem()

Moose::MFEM::EquationSystem* Moose::MFEM::EquationSystemProblemOperator::GetEquationSystem ( ) const
inlineoverridevirtual

Returns a pointer to the operator's equation system.

Implements Moose::MFEM::EquationSystemInterface.

Definition at line 31 of file EquationSystemProblemOperator.h.

Referenced by Init(), SetGridFunctions(), and Solve().

32  {
33  if (!_equation_system)
34  {
35  MFEM_ABORT("No equation system has been added to ProblemOperator.");
36  }
37 
38  return _equation_system.get();
39  }
std::shared_ptr< Moose::MFEM::EquationSystem > _equation_system

◆ Init()

void Moose::MFEM::EquationSystemProblemOperator::Init ( mfem::BlockVector &  X)
overridevirtual

Reimplemented from Moose::MFEM::ProblemOperatorBase.

Definition at line 25 of file EquationSystemProblemOperator.C.

26 {
28 
30 }
Moose::MFEM::EquationSystem * GetEquationSystem() const override
Returns a pointer to the operator&#39;s equation system.
virtual void BuildEquationSystem()
virtual void Init(mfem::BlockVector &X)

◆ Mult()

void Moose::MFEM::ProblemOperator::Mult ( const mfem::Vector &  ,
mfem::Vector &   
) const
inlineoverrideinherited

Definition at line 27 of file ProblemOperator.h.

27 {}

◆ SetGridFunctions()

void Moose::MFEM::EquationSystemProblemOperator::SetGridFunctions ( )
overridevirtual

Reimplemented from Moose::MFEM::ProblemOperatorBase.

Definition at line 17 of file EquationSystemProblemOperator.C.

18 {
22 }
std::vector< std::string > _test_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
const std::vector< std::string > & TestVarNames() const
std::vector< std::string > _trial_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
const std::vector< std::string > & TrialVarNames() const
void SetGridFunctions() override
Moose::MFEM::EquationSystem * GetEquationSystem() const override
Returns a pointer to the operator&#39;s equation system.

◆ SetTestVariablesFromTrueVectors()

void Moose::MFEM::ProblemOperatorBase::SetTestVariablesFromTrueVectors ( )
virtualinherited

Definition at line 65 of file ProblemOperatorBase.C.

Referenced by Moose::MFEM::TimeDomainEquationSystemProblemOperator::ImplicitSolve(), Moose::MFEM::ProblemOperatorBase::Init(), and Moose::MFEM::TimeDomainEquationSystemProblemOperator::Solve().

66 {
67  for (unsigned int ind = 0; ind < _test_variables.size(); ++ind)
68  {
69  auto * const test_var = _test_variables.at(ind);
70 
71  // We must sync the memory flags from the true true vector to the grid function copy of the true
72  // vector
73  mooseAssert(_test_true_vector, "The true vector should already have been set");
74  test_var->GetTrueVector().SyncMemory(*_test_true_vector);
75  test_var->SetFromTrueVector();
76  }
77 }
std::vector< mfem::ParGridFunction * > _test_variables
const mfem::Vector * _test_true_vector

◆ SetTrialVariablesFromTrueVectors()

void Moose::MFEM::ProblemOperatorBase::SetTrialVariablesFromTrueVectors ( )
virtualinherited

Definition at line 80 of file ProblemOperatorBase.C.

Referenced by Moose::MFEM::TimeDomainEquationSystemProblemOperator::ImplicitSolve().

81 {
82  for (unsigned int ind = 0; ind < _trial_variables.size(); ++ind)
83  {
84  _trial_variables.at(ind)->SetFromTrueVector();
85  }
86 }
std::vector< mfem::ParGridFunction * > _trial_variables

◆ Solve()

void Moose::MFEM::EquationSystemProblemOperator::Solve ( )
overridevirtual

Reimplemented from Moose::MFEM::ProblemOperator.

Definition at line 33 of file EquationSystemProblemOperator.C.

34 {
36 
37  if (_problem_data.jacobian_solver->isLOR() && _equation_system->_test_var_names.size() > 1)
38  mooseError("LOR solve is only supported for single-variable systems");
39 
40  _problem_data.jacobian_solver->updateSolver(
41  *_equation_system->_blfs.Get(_equation_system->_test_var_names.at(0)),
42  _equation_system->_ess_tdof_lists.at(0));
43 
47 
49 }
virtual void RecoverFEMSolution(mfem::BlockVector &trueX, Moose::MFEM::GridFunctions &gridfunctions)
Update variable from solution vector after solve.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:333
std::shared_ptr< Moose::MFEM::EquationSystem > _equation_system
Moose::MFEM::EquationSystem * GetEquationSystem() const override
Returns a pointer to the operator&#39;s equation system.
std::shared_ptr< mfem::NewtonSolver > nonlinear_solver
virtual void BuildJacobian(mfem::BlockVector &trueX, mfem::BlockVector &trueRHS)
Build linear system, with essential boundary conditions accounted for.
Moose::MFEM::GridFunctions gridfunctions
std::shared_ptr< MFEMSolverBase > jacobian_solver

Member Data Documentation

◆ _block_true_offsets

mfem::Array<int> Moose::MFEM::ProblemOperatorBase::_block_true_offsets
inherited

◆ _equation_system

std::shared_ptr<Moose::MFEM::EquationSystem> Moose::MFEM::EquationSystemProblemOperator::_equation_system {nullptr}
private

Definition at line 42 of file EquationSystemProblemOperator.h.

Referenced by GetEquationSystem(), and Solve().

◆ _equation_system_operator

mfem::OperatorHandle Moose::MFEM::ProblemOperatorBase::_equation_system_operator
inherited

Definition at line 33 of file ProblemOperatorBase.h.

◆ _problem

MFEMProblem& Moose::MFEM::ProblemOperatorBase::_problem
protectedinherited

◆ _problem_data

MFEMProblemData& Moose::MFEM::ProblemOperatorBase::_problem_data
protectedinherited

◆ _test_true_vector

const mfem::Vector* Moose::MFEM::ProblemOperatorBase::_test_true_vector = nullptr
protectedinherited

◆ _test_var_names

std::vector<std::string> Moose::MFEM::ProblemOperatorBase::_test_var_names
protectedinherited

Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector during solve.

Definition at line 42 of file ProblemOperatorBase.h.

Referenced by Moose::MFEM::ProblemOperatorBase::SetGridFunctions(), SetGridFunctions(), and Moose::MFEM::TimeDomainEquationSystemProblemOperator::SetGridFunctions().

◆ _test_variables

std::vector<mfem::ParGridFunction *> Moose::MFEM::ProblemOperatorBase::_test_variables
protectedinherited

◆ _trial_var_names

std::vector<std::string> Moose::MFEM::ProblemOperatorBase::_trial_var_names
protectedinherited

Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector during solve.

Definition at line 48 of file ProblemOperatorBase.h.

Referenced by Moose::MFEM::ProblemOperatorBase::SetGridFunctions(), SetGridFunctions(), and Moose::MFEM::TimeDomainEquationSystemProblemOperator::SetGridFunctions().

◆ _trial_variables

std::vector<mfem::ParGridFunction *> Moose::MFEM::ProblemOperatorBase::_trial_variables
protectedinherited

◆ _true_rhs

mfem::BlockVector Moose::MFEM::ProblemOperatorBase::_true_rhs
inherited

◆ _true_x

mfem::BlockVector Moose::MFEM::ProblemOperatorBase::_true_x
inherited

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