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
34 virtual void SetOperator(const mfem::Operator & op) override;
35
37 virtual void Solve() { mooseError("'solve' method not used in this solver type."); }
38
39protected:
41 virtual void SetPreconditionerImpl() { paramError("preconditioner", "Can't be preconditioned."); }
42
44 std::shared_ptr<LinearSolverBase> _preconditioner;
45
47 std::shared_ptr<EquationSystem> _equation_system;
48
49private:
51 void SetPreconditioner(const mfem::Operator & op);
52
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 paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition MooseBase.h:457
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.
std::shared_ptr< EquationSystem > _equation_system
Pointer to EquationSystem used for problem-specific solver setup.
LinearSolverBase * GetPreconditioner()
Returns this solver's preconditioner.
virtual void SetPreconditionerImpl()
Override in solvers that accept a 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(const mfem::Operator &op)
Retrieves the preconditioner, sets the operator on it, and sets it on the wrapped solver.
virtual void SetOperator(const mfem::Operator &op) override
Updates the solver and any associated weak form context at the operator level.
Base class for wrapping mfem::Solver-derived classes.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).