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

Problem operator for time-dependent problems with an equation system. More...

#include <TimeDomainEquationSystemProblemOperator.h>

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

Public Member Functions

 TimeDomainEquationSystemProblemOperator (MFEMProblemData &problem)
 
void SetGridFunctions () override
 
void Init (mfem::BlockVector &X) override
 
void ImplicitSolve (const double dt, const mfem::Vector &X, mfem::Vector &dX_dt) override
 
Moose::MFEM::TimeDependentEquationSystemGetEquationSystem () const override
 Returns a pointer to the operator's equation system. More...
 
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 Member Functions

void BuildEquationSystemOperator (double dt)
 

Protected Attributes

MFEMProblemData_problem
 Reference to the current problem. More...
 
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::TimeDependentEquationSystem_equation_system {nullptr}
 

Detailed Description

Problem operator for time-dependent problems with an equation system.

Definition at line 20 of file TimeDomainEquationSystemProblemOperator.h.

Constructor & Destructor Documentation

◆ TimeDomainEquationSystemProblemOperator()

Moose::MFEM::TimeDomainEquationSystemProblemOperator::TimeDomainEquationSystemProblemOperator ( MFEMProblemData problem)
inline

Definition at line 24 of file TimeDomainEquationSystemProblemOperator.h.

25  : TimeDomainProblemOperator(problem),
27  std::dynamic_pointer_cast<Moose::MFEM::TimeDependentEquationSystem>(problem.eqn_system))
28  {
29  }
std::shared_ptr< Moose::MFEM::TimeDependentEquationSystem > _equation_system
std::shared_ptr< Moose::MFEM::EquationSystem > eqn_system

Member Function Documentation

◆ BuildEquationSystemOperator()

void Moose::MFEM::TimeDomainEquationSystemProblemOperator::BuildEquationSystemOperator ( double  dt)
protected

Definition at line 60 of file TimeDomainEquationSystemProblemOperator.C.

Referenced by ImplicitSolve().

61 {
65 }
Moose::MFEM::TimeDependentEquationSystem * GetEquationSystem() const override
Returns a pointer to the operator&#39;s equation system.
virtual void BuildJacobian(mfem::BlockVector &trueX, mfem::BlockVector &trueRHS)
Build linear system, with essential boundary conditions accounted for.

◆ GetEquationSystem()

Moose::MFEM::TimeDependentEquationSystem* Moose::MFEM::TimeDomainEquationSystemProblemOperator::GetEquationSystem ( ) const
inlineoverridevirtual

Returns a pointer to the operator's equation system.

Implements Moose::MFEM::EquationSystemInterface.

Definition at line 36 of file TimeDomainEquationSystemProblemOperator.h.

Referenced by BuildEquationSystemOperator(), ImplicitSolve(), Init(), and SetGridFunctions().

37  {
38  if (!_equation_system)
39  {
40  MFEM_ABORT("No equation system has been added.");
41  }
42 
43  return _equation_system.get();
44  }
std::shared_ptr< Moose::MFEM::TimeDependentEquationSystem > _equation_system

◆ ImplicitSolve()

void Moose::MFEM::TimeDomainEquationSystemProblemOperator::ImplicitSolve ( const double  dt,
const mfem::Vector &  X,
mfem::Vector &  dX_dt 
)
override

Definition at line 32 of file TimeDomainEquationSystemProblemOperator.C.

