https://mooseframework.inl.gov
MFEMSuperLU.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 "MFEMSuperLU.h"
13 #include "MFEMProblem.h"
14 
15 registerMooseObject("MooseApp", MFEMSuperLU);
16 
19 {
21  params.addClassDescription("MFEM solver for performing direct solves of sparse systems in "
22  "parallel using the SuperLU_DIST library.");
23 
24  return params;
25 }
26 
27 MFEMSuperLU::MFEMSuperLU(const InputParameters & parameters) : MFEMSolverBase(parameters)
28 {
30 }
31 
32 void
34 {
35  _solver = std::make_unique<Moose::MFEM::SuperLUSolver>(
36  getMFEMProblem().mesh().getMFEMParMesh().GetComm());
37 }
38 
39 void
40 MFEMSuperLU::updateSolver(mfem::ParBilinearForm &, mfem::Array<int> &)
41 {
42  if (_lor)
43  mooseError("SuperLU solver does not support LOR solve");
44 }
45 
46 #endif
static InputParameters validParams()
Definition: MFEMSuperLU.C:18
Wrapper for Moose::MFEM::SuperLUSolver.
Definition: MFEMSuperLU.h:46
virtual MFEMMesh & mesh() override
Overwritten mesh() method from base MooseMesh to retrieve the correct mesh type, in this case MFEMMes...
Definition: MFEMProblem.C:466
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:127
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
void constructSolver(const InputParameters &parameters) override
Override in derived classes to construct and set the solver options.
Definition: MFEMSuperLU.C:33
void updateSolver(mfem::ParBilinearForm &a, mfem::Array< int > &tdofs) override
Updates the solver with the bilinear form in case LOR solve is required.
Definition: MFEMSuperLU.C:40
registerMooseObject("MooseApp", MFEMSuperLU)
MFEMSuperLU(const InputParameters &parameters)
Definition: MFEMSuperLU.C:27
mfem::ParMesh & getMFEMParMesh()
Accessors for the _mfem_par_mesh object.
Definition: MFEMMesh.h:45
bool _lor
Variable defining whether to use LOR solver.
MFEMProblem & getMFEMProblem()
Returns a reference to the MFEMProblem instance.
Base class for wrapping mfem::Solver-derived classes.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:267
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...
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.