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 "MFEMNonlinearSolverBase.h" 15 : 16 : #ifdef MFEM_USE_PETSC 17 : 18 : /** 19 : * MooseObject wrapper for mfem::PetscNonlinearSolver-backed nonlinear solves. 20 : */ 21 : class MFEMPetscNonlinearSolver : public Moose::MFEM::NonlinearSolverBase 22 : { 23 : public: 24 : static InputParameters validParams(); 25 : 26 : MFEMPetscNonlinearSolver(const InputParameters & parameters); 27 : 28 : void ConstructSolver() override; 29 : 30 : void SetOperator(const mfem::Operator & op) override; 31 : void SetLinearSolver(mfem::Solver & solver) override; 32 : void Mult(const mfem::Vector & rhs, mfem::Vector & x) override; 33 7 : bool RequiresGradient() const override { return true; } 34 7 : bool RequiresExternalLinearSolver() const override { return false; } 35 : }; 36 : 37 : #endif 38 : 39 : #endif