35 {
36  dX_dt = 0.0;
38  for (unsigned int ind = 0; ind < _trial_variables.size(); ++ind)
39  {
40  _trial_variables.at(ind)->MakeTRef(
41  _trial_variables.at(ind)->ParFESpace(), dX_dt, _block_true_offsets[ind]);
42  }
43  _problem.coefficients.setTime(GetTime());
45 
46  if (_problem.jacobian_solver->isLOR() && _equation_system->_test_var_names.size() > 1)
47  mooseError("LOR solve is only supported for single-variable systems");
48 
49  _problem.jacobian_solver->updateSolver(
50  *_equation_system->_blfs.Get(_equation_system->_test_var_names.at(0)),
51  _equation_system->_ess_tdof_lists.at(0));
52 
53  _problem.nonlinear_solver->SetSolver(_problem.jacobian_solver->getSolver());
55  _problem.nonlinear_solver->Mult(_true_rhs, dX_dt);
57 }
std::shared_ptr< Moose::MFEM::TimeDependentEquationSystem > _equation_system
std::vector< mfem::ParGridFunction * > _trial_variables
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
Moose::MFEM::TimeDependentEquationSystem * GetEquationSystem() const override
Returns a pointer to the operator&#39;s equation system.
void setTime(const double time)
MFEMProblemData & _problem
Reference to the current problem.
Moose::MFEM::CoefficientManager coefficients
std::shared_ptr< mfem::NewtonSolver > nonlinear_solver
std::shared_ptr< MFEMSolverBase > jacobian_solver

◆ Init()

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

Reimplemented from Moose::MFEM::ProblemOperatorInterface.

Definition at line 25 of file TimeDomainEquationSystemProblemOperator.C.

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

◆ SetGridFunctions()

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

Reimplemented from Moose::MFEM::ProblemOperatorInterface.

Definition at line 17 of file TimeDomainEquationSystemProblemOperator.C.

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

◆ SetTestVariablesFromTrueVectors()

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

Definition at line 57 of file ProblemOperatorInterface.C.

Referenced by ImplicitSolve(), and Moose::MFEM::ProblemOperatorInterface::Init().

58 {
59  for (unsigned int ind = 0; ind < _test_variables.size(); ++ind)
60  {
61  auto * const test_var = _test_variables.at(ind);
62 
63  // We must sync the memory flags from the true true vector to the grid function copy of the true
64  // vector
65  mooseAssert(_test_true_vector, "The true vector should already have been set");
66  test_var->GetTrueVector().SyncMemory(*_test_true_vector);
67  test_var->SetFromTrueVector();
68  }
69 }
std::vector< mfem::ParGridFunction * > _test_variables

◆ SetTrialVariablesFromTrueVectors()

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

Definition at line 72 of file ProblemOperatorInterface.C.

Referenced by ImplicitSolve().

73 {
74  for (unsigned int ind = 0; ind < _trial_variables.size(); ++ind)
75  {
76  _trial_variables.at(ind)->SetFromTrueVector();
77  }
78 }
std::vector< mfem::ParGridFunction * > _trial_variables

Member Data Documentation

◆ _block_true_offsets

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

◆ _equation_system

std::shared_ptr<Moose::MFEM::TimeDependentEquationSystem> Moose::MFEM::TimeDomainEquationSystemProblemOperator::_equation_system {nullptr}
private

Definition at line 50 of file TimeDomainEquationSystemProblemOperator.h.

Referenced by GetEquationSystem(), and ImplicitSolve().

◆ _equation_system_operator

mfem::OperatorHandle Moose::MFEM::ProblemOperatorInterface::_equation_system_operator
inherited

Definition at line 32 of file ProblemOperatorInterface.h.

◆ _problem

MFEMProblemData& Moose::MFEM::ProblemOperatorInterface::_problem
protectedinherited

◆ _test_true_vector

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

◆ _test_var_names

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

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

Definition at line 40 of file ProblemOperatorInterface.h.

Referenced by Moose::MFEM::ProblemOperatorInterface::SetGridFunctions(), Moose::MFEM::EquationSystemProblemOperator::SetGridFunctions(), and SetGridFunctions().

◆ _test_variables

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

◆ _trial_var_names

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

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

Definition at line 46 of file ProblemOperatorInterface.h.

Referenced by Moose::MFEM::ProblemOperatorInterface::SetGridFunctions(), Moose::MFEM::EquationSystemProblemOperator::SetGridFunctions(), and SetGridFunctions().

◆ _trial_variables

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

◆ _true_rhs

mfem::BlockVector Moose::MFEM::ProblemOperatorInterface::_true_rhs
inherited

◆ _true_x

mfem::BlockVector Moose::MFEM::ProblemOperatorInterface::_true_x
inherited

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