https://mooseframework.inl.gov
MFEMLinearSolverBase.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 "MFEMSolverBase.h"
15 #include "EquationSystem.h"
16 
17 class MFEMProblemSolve;
18 
19 namespace Moose::MFEM
20 {
25 {
26 public:
28 
30 
33  template <typename T>
34  void SetPreconditioner(T & solver);
35 
38 
40  virtual void Solve() { mooseError("'solve' method not used in this solver type."); }
41 
42 protected:
44  virtual void UpdateEquationSystemContext() override;
45 
47  std::shared_ptr<LinearSolverBase> _preconditioner;
48 
50  std::shared_ptr<EquationSystem> _equation_system;
51 
52 private:
53  friend class ::MFEMProblemSolve;
54 };
55 } // namespace Moose::MFEM
56 
57 #endif
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
LinearSolverBase(const InputParameters &parameters)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
LinearSolverBase * GetPreconditioner()
Returns this solver&#39;s preconditioner.
static InputParameters validParams()
std::shared_ptr< LinearSolverBase > _preconditioner
Preconditioner to be used for the problem.
Base class for linear MFEM solvers and preconditioners.
virtual void Solve()
For eigensolvers, this method calls the underlying Solve method.
Base class for wrapping mfem::Solver-derived classes.
void SetPreconditioner(T &solver)
Retrieves the preconditioner userobject if present, sets the member pointer to said object if still u...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:271
virtual void UpdateEquationSystemContext() override
Update the solver following any changes to the EquationSystem it is responsible for solving...
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
std::shared_ptr< EquationSystem > _equation_system
Pointer to EquationSystem used for problem-specific solver setup.