meshStructure.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) 2013-2016 OpenFOAM Foundation
9 Copyright (C) 2018 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::meshStructure
29
30Description
31 Detect extruded mesh structure given a set of faces
32 (uindirectPrimitivePatch).
33
34 All indices to originating set are in terms of global faces,
35 global edges, global points.
36
37SourceFiles
38 meshStructure.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef Foam_meshStructure_H
43#define Foam_meshStructure_H
44
45#include "labelList.H"
47#include "className.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54// Forward Declaration
55class polyMesh;
56class globalIndex;
57
58/*---------------------------------------------------------------------------*\
59 Class meshStructure Declaration
60\*---------------------------------------------------------------------------*/
62class meshStructure
63{
64 // Private data
65
66 //- Cell to patch face
67 labelList cellToPatchFaceAddressing_;
68
69 //- Cell to layer
70 labelList cellLayer_;
71
72 //- Face to patch face
73 labelList faceToPatchFaceAddressing_;
74
75 //- Face to patch edge
76 labelList faceToPatchEdgeAddressing_;
77
78 //- Face to layer
79 labelList faceLayer_;
80
81 //- Point to patch point
82 labelList pointToPatchPointAddressing_;
83
84 //- Point to layer
85 labelList pointLayer_;
86
87 //- Is mesh structured?
88 bool structured_;
89
90
91 // Private Member Functions
92
93 //- Is cell structured
94 bool isStructuredCell
95 (
96 const polyMesh& mesh,
97 const label layerI,
98 const label celli
99 ) const;
100
101 //- Calculate all maps.
102 void correct
103 (
104 const polyMesh& mesh,
105 const uindirectPrimitivePatch& pp,
106 const globalIndex& globalFaces,
107 const globalIndex& globalEdges,
109 );
110
111
112public:
113
114 // Declare name of the class and its debug switch
115 ClassName("meshStructure");
116
117 // Constructors
118
119 //- Construct from mesh and faces in mesh. Any addressing to
120 // faces/edges/points on patch are global indices
122
123 //- Construct from mesh and faces in mesh and global indexing
125 (
126 const polyMesh& mesh,
128 const globalIndex& globalFaces,
129 const globalIndex& globalEdges,
131 );
132
133
134 // Member Functions
135
136 //- Is mesh structured?
137 inline bool structured() const;
138
139 //- Cell to (global) patch face
140 inline const labelList& cellToPatchFaceAddressing() const;
141
142 //- Cell to (global) patch face
144
145 //- Cell to layer
146 inline const labelList& cellLayer() const;
147
148 //- Cell to layer
149 inline labelList& cellLayer();
150
151 //- Face to (global) patch face
152 inline const labelList& faceToPatchFaceAddressing() const;
153
154 //- Face to (global) patch face
156
157 //- Face to (global) patch edge
158 inline const labelList& faceToPatchEdgeAddressing() const;
159
160 //- Face to (global) patch edge
162
163 //- Face to layer
164 inline const labelList& faceLayer() const;
165
166 //- Face to layer
167 inline labelList& faceLayer();
168
169 //- Point to (global) patch point
170 inline const labelList& pointToPatchPointAddressing() const;
171
172 //- Point to (global) patch point
174
175 //- Point to layer
176 inline const labelList& pointLayer() const;
177
178 //- Point to layer
179 inline labelList& pointLayer();
180};
181
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185} // End namespace Foam
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188
189#include "meshStructureI.H"
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193#endif
194
195// ************************************************************************* //
A list of faces which address into the list of points.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Calculates points shared by more than two processor patches or cyclic patches.
Definition: globalPoints.H:103
Detect extruded mesh structure given a set of faces (uindirectPrimitivePatch).
Definition: meshStructure.H:62
bool structured() const
Is mesh structured?
const labelList & faceLayer() const
Face to layer.
const labelList & cellToPatchFaceAddressing() const
Cell to (global) patch face.
const labelList & pointLayer() const
Point to layer.
const labelList & faceToPatchFaceAddressing() const
Face to (global) patch face.
const labelList & pointToPatchPointAddressing() const
Point to (global) patch point.
const labelList & cellLayer() const
Cell to layer.
const labelList & faceToPatchEdgeAddressing() const
Face to (global) patch edge.
ClassName("meshStructure")
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
thermo correct()
dynamicFvMesh & mesh
Namespace for OpenFOAM.