GEOS
CollocatedNodes.hpp
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 
16 #ifndef GEOS_COLLOCATEDNODES_HPP
17 #define GEOS_COLLOCATEDNODES_HPP
18 
19 #include "common/DataTypes.hpp"
20 
21 #include <vtkDataSet.h>
22 #include <vtkIdTypeArray.h>
23 #include <vtkSmartPointer.h>
24 
25 namespace geos::vtk
26 {
27 
32 {
33 public:
43  CollocatedNodes( string const & faceBlockName,
44  vtkSmartPointer< vtkDataSet > faceMesh,
45  bool isParallel = true );
46 
52  std::vector< vtkIdType > const & operator[]( std::size_t i ) const
53  {
54  return m_collocatedNodes[i];
55  }
56 
62  [[nodiscard]] std::size_t size() const
63  {
64  return m_collocatedNodes.size();
65  }
66 
67 private:
68 
74  void init( vtkIdTypeArray const * collocatedNodes );
75 
77  std::vector< std::vector< vtkIdType > > m_collocatedNodes;
78 };
79 
80 } // geos::vtk
81 
82 #endif //GEOS_COLLOCATEDNODES_HPP
Convenience wrapper around the raw vtk information.
std::vector< vtkIdType > const & operator[](std::size_t i) const
For node i of the face block, returns all the duplicated global node indices in the main 3d mesh.
CollocatedNodes(string const &faceBlockName, vtkSmartPointer< vtkDataSet > faceMesh, bool isParallel=true)
Build a convenience wrapper around the raw vtk collocated nodes information.
std::size_t size() const
Number of duplicated nodes buckets. Multiple nodes that are considered to be duplicated one of each o...
std::size_t size_t
Unsigned size type.
Definition: DataTypes.hpp:79