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 
16 class MFEMProblemSolve;
17 
18 namespace Moose::MFEM
19 {
24 {
25 public:
27 
29 
32  template <typename T>
33  void SetPreconditioner(T & solver);
34 
37 
42  virtual void SetupLOR(mfem::ParBilinearForm & /*a*/, mfem::Array<int> & /*tdofs*/) {}
43 
46  virtual void SetOperator(mfem::OperatorHandle & op);
47 
49  bool IsLOR() const { return _lor || (_preconditioner && _preconditioner->IsLOR()); }
50 
52  virtual void Solve() { mooseError("'solve' method not used in this solver type."); }
53 
54 protected:
56  virtual void CheckSpectralEquivalence(mfem::ParBilinearForm & blf) const;
57 
59  bool _lor;
60 
62  std::shared_ptr<LinearSolverBase> _preconditioner;
63 
64 private:
65  friend class ::MFEMProblemSolve;
66 };
67 } // namespace Moose::MFEM
68 
69 #endif
bool IsLOR() const
Returns whether or not this solver (or its preconditioner) uses LOR.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
virtual void SetOperator(mfem::OperatorHandle &op)
Updates the solver at the operator level.
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.
bool _lor
Variable defining whether to use LOR solver.
virtual void Solve()
For eigensolvers, this method calls the underlying Solve method.
virtual void SetupLOR(mfem::ParBilinearForm &, mfem::Array< int > &)
Rebuild any Low-Order-Refined components from the unreduced bilinear form.
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:281
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
virtual void CheckSpectralEquivalence(mfem::ParBilinearForm &blf) const
Checks for the correct configuration of quadrature bases for LOR spectral equivalence.