10#ifdef MOOSE_MFEM_ENABLED
21 _problem_data(problem.getProblemData())
75 trial_var->SetFromTrueVector();
81 mfem::Operator & linear_operator,
82 const mfem::Vector & rhs,
90 if (nonlinear_solver.RequiresExternalLinearSolver())
93 mooseError(
"The configured MFEM nonlinear solver requires an external linear solver, but "
94 "none was provided.");
96 linear_solver.SetOperator(linear_operator);
97 nonlinear_solver.SetLinearSolver(linear_solver.GetSolver());
100 nonlinear_solver.SetOperator(system_operator);
101 nonlinear_solver.Mult(rhs, x);
107 mooseError(
"A linear MFEM solve requires a linear solver, but none was provided.");
110 linear_solver.SetOperator(linear_operator);
111 linear_solver.Mult(rhs, x);
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
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 SetTrialVariablesFromTrueVectors()
std::vector< mfem::ParGridFunction * > _trial_variables
mfem::BlockVector _true_solution
Persistent true-DoF solution vector backing this operator's trial grid functions after Init().
void SolveWithOperator(mfem::Operator &system_operator, mfem::Operator &linear_operator, const mfem::Vector &rhs, mfem::Vector &x)
Solve the current system operator using the configured nonlinear and linear solvers.
mfem::Vector * _trial_true_vector
mfem::Array< int > _block_true_offsets_trial
mfem::Array< int > _block_true_offsets_test
MFEMProblemData & _problem_data
std::vector< mfem::ParGridFunction * > _test_variables
mfem::BlockVector _true_rhs
std::vector< std::string > _trial_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
std::vector< std::string > _test_var_names
virtual void SetGridFunctions()
mfem::BlockVector _true_x
ProblemOperatorBase(MFEMProblem &problem)
Interface for objects interacting with the PerfGraph.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
std::shared_ptr< Moose::MFEM::LinearSolverBase > jacobian_solver
std::shared_ptr< Moose::MFEM::NonlinearSolverBase > nonlinear_solver
Moose::MFEM::GridFunctions gridfunctions