GEOSX
TrilinosPreconditioner.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_INTERFACES_TRILINOSAMG_HPP_
20 #define GEOSX_LINEARALGEBRA_INTERFACES_TRILINOSAMG_HPP_
21 
22 #include "linearAlgebra/solvers/PreconditionerBase.hpp"
25 
26 #include <memory>
27 
28 class Epetra_Operator;
29 
30 namespace Teuchos
31 {
32 class ParameterList;
33 }
34 
35 namespace geosx
36 {
37 
41 class TrilinosPreconditioner final : public PreconditionerBase< TrilinosInterface >
42 {
43 public:
44 
47 
49  using Vector = typename Base::Vector;
50 
52  using Matrix = typename Base::Matrix;
53 
55  using Base::compute;
56 
62 
69  array1d< Vector > const & nearNullKernel );
70 
74  virtual ~TrilinosPreconditioner() override;
75 
80  virtual void compute( Matrix const & mat ) override;
81 
89  virtual void apply( Vector const & src, Vector & dst ) const override;
90 
91  virtual void clear() override;
92 
97  Epetra_Operator const & unwrapped() const;
98 
102  Epetra_Operator & unwrapped();
103 
104 private:
105 
107  LinearSolverParameters m_parameters;
108 
110  std::unique_ptr< Epetra_Operator > m_precond;
111 
113  array2d< real64 > m_nullSpacePointer;
114 };
115 
116 }
117 
118 #endif //GEOSX_LINEARALGEBRA_INTERFACES_TRILINOSAMG_HPP_
Common interface for preconditioning operators.
typename Base::Matrix Matrix
Alias for matrix type.
Set of parameters for a linear solver or preconditioner.
Wrapper around Trilinos-based preconditioners.
typename TrilinosInterface ::ParallelMatrix Matrix
Alias for matrix type.
typename Base::Vector Vector
Alias for vector type.
typename Base::Vector Vector
Alias for vector type.
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
Definition: Array.hpp:55