https://mooseframework.inl.gov
MFEMHypreAME.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 
12 #include "MFEMHypreAME.h"
13 #include "MFEMProblem.h"
14 
16 
19 {
21  params.addClassDescription("Hypre auxiliary-space Maxwell eigensolver to compute the lowest "
22  "eigenmodes of a generalized eigenvalue problem.");
23 
24  return params;
25 }
26 
28  : Moose::MFEM::EigensolverBase(parameters)
29 {
31 }
32 
33 void
35 {
36  _eigensolver = std::make_unique<mfem::HypreAME>(getMFEMProblem().getComm());
37 
38  _eigensolver->SetNumModes(_num_modes);
39  _eigensolver->SetMaxIter(getParam<int>("l_max_its"));
40  _eigensolver->SetTol(getParam<mfem::real_t>("l_tol"));
41  _eigensolver->SetPrintLevel(getParam<int>("print_level"));
43 }
44 
45 #endif
registerMooseObject("MooseApp", MFEMHypreAME)
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition: MFEMObject.h:45
Class for the HypreAME eigensolver.
Definition: MFEMHypreAME.h:19
static InputParameters validParams()
Definition: MFEMHypreAME.C:18
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
MFEMHypreAME(const InputParameters &parameters)
Definition: MFEMHypreAME.C:27
virtual void ConstructSolver() override
Override in derived classes to construct and set the solver options.
Definition: MFEMHypreAME.C:34
std::unique_ptr< mfem::HypreAME > _eigensolver
Eigensolver to be used for the problem.
Definition: MFEMHypreAME.h:60
MPI_Comm getComm()
Return the MPI communicator associated with this FE problem&#39;s mesh.
Definition: MFEMProblem.h:264
void SetPreconditioner(T &solver)
Retrieves the preconditioner userobject if present, sets the member pointer to said object if still u...
int _num_modes
Number of eigenmodes to compute.
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...
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
static InputParameters validParams()