1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 The enriched patch contains a double set of faces from the two
30 sides of the sliding interface before the cutting.
32 The patch basically consists of two over-lapping sets of faces sitting
33 on a common point support, where every edge may be shared by more than
34 2 faces. The patch points are collected in a map. Additional
35 information needed for cutting is the point insertion into every edge
39 If new points are created during master-slave edge cutting, they
40 should be registred with the pointMap.
43 Hrvoje Jasak, Nabla Ltd. and Wikki Ltd. All rights reserved.
44 Copyright Hrvoje Jasak
48 enrichedPatchCutFaces.C
50 enrichedPatchPointMap.C
51 enrichedPatchPointMergeMap.C
52 enrichedPatchPointPoints.C
54 \*---------------------------------------------------------------------------*/
56 #ifndef enrichedPatch_H
57 #define enrichedPatch_H
59 #include "primitiveFacePatch.H"
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 // Forward declaration of classes
70 /*---------------------------------------------------------------------------*\
71 Class enrichedPatch Declaration
72 \*---------------------------------------------------------------------------*/
78 //- Reference to master patch
79 const primitiveFacePatch& masterPatch_;
81 //- Reference to slave patch
82 const primitiveFacePatch& slavePatch_;
84 //- Map of points supporting patch faces
85 mutable Map<point> pointMap_;
87 //- Has the point map been completed?
88 mutable bool pointMapComplete_;
90 //- Map of point merges
91 mutable Map<label> pointMergeMap_;
93 //- Slave point point hits
94 const labelList& slavePointPointHits_;
96 //- Slave point edge hits
97 const labelList& slavePointEdgeHits_;
99 //- Slave point face hits
100 const List<objectHit>& slavePointFaceHits_;
103 // Demand-driven private data
106 mutable faceList* enrichedFacesPtr_;
109 mutable labelList* meshPointsPtr_;
112 mutable faceList* localFacesPtr_;
115 mutable pointField* localPointsPtr_;
117 //- Point-point addressing
118 mutable labelListList* pointPointsPtr_;
120 // Master point addressing
121 mutable Map<labelList>* masterPointFacesPtr_;
124 // Cut faces and addressing
127 mutable faceList* cutFacesPtr_;
130 // - the face on the master patch for internal faces
131 // - the creator face for boundary face
132 mutable labelList* cutFaceMasterPtr_;
135 // - the face on the slave patch for internal faces
136 // - -1 for boundary face
137 mutable labelList* cutFaceSlavePtr_;
140 mutable faceList* localCutFacesPtr_;
143 // Private Member Functions
145 //- Disallow default bitwise copy construct
146 enrichedPatch(const enrichedPatch&);
148 //- Disallow default bitwise assignment
149 void operator=(const enrichedPatch&);
151 // Creation of demand-driven private data
153 //- Calculate point merge map
154 void calcPointMergeMap() const;
156 //- Calculate mesh points
157 void calcMeshPoints() const;
159 //- Calculate local points
160 void calcLocalPoints() const;
162 //- Calculate local faces
163 void calcLocalFaces() const;
165 //- Calculate point-point addressing
166 void calcPointPoints() const;
168 //- Calculate master point addressing
169 void calcMasterPointFaces() const;
171 //- Calculate cut faces
172 void calcCutFaces() const;
174 //- Calculate local cut faces
175 void calcLocalCutFaces() const;
178 void clearCutFaces();
180 //- Clear out demand-driven data
184 // Static data members
186 //- Estimated ratio of original-to-enriched face size
187 static const label enrichedFaceRatio_;
189 //- Estimated number of master face hits by slave points
190 static const label nFaceHits_;
192 //- Size of face on which the check is forced
193 static const label maxFaceSizeDebug_;
195 //- Out of plane tolerance used to reject points in right-hand walk
196 static const scalar outOfPlaneTol_;
201 // Static data members
202 ClassName("enrichedPatch");
206 //- Construct from components
209 const primitiveFacePatch& masterPatch,
210 const primitiveFacePatch& slavePatch,
211 const labelList& slavePointPointHits,
212 const labelList& slavePointEdgeHits,
213 const List<objectHit>& slavePointFaceHits
226 //- Return non-const access to point map to add points
227 Map<point>& pointMap();
229 //- Return map of points
230 const Map<point>& pointMap() const;
232 //- Return map of point merges
233 Map<label>& pointMergeMap()
235 return pointMergeMap_;
238 //- Return map of point merges
239 const Map<label>& pointMergeMap() const
241 return pointMergeMap_;
244 //- Complete point map
245 void completePointMap() const;
250 //- Calculate enriched faces
251 void calcEnrichedFaces
253 const labelListList& pointsIntoMasterEdges,
254 const labelListList& pointsIntoSlaveEdges,
255 const pointField& projectedSlavePoints
258 //- Return enriched faces
259 const faceList& enrichedFaces() const;
261 //- Return mesh points
262 const labelList& meshPoints() const;
264 //- Return local faces
265 const faceList& localFaces() const;
267 //- Return local points
268 const pointField& localPoints() const;
270 //- Return point-point addressing
271 const labelListList& pointPoints() const;
273 //- Master point face addressing
274 const Map<labelList>& masterPointFaces() const;
279 //- Return list of cut faces
280 const faceList& cutFaces() const;
282 //- Return cut face master list
283 const labelList& cutFaceMaster() const;
285 //- Return cut face slave list
286 const labelList& cutFaceSlave() const;
288 //- Return local cut faces
289 const faceList& localCutFaces() const;
292 //- Check if the patch is fully supported
293 bool checkSupport() const;
297 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299 } // End namespace Foam
301 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
305 // ************************************************************************* //