GEOSX
BlockOperatorWrapper.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 Total, S.A
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 GEOSX_LINEARALGEBRA_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
20 #define GEOSX_LINEARALGEBRA_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
21 
23 #include "linearAlgebra/common.hpp"
24 
25 namespace geosx
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 
68  BlockOperatorWrapper( BlockOperatorWrapper && rhs ) = delete;
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 geosx
90 
91 #endif //GEOSX_LINEARALGEBRA_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
Abstract view of a block operator.
void setPointer(localIndex const blockRowIndex, localIndex const blockColIndex, OPERATOR *op)
Set/replace a pointer to a block.
BlockOperatorWrapper(localIndex const nRows, localIndex const nCols)
Create a vector wrapper of nBlocks blocks.
typename Base::Vector Vector
Alias for vector type.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
"Shallow" representation of a block operator.
virtual ~BlockOperatorWrapper() override=default
Destructor.