1 #ifndef GEOS_LINEARALGEBRA_INTERFACES_HYPRE_HYPREDRIVE_HPP_
2 #define GEOS_LINEARALGEBRA_INTERFACES_HYPRE_HYPREDRIVE_HPP_
16 class HypredriveSolverTestPeer;
27 enum class InputSource
41 InputSource
source = InputSource::generatedFallback;
65 void initializeRuntime();
67 void finalizeRuntime();
134 bool configureHypredrive(
HypreMatrix const & mat );
150 void syncExecutionAnnotations();
152 void closeExecutionAnnotations();
154 void syncLegacyResult()
const;
156 void destroyHypredrive();
158 void resetHypredriveState();
163 friend class HypredriveSolverTestPeer;
170 bool m_hasExecutionContext =
false;
171 bool m_timestepScopeActive =
false;
172 bool m_newtonScopeActive =
false;
174 bool m_reportedGeneratedYamlFailure =
false;
175 size_t m_hypredriveGeneration = 0;
176 HYPREDRV_t m_hypredrive{};
177 bool m_linearSolverCreated =
false;
178 mutable HypreVector m_dummyRhs;
179 mutable HypreVector m_dummySol;
180 mutable HypreVector m_residual;
181 std::unique_ptr< HypreSolver > m_legacySolver;
Wrapper class for hypre's ParCSRMatrix.
Wrapper class for hypre's ParVector.
Linear solver adapter that routes GEOS Hypre systems through hypredrive.
void clear() override
Reset solver-owned state and destroy any active hypredrive object.
void solve(HypreVector const &rhs, HypreVector &sol) const override
Solve the linear system with hypredrive.
void setNearNullKernel(arrayView1d< HypreVector const > const &nearNullKernel) override
Set near-null-space modes to pass to HypreDrive during setup.
void setup(HypreMatrix const &mat) override
Build or refresh the solver/preconditioner for a matrix.
HypredriveSolver(LinearSolverParameters parameters)
Construct a hypredrive-backed linear solver.
void setExecutionContext(LinearSolverExecutionContext const &context) override
Update the execution metadata associated with subsequent solves.
void apply(HypreVector const &src, HypreVector &dst) const override
Apply the configured operator as a preconditioner action.
~HypredriveSolver() override
Destroys the managed hypredrive object and releases any fallback solver state.
Simple interface for linear solvers that allows to extract solution results.
LinearSolverResult m_result
Result of most recent solve (status, timings)
LinearSolverParameters m_params
Parameters for the solver.
LinearSolverParameters const & parameters() const
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
std::string string
String type.
internal::StdVectorWrapper< T, Allocator, USE_STD_CONTAINER_BOUNDS_CHECKING > stdVector
Execution metadata associated with a linear-solver invocation.
Set of parameters for a linear solver or preconditioner.