GEOSX
HypreSolver.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOSX_LINEARALGEBRA_HYPRESOLVER_HPP_
20 #define GEOSX_LINEARALGEBRA_HYPRESOLVER_HPP_
21 
24 
25 namespace geosx
26 {
27 
28 class DofManager;
29 class HypreVector;
30 class HypreMatrix;
31 
36 {
37 public:
38 
43  HypreSolver( LinearSolverParameters parameters );
44 
48  virtual ~HypreSolver() = default;
49 
59  void solve( HypreMatrix & mat,
60  HypreVector & sol,
61  HypreVector & rhs,
62  DofManager const * const dofManager = nullptr );
63 
69  {
70  return m_result;
71  }
72 
73 private:
74 
75  LinearSolverParameters m_parameters;
76  LinearSolverResult m_result;
77 
78  void solve_direct( HypreMatrix & mat,
79  HypreVector & sol,
80  HypreVector & rhs );
81 
82  void solve_krylov( HypreMatrix & mat,
83  HypreVector & sol,
84  HypreVector & rhs,
85  DofManager const * const dofManager );
86 
87 };
88 
89 } // end geosx namespace
90 
91 #endif /* HYPRESOLVER_HPP_ */
Wrapper class for hypre's ParVector.
Definition: HypreVector.hpp:55
Wrapper class for hypre's ParCSRMatrix.
Definition: HypreMatrix.hpp:58
HypreSolver(LinearSolverParameters parameters)
Solver constructor, with parameter list reference.
LinearSolverResult const & result()
Get the result of previous solve.
Definition: HypreSolver.hpp:68
Set of parameters for a linear solver or preconditioner.
Results/stats of a linear solve.
The DoFManager is responsible for allocating global dofs, constructing sparsity patterns, and generally simplifying the interaction between PhysicsSolvers and linear algebra operations.
Definition: DofManager.hpp:42
This class creates and provides basic support for Hypre solvers.
Definition: HypreSolver.hpp:35
void solve(HypreMatrix &mat, HypreVector &sol, HypreVector &rhs, DofManager const *const dofManager=nullptr)
Solve system with an iterative solver (HARD CODED PARAMETERS, GMRES).
virtual ~HypreSolver()=default
Virtual destructor.