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 MOOSE_MFEM_ENABLED
11 
13 
14 namespace Moose::MFEM
15 {
16 void
18 {
22 }
23 
24 void
26 {
29 }
30 
31 void
33  const mfem::Vector & /*X*/,
34  mfem::Vector & dX_dt)
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 }
58 
59 void
61 {
65 }
66 
67 } // namespace Moose::MFEM
68 
69 #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)
MFEMProblemData & _problem
Reference to the current problem.
Moose::MFEM::CoefficientManager coefficients
std::vector< std::string > _test_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
virtual void BuildEquationSystem()
std::shared_ptr< mfem::NewtonSolver > nonlinear_solver
std::vector< std::string > _trial_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
virtual void BuildJacobian(mfem::BlockVector &trueX, mfem::BlockVector &trueRHS)
Build linear system, with essential boundary conditions accounted for.
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)