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 2218 : MFEMOperatorJacobiSmoother::validParams() 19 : { 20 : InputParameters params = 21 2218 : Moose::MFEM::LORLinearSolverBase<mfem::OperatorJacobiSmoother>::validParams(); 22 4436 : params.addClassDescription("MFEM solver for performing Jacobi smoothing of the equation system."); 23 4436 : params.addParam<mfem::real_t>( 24 : "damping", 25 4436 : 1.0, 26 : "Damping factor omega for the scaled-Jacobi iteration y = omega * D^{-1} * x. " 27 : "When used as a multigrid smoother, omega must satisfy omega < 2/lambda_max(D^{-1}A)."); 28 2218 : return params; 29 0 : } 30 : 31 44 : MFEMOperatorJacobiSmoother::MFEMOperatorJacobiSmoother(const InputParameters & parameters) 32 44 : : Moose::MFEM::LORLinearSolverBase<mfem::OperatorJacobiSmoother>(parameters) 33 : { 34 44 : ConstructSolver(); 35 44 : } 36 : 37 : void 38 44 : MFEMOperatorJacobiSmoother::ConstructSolver() 39 : { 40 88 : auto solver = std::make_unique<mfem::OperatorJacobiSmoother>(getParam<double>("damping")); 41 44 : SetSolverParameters(*solver); 42 44 : _solver = std::move(solver); 43 44 : } 44 : 45 : void 46 75 : MFEMOperatorJacobiSmoother::SetSolverParameters(mfem::OperatorJacobiSmoother & solver) 47 : { 48 150 : solver.iterative_mode = getParam<bool>("use_initial_guess"); 49 75 : } 50 : 51 : #endif