52 EquationSolver(std::unique_ptr<mfem::NewtonSolver> nonlinear_solver, std::unique_ptr<mfem::Solver> linear_solver,
65 MPI_Comm comm = MPI_COMM_WORLD);
81 void solve(mfem::Vector& x)
const;
126 std::unique_ptr<mfem::Solver> preconditioner_;
131 std::unique_ptr<mfem::Solver> lin_solver_;
136 std::unique_ptr<mfem::NewtonSolver> nonlin_solver_;
143 bool nonlin_solver_set_solver_called_ =
false;
158 superlu_solver_.SetColumnPermutation(mfem::superlu::PARMETIS);
159 if (print_level == 0) {
160 superlu_solver_.SetPrintStatistics(
false);
170 void Mult(
const mfem::Vector& input, mfem::Vector& output)
const;
187 mutable std::unique_ptr<mfem::SuperLURowLocMatrix> superlu_mat_;
194 mfem::SuperLUSolver superlu_solver_;
197 #ifdef MFEM_USE_STRUMPACK
201 class StrumpackSolver :
public mfem::Solver {
208 StrumpackSolver(
int print_level, MPI_Comm comm) : strumpack_solver_(comm)
210 strumpack_solver_.SetKrylovSolver(strumpack::KrylovSolver::DIRECT);
211 strumpack_solver_.SetReorderingStrategy(strumpack::ReorderingStrategy::METIS);
213 if (print_level == 1) {
214 strumpack_solver_.SetPrintFactorStatistics(
true);
215 strumpack_solver_.SetPrintSolveStatistics(
true);
225 void Mult(
const mfem::Vector& input, mfem::Vector& output)
const;
233 void SetOperator(
const mfem::Operator& op);
240 mutable std::unique_ptr<mfem::STRUMPACKRowLocMatrix> strumpack_mat_;
247 mfem::STRUMPACKSolver strumpack_solver_;
259 std::unique_ptr<mfem::NewtonSolver>
buildNonlinearSolver(NonlinearSolverOptions nonlinear_opts = {},
260 MPI_Comm comm = MPI_COMM_WORLD);
270 LinearSolverOptions linear_opts = {}, MPI_Comm comm = MPI_COMM_WORLD);
281 [[maybe_unused]] MPI_Comm comm = MPI_COMM_WORLD);
291 std::unique_ptr<mfem::AmgXSolver> buildAMGX(
const AMGXOptions& options,
const MPI_Comm comm);
301 struct FromInlet<
serac::LinearSolverOptions> {
312 struct FromInlet<
serac::NonlinearSolverOptions> {
323 struct FromInlet<
serac::EquationSolver> {
This class manages the objects typically required to solve a nonlinear set of equations arising from ...
mfem::NewtonSolver & nonlinearSolver()
const mfem::Solver & linearSolver() const
void setOperator(const mfem::Operator &op)
void solve(mfem::Vector &x) const
mfem::Solver * preconditioner()
static void defineInputFileSchema(axom::inlet::Container &container)
EquationSolver(std::unique_ptr< mfem::NewtonSolver > nonlinear_solver, std::unique_ptr< mfem::Solver > linear_solver, std::unique_ptr< mfem::Solver > preconditioner=nullptr)
const mfem::Solver * preconditioner() const
const mfem::NewtonSolver & nonlinearSolver() const
mfem::Solver & linearSolver()
A wrapper class for using the MFEM SuperLU solver with a HypreParMatrix.
void Mult(const mfem::Vector &input, mfem::Vector &output) const
Factor and solve the linear system y = Op^{-1} x using DSuperLU.
SuperLUSolver(int print_level, MPI_Comm comm)
Constructs a wrapper over an mfem::SuperLUSolver.
void SetOperator(const mfem::Operator &op)
Set the underlying matrix operator to use in the solution algorithm.
Accelerator functionality.
std::pair< std::unique_ptr< mfem::Solver >, std::unique_ptr< mfem::Solver > > buildLinearSolverAndPreconditioner(LinearSolverOptions linear_opts, MPI_Comm comm)
Build the linear solver and its associated preconditioner given a linear options struct.
Preconditioner
The type of preconditioner to be used.
std::unique_ptr< mfem::Solver > buildPreconditioner(Preconditioner preconditioner, int print_level, [[maybe_unused]] MPI_Comm comm)
Build a preconditioner from the available options.
std::unique_ptr< mfem::NewtonSolver > buildNonlinearSolver(NonlinearSolverOptions nonlinear_opts, MPI_Comm comm)
Build a nonlinear solver using the nonlinear option struct.
This file contains enumerations and record types for physics solver configuration.
Parameters for an iterative linear solution scheme.
Nonlinear solution scheme parameters.