GEOSX
TrilinosSolver.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 TotalEnergies
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 GEOS_LINEARALGEBRA_INTERFACES_TRILINOSSOLVER_HPP_
20 #define GEOS_LINEARALGEBRA_INTERFACES_TRILINOSSOLVER_HPP_
21 
25 
26 #include <memory>
27 
28 class AztecOO;
29 
30 namespace geos
31 {
32 
36 class TrilinosSolver final : public LinearSolverBase< TrilinosInterface >
37 {
38 public:
39 
42 
48 
52  virtual ~TrilinosSolver() override;
53 
57  virtual void setup( EpetraMatrix const & mat ) override;
58 
62  virtual void apply( EpetraVector const & src,
63  EpetraVector & dst ) const override;
64 
68  virtual void solve( EpetraVector const & rhs,
69  EpetraVector & sol ) const override;
70 
71 private:
72 
79  int doSolve( EpetraVector const & rhs, EpetraVector & sol ) const;
80 
81  using Base::m_params;
82  using Base::m_result;
83 
85  TrilinosPreconditioner m_precond;
86 
88  std::unique_ptr< AztecOO > m_solver;
89 };
90 
91 } // end geosx namespace
92 
93 #endif /* TRILINOSSOLVER_HPP_ */
Wrapper class for Epetra's CrsMatrix.
Wrapper around Trilinos' Epetra_Vector object.
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
Wrapper around Trilinos-based preconditioners.
This class creates and provides basic support for AztecOO, Amesos and ML libraries.
TrilinosSolver(LinearSolverParameters parameters)
Solver constructor, with parameter list reference.
virtual ~TrilinosSolver() override
Destructor.
virtual void solve(EpetraVector const &rhs, EpetraVector &sol) const override
Solve preconditioned system.
virtual void apply(EpetraVector const &src, EpetraVector &dst) const override
Apply operator to a vector, dst = this(src).
virtual void setup(EpetraMatrix const &mat) override
Compute the preconditioner from a matrix.
Set of parameters for a linear solver or preconditioner.