https://mooseframework.inl.gov
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 {
21  params.addClassDescription(
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 
35 void
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 
43 void
45 {
46  _diag.SetSize(op.Height());
47  op.AssembleDiagonal(_diag);
48  _solver = std::make_unique<mfem::OperatorChebyshevSmoother>(
50 }
51 #endif
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition: MFEMObject.h:45
mfem::Vector _diag
Assembled diagonal.
registerMooseObject("MooseApp", MFEMOperatorChebyshevSmoother)
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...
mfem::Array< int > _empty_tdofs
The operator supplied by MOOSE is already constrained.
static InputParameters validParams()
Wrapper for mfem::OperatorChebyshevSmoother.
void SetOperator(mfem::Operator &op) override
Updates the solver at the operator level.
MPI_Comm getComm()
Return the MPI communicator associated with this FE problem&#39;s mesh.
Definition: MFEMProblem.h:276
MFEMOperatorChebyshevSmoother(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...
const int _order
Degree of the Chebyshev polynomial used by the MFEM smoother.
void ErrorVector unsigned int