GEOSX
PreconditionerIdentity.hpp
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 
15 #ifndef GEOSX_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
16 #define GEOSX_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
17 
19 #include "linearAlgebra/solvers/PreconditionerBase.hpp"
20 
21 namespace geosx
22 {
23 
28 template< typename LAI >
30 {
31 public:
32 
35 
37  using Vector = typename Base::Vector;
38 
40  using Matrix = typename Base::Matrix;
41 
42  virtual ~PreconditionerIdentity() = default;
43 
50  virtual void apply( Vector const & src,
51  Vector & dst ) const override
52  {
53  GEOSX_LAI_ASSERT_EQ( this->numGlobalRows(), dst.globalSize() );
54  GEOSX_LAI_ASSERT_EQ( this->numGlobalCols(), src.globalSize() );
55  dst.copy( src );
56  }
57 };
58 
59 }
60 
61 #endif //GEOSX_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
virtual globalIndex numGlobalRows() const override
Get the number of global rows.
Common interface for preconditioning operators.
virtual globalIndex numGlobalCols() const override
Get the number of global columns.
virtual void apply(Vector const &src, Vector &dst) const override
Apply operator to a vector.
typename LAI::ParallelMatrix Matrix
Alias for matrix type.
#define GEOSX_LAI_ASSERT_EQ(lhs, rhs)
Definition: common.hpp:47
Common interface for identity preconditioning operator.
Abstract base class for linear operators.
typename Base::Vector Vector
Alias for vector type.