https://mooseframework.inl.gov
MFEMSolverBase.h
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 
12 #pragma once
13 
14 #include "MFEMObject.h"
15 
16 namespace Moose::MFEM
17 {
21 class SolverBase : public MFEMObject
22 {
23 public:
25 
27 
29  mfem::Solver & GetSolver();
30 
32  virtual void ConstructSolver() = 0;
33 
34 protected:
36  std::unique_ptr<mfem::Solver> _solver;
37 };
38 
39 inline mfem::Solver &
41 {
42  mooseAssert(_solver, "Attempting to retrieve solver before it's been constructed");
43  return *_solver;
44 }
45 } // namespace Moose::MFEM
46 
47 #endif
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
Definition: MFEMObject.h:25
mfem::Solver & GetSolver()
Returns the wrapped MFEM solver.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
SolverBase(const InputParameters &parameters)
static InputParameters validParams()
Base class for wrapping mfem::Solver-derived classes.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
virtual void ConstructSolver()=0
Override in derived classes to construct and set the solver options.