GEOSX
CollocatedNodes.hpp
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 
15 #ifndef GEOS_COLLOCATEDNODES_HPP
16 #define GEOS_COLLOCATEDNODES_HPP
17 
18 #include "common/DataTypes.hpp"
19 
20 #include <vtkDataSet.h>
21 #include <vtkIdTypeArray.h>
22 #include <vtkSmartPointer.h>
23 
24 namespace geos::vtk
25 {
26 
31 {
32 public:
42  CollocatedNodes( string const & faceBlockName,
43  vtkSmartPointer< vtkDataSet > faceMesh,
44  bool isParallel = true );
45 
51  std::vector< vtkIdType > const & operator[]( std::size_t i ) const
52  {
53  return m_collocatedNodes[i];
54  }
55 
61  [[nodiscard]] std::size_t size() const
62  {
63  return m_collocatedNodes.size();
64  }
65 
66 private:
67 
73  void init( vtkIdTypeArray const * collocatedNodes );
74 
76  std::vector< std::vector< vtkIdType > > m_collocatedNodes;
77 };
78 
79 } // geos::vtk
80 
81 #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:119