Line data Source code
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 : { 22 : /** 23 : * MooseObject base for nonlinear MFEM solve strategies configured in the input file. 24 : */ 25 : class NonlinearSolverBase : public SolverBase 26 : { 27 : public: 28 48 : virtual ~NonlinearSolverBase() = default; 29 : 30 : static InputParameters validParams(); 31 : 32 : NonlinearSolverBase(const InputParameters & parameters); 33 : 34 : void ConstructSolver() override = 0; 35 : 36 : /// Configure the linear solver used inside the nonlinear solve. 37 : virtual void SetLinearSolver(mfem::Solver & solver) = 0; 38 : 39 : /// Return whether this nonlinear solver requires Jacobian/gradient information from the operator. 40 : virtual bool RequiresGradient() const = 0; 41 : 42 : /// Return whether this nonlinear solver requires an externally configured MFEM linear solver. 43 : virtual bool RequiresExternalLinearSolver() const = 0; 44 : }; 45 : } // namespace Moose::MFEM 46 : 47 : #endif