https://mooseframework.inl.gov
MFEMOperatorJacobiSmoother.C
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 
13 #include "MFEMProblem.h"
14 
16 
19 {
20  InputParameters params =
22  params.addClassDescription("MFEM solver for performing Jacobi smoothing of the equation system.");
23  params.addParam<mfem::real_t>(
24  "damping",
25  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  return params;
29 }
30 
32  : Moose::MFEM::LORLinearSolverBase<mfem::OperatorJacobiSmoother>(parameters)
33 {
35 }
36 
37 void
39 {
40  auto solver = std::make_unique<mfem::OperatorJacobiSmoother>(getParam<double>("damping"));
41  SetSolverParameters(*solver);
42  _solver = std::move(solver);
43 }
44 
45 void
46 MFEMOperatorJacobiSmoother::SetSolverParameters(mfem::OperatorJacobiSmoother & solver)
47 {
48  solver.iterative_mode = getParam<bool>("use_initial_guess");
49 }
50 
51 #endif
Wrapper for mfem::OperatorJacobiSmoother solver.
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
virtual void SetSolverParameters(mfem::OperatorJacobiSmoother &solver) override
Update the wrapped MFEM solver parameters.
static InputParameters validParams()
registerMooseObject("MooseApp", MFEMOperatorJacobiSmoother)
MFEMOperatorJacobiSmoother(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...