https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMHypreAME.h
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#pragma once
13
14#include "MFEMEigensolverBase.h"
15
20{
21public:
23
25
27 virtual void SetMassMatrix(mfem::Operator & mass) override
28 {
29 _eigensolver->SetMassMatrix(libMesh::cast_ref<mfem::HypreParMatrix &>(mass));
30 }
31
33 virtual void Solve() override { _eigensolver->Solve(); }
34
36 virtual void GetEigenvalues(mfem::Array<mfem::real_t> & eigenvalues) const override
37 {
38 _eigensolver->GetEigenvalues(eigenvalues);
39 }
40
42 virtual const mfem::HypreParVector & GetEigenvector(int index) const override
43 {
44 return _eigensolver->GetEigenvector(index);
45 }
46
48 virtual void ConstructSolver() override;
49
50protected:
52 virtual void SetOperatorImpl(mfem::Operator & op) override
53 {
55 _preconditioner->SetOperator(op);
56 _eigensolver->SetOperator(libMesh::cast_ref<mfem::HypreParMatrix &>(op));
57 }
58
60 std::unique_ptr<mfem::HypreAME> _eigensolver;
61};
62
63#endif
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Class for the HypreAME eigensolver.
virtual const mfem::HypreParVector & GetEigenvector(int index) const override
Retrieves the computed eigenvector corresponding to the given index.
virtual void ConstructSolver() override
Override in derived classes to construct and set the solver options.
static InputParameters validParams()
virtual void SetOperatorImpl(mfem::Operator &op) override
Sets the operator for the eigensolver and propagates it to the preconditioner.
virtual void SetMassMatrix(mfem::Operator &mass) override
Sets the mass matrix for the eigensolver.
virtual void Solve() override
Solves the eigenvalue problem.
virtual void GetEigenvalues(mfem::Array< mfem::real_t > &eigenvalues) const override
Retrieves the computed eigenvalues.
std::unique_ptr< mfem::HypreAME > _eigensolver
Eigensolver to be used for the problem.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Base class for eigensolvers.
std::shared_ptr< LinearSolverBase > _preconditioner
Preconditioner to be used for the problem.