GEOS
PreconditionerNull.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 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 
19 #ifndef GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERNULL_HPP_
20 #define GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERNULL_HPP_
21 
22 #include "linearAlgebra/common/PreconditionerBase.hpp"
23 
24 namespace geos
25 {
26 
31 template< typename LAI >
33 {
34 public:
35 
38 
40  using Vector = typename Base::Vector;
41 
43  using Matrix = typename Base::Matrix;
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.zero();
57  }
58 };
59 
60 } // namespace geos
61 
62 #endif //GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERNULL_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 null (zero) 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