Loading...
Searching...
No Matches
foamVtkMeshMaps.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::foamVtkMeshMaps
28
29Description
30 Bookkeeping for mesh subsetting and/or polyhedral cell decomposition.
31 Although the main use case is for handling vtk meshes, it is not specific
32 to VTK alone.
33
34 The cellMap is a local-to-global lookup for normal and decomposed cells.
35 The pointMap is an optional local-to-global lookup for point ids.
36 The additional ids is typically used to store the cell-centre labels
37 for additional points of decomposed cells
38
39SourceFiles
40 foamVtkMeshMaps.cxx
41 foamVtkMeshMapsI.H
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef Foam_vtk_vtkMeshMaps_H
46#define Foam_vtk_vtkMeshMaps_H
47
48#include "DynamicList.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
55/*---------------------------------------------------------------------------*\
56 Class foamVtkMeshMaps Declaration
57\*---------------------------------------------------------------------------*/
58
60{
61 // Private Data
62
63 //- Original cell ids for all cells (regular and decomposed)
64 DynamicList<label> cellMap_;
65
66 //- Point labels for subsetted meshes
67 DynamicList<label> pointMap_;
68
69 //- Any additional (user) labels.
70 // Eg, cell-centre labels for additional points of decomposed cells
71 DynamicList<label> extraIds_;
72
73
74public:
75
76 // Constructors
77
78 //- Default construct: zero-sized, no reserved sizes
79 foamVtkMeshMaps() = default;
80
81
82 // Member Functions
84 // Access
85
86 //- Original cell ids for all cells (regular and decomposed).
87 // For regular mesh comprising only primitive cell types, this will
88 // be an identity list. However, for subsetted meshes and decomposed
89 // cells this becomes a useful means of mapping from the original mesh.
90 const labelList& cellMap() const noexcept { return cellMap_; }
91
92 //- Write access to original cell ids
93 DynamicList<label>& cellMap() noexcept { return cellMap_; }
94
95 //- Point labels for subsetted meshes
96 const labelList& pointMap() const noexcept { return pointMap_; }
98 //- Write access to point labels for subsetted meshes
99 DynamicList<label>& pointMap() noexcept { return pointMap_; }
100
101 //- Any additional (user) labels.
102 // Eg, cell-centre labels for additional points of decomposed cells
103 const labelList& additionalIds() const noexcept { return extraIds_; }
104
105 //- Write access to additional (user) labels.
106 DynamicList<label>& additionalIds() noexcept { return extraIds_; }
108
109 // Edit
110
111 //- Clear sizing
112 inline void clear();
113
114 //- Renumber cell ids (cellMap and additionalIds) to account for
115 //- subset meshes
116 void renumberCells(const labelUList& mapping);
117
118 //- Renumber point ids (pointMap) to account for subset meshes
119 void renumberPoints(const labelUList& mapping);
120};
121
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125} // End namespace Foam
126
127// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128
129#include "foamVtkMeshMapsI.H"
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133#endif
134
135// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
DynamicList< label > & additionalIds() noexcept
Write access to additional (user) labels.
const labelList & additionalIds() const noexcept
Any additional (user) labels.
DynamicList< label > & pointMap() noexcept
Write access to point labels for subsetted meshes.
void renumberPoints(const labelUList &mapping)
Renumber point ids (pointMap) to account for subset meshes.
void renumberCells(const labelUList &mapping)
Renumber cell ids (cellMap and additionalIds) to account for subset meshes.
foamVtkMeshMaps()=default
Default construct: zero-sized, no reserved sizes.
void clear()
Clear sizing.
const labelList & cellMap() const noexcept
Original cell ids for all cells (regular and decomposed).
const labelList & pointMap() const noexcept
Point labels for subsetted meshes.
DynamicList< label > & cellMap() noexcept
Write access to original cell ids.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
const direction noexcept
Definition scalarImpl.H:265
UList< label > labelUList
A UList of labels.
Definition UList.H:75