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 {
21 
23 }
24 
25 void
27 {
30  // Set timestepper
31  auto & ode_solver = _problem_data.ode_solver;
32  ode_solver = std::make_unique<mfem::BackwardEulerSolver>();
33  ode_solver->Init(*(this));
34  SetTime(_problem.time());
35 }
36 
37 void
39 {
40  // Advance time step of the MFEM problem. Time is also updated here, and
41  // _problem_operator->SetTime is called inside the ode_solver->Step method to
42  // update the time used by time dependent (function) coefficients.
44  // Synchonise time dependent GridFunctions with updated DoF data.
46 }
47 
48 void
50  const mfem::Vector & /*X*/,
51  mfem::Vector & dX_dt)
52 {
53  dX_dt = 0.0;
55  for (unsigned int ind = 0; ind < _trial_variables.size(); ++ind)
56  {
57  _trial_variables.at(ind)->MakeTRef(
58  _trial_variables.at(ind)->ParFESpace(), dX_dt, _block_true_offsets[ind]);
59  }
62 
63  if (_problem_data.jacobian_solver->isLOR() && _equation_system->_test_var_names.size() > 1)
64  mooseError("LOR solve is only supported for single-variable systems");
65 
66  _problem_data.jacobian_solver->updateSolver(
67  *_equation_system->_blfs.Get(_equation_system->_test_var_names.at(0)),
68  _equation_system->_ess_tdof_lists.at(0));
69 
74 }
75 
76 void
78 {
82 }
83 
84 } // namespace Moose::MFEM
85 
86 #endif
std::vector< std::string > _test_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
virtual Real & time() const
std::shared_ptr< Moose::MFEM::TimeDependentEquationSystem > _equation_system
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...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:333
Moose::MFEM::TimeDependentEquationSystem * GetEquationSystem() const override
Returns a pointer to the operator&#39;s equation system.
const std::vector< std::string > & TrialVarNames() const
std::unique_ptr< mfem::ODESolver > ode_solver
void setTime(const double time)
Moose::MFEM::CoefficientManager coefficients
mfem::BlockVector f
virtual void BuildEquationSystem()
std::vector< mfem::ParGridFunction * > _trial_variables
std::shared_ptr< mfem::NewtonSolver > nonlinear_solver
MFEMProblem & _problem
Reference to the current problem.
virtual void Init(mfem::BlockVector &X)
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
virtual Real & dt() const
std::shared_ptr< MFEMSolverBase > jacobian_solver