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 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 
15 #ifndef GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
16 #define GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
17 
19 #include "linearAlgebra/common/PreconditionerBase.hpp"
20 
21 namespace geos
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  GEOS_LAI_ASSERT_EQ( this->numGlobalRows(), dst.globalSize() );
54  GEOS_LAI_ASSERT_EQ( this->numGlobalCols(), src.globalSize() );
55  dst.copy( src );
56  }
57 };
58 
59 }
60 
61 #endif //GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
Abstract base class for linear operators.
Common interface for preconditioning operators.
virtual globalIndex numGlobalCols() const override
Get the number of global columns.
virtual globalIndex numGlobalRows() const override
Get the number of global rows.
typename Base::Vector Vector
Alias for vector type.
typename LAI::ParallelMatrix Matrix
Alias for matrix type.
Common interface for identity preconditioning operator.
virtual void apply(Vector const &src, Vector &dst) const override
Apply operator to a vector.
#define GEOS_LAI_ASSERT_EQ(lhs, rhs)
Definition: common.hpp:47