10 #ifdef MOOSE_MFEM_ENABLED 21 params.
addParam<
unsigned int>(
"nl_max_its", 1,
"Max Nonlinear Iterations");
22 params.
addParam<
Real>(
"nl_abs_tol", 1.0e-50,
"Nonlinear Absolute Tolerance");
23 params.
addParam<
Real>(
"nl_rel_tol", 1.0e-8,
"Nonlinear Relative Tolerance");
24 params.
addParam<
unsigned int>(
"print_level", 1,
"Print level");
25 params.
addParam<std::string>(
"device",
"Run app on the chosen device.");
26 MooseEnum assembly_levels(
"legacy full element partial none",
"legacy",
true);
27 params.
addParam<
MooseEnum>(
"assembly_level", assembly_levels,
"Matrix assembly level.");
33 std::vector<std::shared_ptr<Moose::MFEM::ProblemOperatorBase>> & problem_operators)
35 _mfem_problem(dynamic_cast<
MFEMProblem &>(_problem)),
36 _problem_operators(problem_operators),
37 _nl_max_its(getParam<unsigned
int>(
"nl_max_its")),
38 _nl_abs_tol(getParam<mfem::real_t>(
"nl_abs_tol")),
39 _nl_rel_tol(getParam<mfem::real_t>(
"nl_rel_tol")),
40 _print_level(getParam<unsigned
int>(
"print_level"))
58 bool converged =
true;
86 problem_operator->Solve();
93 solver->constructSolver();
94 if (
auto * prec = solver->getPreconditioner())
95 prec->constructSolver();
99 problem_operator->SetGridFunctions();
103 problem_operator->Solve();
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem...
std::vector< std::shared_ptr< Moose::MFEM::ProblemOperatorBase > > & _problem_operators
virtual bool solve() override
Solve routine provided by this object.
virtual void preSolve()
Override this for actions that should take place before execution, called by FixedPointSolve.
virtual void updateActiveObjects()
Update the active objects in the warehouses.
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_END
virtual void onTimestepEnd() override
const ExecFlagType EXEC_TIMESTEP_END
void displaceMesh()
Displace the mesh, if mesh displacement is enabled.
bool hRefine()
If AMR is enabled, request (and perform if needed) h-refinement.
std::optional< MooseEnum > getComputeDevice() const
Get the device accelerated computations are supposed to be running on.
Executioner & _executioner
Executioner used to construct this.
const ExecFlagType EXEC_TIMESTEP_BEGIN
MFEMProblem & _mfem_problem
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Executioners are objects that do the actual work of solving your problem.
static InputParameters validParams()
MooseApp & _app
The MOOSE application this is associated with.
void backupMultiApps(ExecFlagType type)
Backup the MultiApps associated with the ExecFlagType.
unsigned int _print_level
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void postSolve()
Override this for actions that should take place after execution, called by FixedPointSolve.
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_BEGIN
MFEMProblemSolve(Executioner &ex, std::vector< std::shared_ptr< Moose::MFEM::ProblemOperatorBase >> &problem_operators)
void setMFEMDevice(const std::string &device_string, Moose::PassKey< MFEMProblemSolve >)
Create/configure the MFEM device with the provided device_string.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
bool pRefine()
If AMR is enabled, request (and perform if needed) p-refinement.
void ErrorVector unsigned int
virtual void outputStep(ExecFlagType type)
Output the current step.
std::shared_ptr< MFEMSolverBase > jacobian_solver
virtual void execute(const ExecFlagType &exec_type) override
Convenience function for performing execution of MOOSE systems.
void execTransfers(ExecFlagType type)
Execute the Transfers associated with the ExecFlagType.
void addMFEMNonlinearSolver(unsigned int nl_max_its, mfem::real_t nl_abs_tol, mfem::real_t nl_rel_tol, unsigned int print_level)
Add the nonlinear solver to the system.