SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
serif::polytrope::solverBundle Struct Reference

Structure to manage the lifetime of MFEM solver objects. More...

#include <polySolver.h>

Public Attributes

mfem::GMRESSolver solver
 The linear solver (e.g., GMRES). Must be declared first.
 
mfem::NewtonSolver newton
 The nonlinear solver (e.g., Newton). Must be declared second.
 

Detailed Description

Structure to manage the lifetime of MFEM solver objects.

This structure ensures that the mfem::GMRESSolver outlives the mfem::NewtonSolver that might use it. The mfem::NewtonSolver often takes a pointer or reference to a linear solver, and if the linear solver is destroyed first, it can lead to dangling pointers and crashes.

Note
The order of declaration of members is crucial: solver must be declared before newton to ensure it is constructed first and destroyed last.
Examples
/Users/tboudreaux/Programming/SERiF/src/polytrope/solver/public/polySolver.h.

Definition at line 117 of file polySolver.h.

Member Data Documentation

◆ newton

mfem::NewtonSolver serif::polytrope::solverBundle::newton

The nonlinear solver (e.g., Newton). Must be declared second.

Examples
/Users/tboudreaux/Programming/SERiF/src/polytrope/solver/public/polySolver.h.

Definition at line 119 of file polySolver.h.

◆ solver

mfem::GMRESSolver serif::polytrope::solverBundle::solver

The linear solver (e.g., GMRES). Must be declared first.

Examples
/Users/tboudreaux/Programming/SERiF/src/polytrope/solver/public/polySolver.h.

Definition at line 118 of file polySolver.h.


The documentation for this struct was generated from the following file: