https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
18
19namespace Moose::MFEM
20{
25{
26public:
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
42protected:
44 virtual void UpdateEquationSystemContext() override;
45
47 std::shared_ptr<LinearSolverBase> _preconditioner;
48
50 std::shared_ptr<EquationSystem> _equation_system;
51
52private:
53 friend class ::MFEMProblemSolve;
54};
55} // namespace Moose::MFEM
56
57#endif
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
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
Base class for linear MFEM solvers and preconditioners.
virtual void UpdateEquationSystemContext() override
Update the solver following any changes to the EquationSystem it is responsible for solving.
std::shared_ptr< EquationSystem > _equation_system
Pointer to EquationSystem used for problem-specific solver setup.
LinearSolverBase * GetPreconditioner()
Returns this solver's preconditioner.
virtual void Solve()
For eigensolvers, this method calls the underlying Solve method.
std::shared_ptr< LinearSolverBase > _preconditioner
Preconditioner to be used for the problem.
static InputParameters validParams()
void SetPreconditioner(T &solver)
Retrieves the preconditioner userobject if present, sets the member pointer to said object if still u...
Base class for wrapping mfem::Solver-derived classes.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).