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 : #include "MFEMOperatorJacobiSmoother.h" 13 : #include "MFEMProblem.h" 14 : 15 : registerMooseObject("MooseApp", MFEMOperatorJacobiSmoother); 16 : 17 : InputParameters 18 2606 : MFEMOperatorJacobiSmoother::validParams() 19 : { 20 2606 : InputParameters params = Moose::MFEM::LinearSolverBase::validParams(); 21 2606 : params.addClassDescription("MFEM solver for performing Jacobi smoothing of the equation system."); 22 : 23 2606 : return params; 24 0 : } 25 : 26 254 : MFEMOperatorJacobiSmoother::MFEMOperatorJacobiSmoother(const InputParameters & parameters) 27 254 : : Moose::MFEM::LinearSolverBase(parameters) 28 : { 29 254 : ConstructSolver(); 30 254 : } 31 : 32 : void 33 254 : MFEMOperatorJacobiSmoother::ConstructSolver() 34 : { 35 254 : _solver = std::make_unique<mfem::OperatorJacobiSmoother>(); 36 508 : _solver->iterative_mode = getParam<bool>("use_initial_guess"); 37 254 : } 38 : 39 : void 40 31 : MFEMOperatorJacobiSmoother::SetupLOR(mfem::ParBilinearForm & a, mfem::Array<int> & tdofs) 41 : { 42 31 : if (_lor) 43 : { 44 31 : CheckSpectralEquivalence(a); 45 31 : _solver.reset(new mfem::LORSolver<mfem::OperatorJacobiSmoother>(a, tdofs)); 46 : } 47 31 : } 48 : 49 : #endif