GEOS
PreconditionerIdentity.hpp
Go to the documentation of this file.
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 TotalEnergies
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 
20 #ifndef GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERNULL_HPP_
21 #define GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERNULL_HPP_
22 
23 #include "linearAlgebra/common/PreconditionerBase.hpp"
24 
25 namespace geos
26 {
27 
32 template< typename LAI >
34 {
35 public:
36 
39 
41  using Vector = typename Base::Vector;
42 
44  using Matrix = typename Base::Matrix;
45 
52  virtual void apply( Vector const & src,
53  Vector & dst ) const override
54  {
55  GEOS_LAI_ASSERT_EQ( this->numGlobalRows(), dst.globalSize() );
56  GEOS_LAI_ASSERT_EQ( this->numGlobalCols(), src.globalSize() );
57  dst.copy( src );
58  }
59 };
60 
61 } // namespace geos
62 
63 #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