https://mooseframework.inl.gov
MFEMSuperLU.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 "MFEMLinearSolverBase.h"
15 
16 namespace Moose::MFEM
17 {
18 
22 class SuperLUSolver : public mfem::SuperLUSolver
23 {
24 public:
25  SuperLUSolver(MPI_Comm comm, int npdep = 1)
26  : mfem::SuperLUSolver(comm), _s_superlu(std::make_unique<mfem::SuperLUSolver>(comm, npdep)) {};
27  void SetOperator(const mfem::Operator & op) override
28  {
29  _a_superlu = std::make_unique<mfem::SuperLURowLocMatrix>(op);
30  _s_superlu->SetOperator(*_a_superlu.get());
31  }
32  void Mult(const mfem::Vector & x, mfem::Vector & y) const override { _s_superlu->Mult(x, y); }
33 
34 private:
35  std::unique_ptr<mfem::SuperLURowLocMatrix> _a_superlu{nullptr};
36  std::unique_ptr<mfem::SuperLUSolver> _s_superlu{nullptr};
37 };
38 } // namespace Moose::MFEM
39 
44 {
45 public:
47 
49 
50 protected:
51  void ConstructSolver() override;
52 
54  void SetupLOR(mfem::ParBilinearForm & a, mfem::Array<int> & tdofs) override;
55 };
56 
57 #endif
static InputParameters validParams()
Definition: MFEMSuperLU.C:18
Wrapper for Moose::MFEM::SuperLUSolver.
Definition: MFEMSuperLU.h:43
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
void SetOperator(const mfem::Operator &op) override
Definition: MFEMSuperLU.h:27
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for linear MFEM solvers and preconditioners.
SuperLUSolver(MPI_Comm comm, int npdep=1)
Definition: MFEMSuperLU.h:25
std::unique_ptr< mfem::SuperLUSolver > _s_superlu
Definition: MFEMSuperLU.h:36
MFEMSuperLU(const InputParameters &parameters)
Definition: MFEMSuperLU.C:26
std::unique_ptr< mfem::SuperLURowLocMatrix > _a_superlu
Definition: MFEMSuperLU.h:35
Wrapper for mfem::SuperLUSolver that creates a SuperLURowLocMatrix from the operator when set...
Definition: MFEMSuperLU.h:22
void SetupLOR(mfem::ParBilinearForm &a, mfem::Array< int > &tdofs) override
Updates the solver with the bilinear form in case LOR solve is required.
Definition: MFEMSuperLU.C:41
void Mult(const mfem::Vector &x, mfem::Vector &y) const override
Definition: MFEMSuperLU.h:32
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
Definition: MFEMSuperLU.C:33