GEOS
PreconditionerIdentity.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
16 #ifndef GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
17 #define GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERIDENTITY_HPP_
18 
20 #include "linearAlgebra/common/PreconditionerBase.hpp"
21 
22 namespace geos
23 {
24 
29 template< typename LAI >
31 {
32 public:
33 
36 
38  using Vector = typename Base::Vector;
39 
41  using Matrix = typename Base::Matrix;
42 
43  virtual ~PreconditionerIdentity() = default;
44 
51  virtual void apply( Vector const & src,
52  Vector & dst ) const override
53  {
54  GEOS_LAI_ASSERT_EQ( this->numGlobalRows(), dst.globalSize() );
55  GEOS_LAI_ASSERT_EQ( this->numGlobalCols(), src.globalSize() );
56  dst.copy( src );
57  }
58 };
59 
60 }
61 
62 #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:49