10 #ifdef MOOSE_MFEM_ENABLED 20 : _problem(problem), _problem_data(problem.getProblemData())
73 trial_var->SetFromTrueVector();
79 mfem::Operator & linear_operator,
80 const mfem::Vector & rhs,
88 if (nonlinear_solver.RequiresExternalLinearSolver())
91 mooseError(
"The configured MFEM nonlinear solver requires an external linear solver, but " 92 "none was provided.");
94 linear_solver.SetOperator(linear_operator);
95 nonlinear_solver.SetLinearSolver(linear_solver.GetSolver());
98 nonlinear_solver.SetOperator(system_operator);
99 nonlinear_solver.Mult(rhs, x);
105 mooseError(
"A linear MFEM solve requires a linear solver, but none was provided.");
108 linear_solver.SetOperator(linear_operator);
109 linear_solver.Mult(rhs, x);
std::vector< std::string > _test_var_names
MFEMProblemData & _problem_data
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...
ProblemOperatorBase(MFEMProblem &problem)
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.
virtual void SetTrialVariablesFromTrueVectors()
virtual void SetGridFunctions()
mfem::Array< int > _block_true_offsets_test
std::shared_ptr< Moose::MFEM::LinearSolverBase > jacobian_solver
std::vector< mfem::ParGridFunction * > _test_variables
mfem::Array< int > _block_true_offsets_trial
mfem::Vector * _trial_true_vector
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...
mfem::BlockVector _true_x
std::vector< mfem::ParGridFunction * > _trial_variables
std::shared_ptr< Moose::MFEM::NonlinearSolverBase > nonlinear_solver
mfem::BlockVector _true_rhs
virtual void Init(mfem::BlockVector &X)
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
Moose::MFEM::GridFunctions gridfunctions
auto index_range(const T &sizable)