https://mooseframework.inl.gov
TimeDomainEquationSystemProblemOperator.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #ifdef MFEM_ENABLED
11 
13 
14 namespace Moose::MFEM
15 {
16 
17 void
19 {
23  _problem.gridfunctions.Get(GetEquationSystem()->TrialVarTimeDerivativeNames());
24 
26 }
27 
28 void
30 {
33 }
34 
35 void
37  const mfem::Vector & /*X*/,
38  mfem::Vector & dX_dt)
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 }
62 
63 void
65 {
69 }
70 
71 } // namespace Moose::MFEM
72 
73 #endif
std::shared_ptr< Moose::MFEM::TimeDependentEquationSystem > _equation_system
const std::vector< std::string > & TestVarNames() const
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.
const std::vector< std::string > & TrialVarNames() const
void setTime(const double time)
Moose::MFEM::CoefficientManager coefficients
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...
virtual void BuildEquationSystem()
std::shared_ptr< mfem::NewtonSolver > nonlinear_solver
virtual void BuildJacobian(mfem::BlockVector &trueX, mfem::BlockVector &trueRHS)
Moose::MFEM::GridFunctions gridfunctions
void ImplicitSolve(const double dt, const mfem::Vector &X, mfem::Vector &dX_dt) override
std::shared_ptr< MFEMSolverBase > jacobian_solver
virtual void Init(mfem::BlockVector &X)