https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMOperatorChebyshevSmoother.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{
22 "Chebyshev polynomial smoother backed by mfem::OperatorChebyshevSmoother. "
23 "Symmetric positive definite by construction; the maximum eigenvalue of D^{-1}A "
24 "is estimated automatically via a power method. Suitable as a multigrid smoother.");
25 params.addParam<int>("order", 2, "Degree of the Chebyshev polynomial (1-4).");
26 return params;
27}
28
30 : LinearSolverBase(parameters), _order(getParam<int>("order"))
31{
33}
34
35void
37{
38 // Deferred: mfem::OperatorChebyshevSmoother requires the operator and its diagonal,
39 // which are only available at SetOperator() time. _solver is intentionally left null
40 // here; GetSolver() must not be called before SetOperator().
41}
42
43void
45{
46 _diag.SetSize(op.Height());
47 op.AssembleDiagonal(_diag);
48 _solver = std::make_unique<mfem::OperatorChebyshevSmoother>(
49 op, _diag, _empty_tdofs, _order, getMFEMProblem().getComm());
50}
51#endif
registerMooseObject("MooseApp", MFEMOperatorChebyshevSmoother)
void ErrorVector unsigned int
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition MFEMObject.h:45
Wrapper for mfem::OperatorChebyshevSmoother.
MFEMOperatorChebyshevSmoother(const InputParameters &parameters)
const int _order
Degree of the Chebyshev polynomial used by the MFEM smoother.
virtual void SetOperatorImpl(mfem::Operator &op) override
Rebuilds the multigrid hierarchy for the supplied finest-level operator.
mfem::Array< int > _empty_tdofs
The operator supplied by MOOSE is already constrained.
mfem::Vector _diag
Assembled diagonal.
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
static InputParameters validParams()
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.