https://mooseframework.inl.gov
MFEMNonlinearSolverBase.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 #include "libmesh/ignore_warnings.h"
17 #include "mfem.hpp"
18 #include "libmesh/restore_warnings.h"
19 
20 namespace Moose::MFEM
21 {
26 {
27 public:
28  virtual ~NonlinearSolverBase() = default;
29 
31 
33 
34  void ConstructSolver() override = 0;
35 
37  virtual void SetOperator(const mfem::Operator & op) = 0;
38 
40  virtual void SetLinearSolver(mfem::Solver & solver) = 0;
41 
43  virtual void Mult(const mfem::Vector & rhs, mfem::Vector & x) = 0;
44 
46  virtual bool RequiresGradient() const = 0;
47 
49  virtual bool RequiresExternalLinearSolver() const = 0;
50 };
51 } // namespace Moose::MFEM
52 
53 #endif
void ConstructSolver() override=0
Override in derived classes to construct and set the solver options.
virtual void Mult(const mfem::Vector &rhs, mfem::Vector &x)=0
Solve the nonlinear system for the provided right-hand side and solution vector.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual ~NonlinearSolverBase()=default
virtual void SetOperator(const mfem::Operator &op)=0
Configure the nonlinear solver with the residual/Jacobian operator.
virtual bool RequiresGradient() const =0
Return whether this nonlinear solver requires Jacobian/gradient information from the operator...
virtual void SetLinearSolver(mfem::Solver &solver)=0
Configure the linear solver used inside the nonlinear solve.
Base class for wrapping mfem::Solver-derived classes.
virtual bool RequiresExternalLinearSolver() const =0
Return whether this nonlinear solver requires an externally configured MFEM linear solver...
NonlinearSolverBase(const InputParameters &parameters)
MooseObject base for nonlinear MFEM solve strategies configured in the input file.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).