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
 
std::vector< std::string > _test_var_names
 
std::vector< mfem::ParGridFunction * > _test_variables
 
std::vector< std::string > _trial_var_names
 
std::vector< mfem::ParGridFunction * > _trial_variables
 

Private Attributes

std::vector< mfem::ParGridFunction * > _trial_variable_time_derivatives
 
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 64 of file TimeDomainEquationSystemProblemOperator.C.

Referenced by ImplicitSolve().

65 {
69 }
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)

◆ 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 36 of file TimeDomainEquationSystemProblemOperator.C.

39 {
40  dX_dt = 0.0;
42  for (unsigned int ind = 0; ind < _trial_variables.size(); ++ind)
43  {
44  _trial_variables.at(ind)->MakeTRef(
45  _trial_variables.at(ind)->ParFESpace(), dX_dt, _block_true_offsets[ind]);
46  }
47  _problem.coefficients.setTime(GetTime());
49 
50  if (_problem.jacobian_solver->isLOR() && _equation_system->_test_var_names.size() > 1)
51  mooseError("LOR solve is only supported for single-variable systems");
52 
53  _problem.jacobian_solver->updateSolver(
54  *_equation_system->_blfs.Get(_equation_system->_test_var_names.at(0)),
55  _equation_system->_ess_tdof_lists.at(0));
56 
57  _problem.nonlinear_solver->SetSolver(_problem.jacobian_solver->getSolver());
59  _problem.nonlinear_solver->Mult(_true_rhs, dX_dt);
61 }
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)
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 29 of file TimeDomainEquationSystemProblemOperator.C.

30 {
33 }
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 18 of file TimeDomainEquationSystemProblemOperator.C.

19 {
23  _problem.gridfunctions.Get(GetEquationSystem()->TrialVarTimeDerivativeNames());
24 
26 }
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
T * Get(const std::string &field_name) const
Returns a non-owning pointer to the field. This is guaranteed to return a non-null pointer...
Moose::MFEM::GridFunctions gridfunctions

◆ SetTestVariablesFromTrueVectors()

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

Definition at line 47 of file ProblemOperatorInterface.C.

Referenced by ImplicitSolve().

48 {
49  for (unsigned int ind = 0; ind < _test_variables.size(); ++ind)
50  {
51  _test_variables.at(ind)->SetFromTrueVector();
52  }
53 }
std::vector< mfem::ParGridFunction * > _test_variables

◆ SetTrialVariablesFromTrueVectors()

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

Definition at line 56 of file ProblemOperatorInterface.C.

Referenced by ImplicitSolve().

57 {
58  for (unsigned int ind = 0; ind < _trial_variables.size(); ++ind)
59  {
60  _trial_variables.at(ind)->SetFromTrueVector();
61  }
62 }
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 51 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_var_names

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

◆ _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

◆ _trial_variable_time_derivatives

std::vector<mfem::ParGridFunction *> Moose::MFEM::TimeDomainEquationSystemProblemOperator::_trial_variable_time_derivatives
private

Definition at line 50 of file TimeDomainEquationSystemProblemOperator.h.

Referenced by 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: