GEOS
BlockOperatorWrapper.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 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 
20 #ifndef GEOS_LINEARALGEBRA_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
21 #define GEOS_LINEARALGEBRA_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
22 
24 
25 namespace geos
26 {
27 
38 template< typename VECTOR, typename OPERATOR = LinearOperator< VECTOR > >
39 class BlockOperatorWrapper : public BlockOperatorView< VECTOR, OPERATOR >
40 {
41 public:
42 
45 
47  using Vector = typename Base::Vector;
48 
54  explicit BlockOperatorWrapper( localIndex const nRows, localIndex const nCols )
55  : Base( nRows, nCols )
56  {}
57 
62  BlockOperatorWrapper( BlockOperatorWrapper const & rhs ) = delete;
63 
69 
73  virtual ~BlockOperatorWrapper() override = default;
74 
81  void set( localIndex const blockRowIndex,
82  localIndex const blockColIndex,
83  OPERATOR & op )
84  {
85  this->setPointer( blockRowIndex, blockColIndex, &op );
86  }
87 };
88 
89 } // namespace geos
90 
91 #endif //GEOS_LINEARALGEBRA_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
Abstract view of a block operator.
typename Base::Vector Vector
Alias for vector type.
void setPointer(localIndex const blockRowIndex, localIndex const blockColIndex, LinearOperator< VECTOR > *op)
Set/replace a pointer to a block.
"Shallow" representation of a block operator.
BlockOperatorWrapper(BlockOperatorWrapper const &rhs)=delete
Deleted copy constructor.
void set(localIndex const blockRowIndex, localIndex const blockColIndex, OPERATOR &op)
Set a single block of the operator.
BlockOperatorWrapper(localIndex const nRows, localIndex const nCols)
Create a vector wrapper of nBlocks blocks.
typename Base::Vector Vector
Alias for vector type.
BlockOperatorWrapper(BlockOperatorWrapper &&rhs)=delete
Deleted move constructor.
virtual ~BlockOperatorWrapper() override=default
Destructor.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85