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 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_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
20 #define GEOS_LINEARALGEBRA_UTILITIES_BLOCKOPERATORWRAPPER_HPP_
21 
23 
24 namespace geos
25 {
26 
37 template< typename VECTOR, typename OPERATOR = LinearOperator< VECTOR > >
38 class BlockOperatorWrapper : public BlockOperatorView< VECTOR, OPERATOR >
39 {
40 public:
41 
44 
46  using Vector = typename Base::Vector;
47 
53  explicit BlockOperatorWrapper( localIndex const nRows, localIndex const nCols )
54  : Base( nRows, nCols )
55  {}
56 
61  BlockOperatorWrapper( BlockOperatorWrapper const & rhs ) = delete;
62 
68 
72  virtual ~BlockOperatorWrapper() override = default;
73 
80  void set( localIndex const blockRowIndex,
81  localIndex const blockColIndex,
82  OPERATOR & op )
83  {
84  this->setPointer( blockRowIndex, blockColIndex, &op );
85  }
86 };
87 
88 } // namespace geos
89 
90 #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.
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125