Loading...
Searching...
No Matches
polyTopoChange.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2018-2022,2024 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::polyTopoChange
29
30Description
31 Direct mesh changes based on v1.3 polyTopoChange syntax.
32
33 Instead of recording changes and executing them all in one go (as did
34 v1.3 polyTopoChange) this class actually holds the current
35 points/faces/cells and does the change immediately.
36 It can be asked to compress out all unused points/faces/cells and
37 renumber everything to be consistent.
38
39 Note:
40 - polyTopoChange can be copied.
41 - adding a face using non-existing cells causes all intermediate cells
42 to be added. So always first add cells/points and then faces.
43 (or set strict checking)
44 - strict checking:
45 - any added/modified face can only use already existing vertices
46 - any added face can only use already existing cells
47 - no item can be removed more than once.
48 - removed cell: cell set to 0 faces.
49 - removed face: face set to 0 vertices.
50 - removed point: coordinate set to vector::max (VGREAT,VGREAT,VGREAT).
51 Note that this might give problems if this value is used already.
52 To see if point is equal to above value we don't use == (which might give
53 problems with roundoff error) but instead compare the individual component
54 with >.
55 - coupled patches: the reorderCoupledFaces routine (borrowed from
56 the couplePatches utility) reorders coupled patch faces and
57 uses the cyclicPolyPatch,processorPolyPatch functionality.
58 - zones are assumed to be non-overlapping by default. If desired to be
59 overlapping either set the multiZone to true when calling
60 modifyCell|Face|Point or use the variants of addCell|Face|Point
61 and modifyCell|Face|Point that take a list of zones.
62 - if overlapping zones:
63 - 'main' zone is the lowest numbered zone. -1 means no zones.
64 - 'additional' zones are stored in incremental ordering (and cannot
65 contain -1)
66
67SourceFiles
68 polyTopoChange.C
69 polyTopoChangeI.H
70 polyTopoChangeTemplates.C
71
72\*---------------------------------------------------------------------------*/
73
74#ifndef polyTopoChange_H
75#define polyTopoChange_H
76
77#include "DynamicList.H"
78#include "labelList.H"
79#include "pointField.H"
80#include "Map.H"
81#include "HashSet.H"
82#include "bitSet.H"
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88
89// Forward Declarations
90class face;
91class primitiveMesh;
92class polyMesh;
93class Time;
94class fileName;
96class polyPatch;
97class dictionary;
98class topoAction;
99class objectMap;
100class IOobject;
101class mapPolyMesh;
102template<class T> class CompactListList;
104/*---------------------------------------------------------------------------*\
105 Class polyTopoChange Declaration
106\*---------------------------------------------------------------------------*/
107
108class polyTopoChange
109{
110 // Private data
111
112 //- Whether to allow referencing illegal points/cells/faces
113 // when adding/removing data.
114 bool strict_;
115
116
117 // Patches
118
119 //- Number of patches
120 label nPatches_;
121
122
123 // Points
124
125 //- Current point set
126 DynamicList<point> points_;
127
128 //- Original point label (or masterpoint for added points)
129 DynamicList<label> pointMap_;
130
131 //- For all original and added points contains new point label.
132 //- (used to map return value of addPoint to new mesh point)
133 DynamicList<label> reversePointMap_;
134
135 //- Zone of point
136 Map<label> pointZone_;
137
138 //- Additional zones of points
139 DynamicList<labelList> pointAdditionalZones_;
140
141 //- Retired points
142 labelHashSet retiredPoints_;
143
144
145 // Faces
146
147 //- Current faceList
148 DynamicList<face> faces_;
149
150 //- Patch for every external face (-1 for internal faces)
151 DynamicList<label> region_;
152
153 //- Owner for all faces
154 DynamicList<label> faceOwner_;
155
156 //- Neighbour for internal faces (-1 for external faces)
157 DynamicList<label> faceNeighbour_;
158
159 //- Original face label. Or master face for added-from-faces;
160 // -1 for faces added-from-edge or added-from-point)
161 DynamicList<label> faceMap_;
162
163 //- For all original and added faces contains new face label
164 // (used to map return value of addFace to new mesh face)
165 DynamicList<label> reverseFaceMap_;
166
167 //- Faces added from point (corresponding faceMap_ will
168 // be -1)
169 Map<label> faceFromPoint_;
170
171 //- Faces added from edge (corresponding faceMap_ will
172 // be -1)
173 Map<label> faceFromEdge_;
174
175 //- In mapping whether to reverse the flux.
176 bitSet flipFaceFlux_;
177
178 //- Zone of face
179 Map<label> faceZone_;
180
181 //- Orientation of face in zone
182 bitSet faceZoneFlip_;
183
184 //- Additional zones of face (stored as signed face)
185 DynamicList<labelList> faceAdditionalZones_;
186
187 //- Active faces
188 label nActiveFaces_;
189
190
191 // Cells
192
193 //- Original cell label or master cell for added-from-cell;
194 // -1 for cells added from face or edge.
195 DynamicList<label> cellMap_;
196
197 //- For all original and added cells contains new cell label
198 // (used to map return value of addCell to new mesh cell)
199 DynamicList<label> reverseCellMap_;
200
201 //- Cells added from point
202 Map<label> cellFromPoint_;
203
204 //- Cells added from edge
205 Map<label> cellFromEdge_;
206
207 //- Cells added from face
208 Map<label> cellFromFace_;
209
210 //- First zone of cell (or -1)
211 DynamicList<label> cellZone_;
212
213 //- Additional zones of cell
214 DynamicList<labelList> cellAdditionalZones_;
215
216
217 // Private Member Functions
218
219 //- Reorder contents of container according to oldToNew map
220 template<class Type>
221 static void reorder
222 (
223 const labelUList& oldToNew,
225 );
226
227 template<class Type>
228 static void renumberKey
229 (
230 const labelUList& oldToNew,
231 Map<Type>& map
232 );
233
234 //- Renumber elements of container according to oldToNew map
235 static void renumber
236 (
237 const labelUList& oldToNew,
238 labelHashSet& labels
239 );
240
241 //- Special handling of reverse maps which have <-1 in them
242 static void renumberReverseMap
243 (
244 const labelUList& oldToNew,
245 DynamicList<label>& elems
246 );
247
248 //- Renumber & compact elements of list according to map
249 static void renumberCompact
250 (
251 const labelUList& oldToNew,
252 labelList& elems
253 );
254
255 //- Count number of added and removed quantities from maps.
256 static void countMap
257 (
258 const labelUList& map,
259 const labelUList& reverseMap,
260 label& nAdd,
261 label& nInflate,
262 label& nMerge,
263 label& nRemove
264 );
265
266 //- Print some stats about mesh
267 static void writeMeshStats(const polyMesh& mesh, Ostream& os);
268
269 //- Calculate object maps. Requires reverseMap to have destination
270 // to be marked with <-1.
271 static void getMergeSets
272 (
273 const labelUList& reverseCellMap,
274 const labelUList& cellMap,
275 List<objectMap>& cellsFromCells
276 );
277
278 //- Are all face vertices valid
279 bool hasValidPoints(const face& f) const;
280
281 //- Return face points
282 pointField facePoints(const face& f) const;
283
284 //- Check inputs to modFace or addFace
285 void checkFace
286 (
287 const face& f,
288 const label facei,
289 const label own,
290 const label nei,
291 const label patchi,
292 const label zoneI
293 ) const;
294
295 //- Construct cells (in packed storage)
296 void makeCells
297 (
298 const label nActiveFaces,
299 labelList& cellFaces,
300 labelList& cellFaceOffsets
301 ) const;
302
303 //- Construct cellCells (in packed storage)
304 void makeCellCells
305 (
306 const label nActiveFaces,
307 CompactListList<label>& cellCells
308 ) const;
309
310 //- Cell ordering (bandCompression). Returns number of remaining cells.
311 label getCellOrder
312 (
313 const CompactListList<label>& cellCellAddressing,
314 labelList& oldToNew
315 ) const;
316
317 //- Do upper-triangular ordering and patch ordering.
318 void getFaceOrder
319 (
320 const label nActiveFaces,
321 const labelUList& cellFaces,
322 const labelUList& cellFaceOffsets,
323
324 labelList& oldToNew,
325 labelList& patchSizes,
326 labelList& patchStarts
327 ) const;
328
329 //- Compact and reorder faces according to map
330 void reorderCompactFaces
331 (
332 const label newSize,
333 const labelUList& oldToNew
334 );
335
336 //- Remove all unused/removed points/faces/cells and update
337 //- face ordering (always), cell ordering (bandcompression,
338 //- orderCells=true),
339 //- point ordering (sorted into internal and boundary points,
340 //- orderPoints=true)
341 void compact
342 (
343 const bool orderCells,
344 const bool orderPoints,
345 label& nInternalPoints,
346 labelList& patchSizes,
347 labelList& patchStarts
348 );
349
350 //- Select either internal or external faces out of faceLabels
351 static labelList selectFaces
352 (
353 const primitiveMesh& mesh,
354 const labelUList& faceLabels,
355 const bool internalFacesOnly
356 );
357
358 //- Calculate mapping for patchpoints only
359 void calcPatchPointMap
360 (
361 const UList<Map<label>>& oldPatchMeshPointMaps,
362 const labelUList& patchMap,
364 labelListList& patchPointMap
365 ) const;
366
367 void calcFaceInflationMaps
368 (
369 const polyMesh& mesh,
370 List<objectMap>& facesFromPoints,
371 List<objectMap>& facesFromEdges,
372 List<objectMap>& facesFromFaces
373 ) const;
374
375 void calcCellInflationMaps
376 (
377 const polyMesh& mesh,
378 List<objectMap>& cellsFromPoints,
379 List<objectMap>& cellsFromEdges,
380 List<objectMap>& cellsFromFaces,
381 List<objectMap>& cellsFromCells
382 ) const;
383
384 void resetZones
385 (
386 const polyMesh& mesh, // mesh to get existing info from
387 polyMesh& newMesh, // mesh to change zones on
388 labelListList& pointZoneMap,
389 labelListList& faceZoneFaceMap,
390 labelListList& cellZoneMap
391 ) const;
392
393 void calcFaceZonePointMap
394 (
395 const polyMesh& mesh,
396 const UList<Map<label>>& oldFaceZoneMeshPointMaps,
397 labelListList& faceZonePointMap
398 ) const;
399
400
401 // Coupling
402
403 //- Do all coupled patch face reordering
404 void reorderCoupledFaces
405 (
406 const bool syncParallel,
408 const labelUList& patchMap, // new back to old patch labels
409 const labelUList& patchStarts,
410 const labelUList& patchSizes,
411 const pointField& points
412 );
413
414 void compactAndReorder
415 (
416 const polyMesh& mesh,
417 const labelUList& patchMap, // from new to old patch
418 const bool syncParallel,
419 const bool orderCells,
420 const bool orderPoints,
421 label& nInternalPoints,
422 pointField& newPoints,
423 labelList& patchSizes,
424 labelList& patchStarts,
425 List<objectMap>& pointsFromPoints,
426 List<objectMap>& facesFromPoints,
427 List<objectMap>& facesFromEdges,
428 List<objectMap>& facesFromFaces,
429 List<objectMap>& cellsFromPoints,
430 List<objectMap>& cellsFromEdges,
431 List<objectMap>& cellsFromFaces,
432 List<objectMap>& cellsFromCells,
433 List<Map<label>>& oldPatchMeshPointMaps,
434 labelList& oldPatchNMeshPoints,
435 labelList& oldPatchStarts,
436 List<Map<label>>& oldFaceZoneMeshPointMaps
437 );
438
439public:
440
441 //- Runtime type information
442 ClassName("polyTopoChange");
443
444
445
446 // Constructors
447
448 //- Construct without mesh. Either specify nPatches or use
449 //- setNumPatches before trying to make a mesh (makeMesh, changeMesh)
450 polyTopoChange(const label nPatches, const bool strict = true);
451
452 //- Construct from mesh. Adds all points/face/cells from mesh.
453 polyTopoChange(const polyMesh& mesh, const bool strict = true);
454
455
456 // Member Functions
457
458 // Access
459
460 //- Points. Shrunk after constructing mesh (or calling of compact())
461 const DynamicList<point>& points() const
462 {
463 return points_;
464 }
465
466 const DynamicList<face>& faces() const
467 {
468 return faces_;
469 }
470
471 const DynamicList<label>& region() const
472 {
473 return region_;
474 }
475
476 const DynamicList<label>& faceOwner() const
477 {
478 return faceOwner_;
479 }
480
481 const DynamicList<label>& faceNeighbour() const
482 {
483 return faceNeighbour_;
484 }
485
486 //- Is point removed?
487 //- Considered removed if point is GREAT.
488 inline bool pointRemoved(const label pointi) const;
489
490 //- Is face removed?
491 //- Considered removed if face is empty
492 inline bool faceRemoved(const label facei) const;
493
494 //- Is cell removed?
495 //- Considered removed if the cellMap is -2
496 inline bool cellRemoved(const label celli) const;
497
498
499 // Edit
500
501 //- Clear all storage
502 void clear();
503
504 //- Add all points/faces/cells of mesh. Additional offset for patch
505 //- or zone ids.
506 void addMesh
507 (
508 const polyMesh& mesh,
509 const labelUList& patchMap,
510 const labelUList& pointZoneMap,
511 const labelUList& faceZoneMap,
512 const labelUList& cellZoneMap
513 );
514
515 //- Explicitly pre-size the dynamic storage for expected mesh
516 //- size for if construct-without-mesh
517 void setCapacity
518 (
519 const label nPoints,
520 const label nFaces,
521 const label nCells
522 );
523
524 //- Shrink storage (does not remove any elements; just compacts
525 //- dynamic lists
526 void shrink();
527
528 //- Move all points. Incompatible with other topology changes.
529 void movePoints(const pointField& newPoints);
530
531 //- For compatibility with polyTopoChange: set topological action.
532 label setAction(const topoAction& action);
533
534 //- Add point. Return new point label.
535 // Notes:
536 // - masterPointID can be < 0 (appended points)
537 // - inCell = false: add retired point (to end of point list)
538 label addPoint
539 (
540 const point& pt,
541 const label masterPointID,
542 const label zoneID,
543 const bool inCell
544 );
545
546 //- Add point. Return new point label.
547 // Notes:
548 // - masterPointID can be < 0 (appended points)
549 // - inCell = false: add retired point (to end of point list)
550 label addPoint
551 (
552 const point& pt,
553 const label masterPointID,
554 const labelUList& zoneIDs,
555 const bool inCell
556 );
557
558 //- Modify coordinate.
559 // Notes:
560 // - zoneID = +ve (add to zoneID), -ve (remove from zones)
561 // - inCell = false: add retired point (to end of point list)
562 void modifyPoint
563 (
564 const label pointi,
565 const point& pt,
566 const label zoneID,
567 const bool inCell,
568 const bool multiZone = false
569 );
570
571 //- Modify coordinate.
572 // Notes:
573 // - zoneIDs = set pointZones
574 // - inCell = false: add retired point (to end of point list)
575 void modifyPoint
577 const label pointi,
578 const point& pt,
579 const labelUList& zoneIDs,
580 const bool inCell
581 );
582
583 //- Remove/merge point.
584 void removePoint(const label pointi, const label mergePointi);
585
586 //- Get current cellZone(s). Return number of zones.
587 label pointZones
588 (
589 const label pointi,
590 DynamicList<label>& zones
591 ) const;
592
593 //- Add face to cells. Return new face label.
594 // own,nei<0, zoneID>=0 : add inactive face (to end of face list)
595 label addFace
596 (
597 const face& f,
598 const label own,
599 const label nei,
600 const label masterPointID,
601 const label masterEdgeID,
602 const label masterFaceID,
603 const bool flipFaceFlux,
604 const label patchID,
605 const label zoneID,
606 const bool zoneFlip
607 );
608
609 //- Add face to cells. Return new face label.
610 // own,nei<0, zoneID>=0 : add inactive face (to end of face list)
611 label addFace
612 (
613 const face& f,
614 const label own,
615 const label nei,
616 const label masterPointID,
617 const label masterEdgeID,
618 const label masterFaceID,
619 const bool flipFaceFlux,
620 const label patchID,
621 const labelUList& zoneIDs,
622 const UList<bool>& zoneFlips
623 );
624
625 //- Modify vertices or cell of face.
626 void modifyFace
627 (
628 const face& f,
629 const label facei,
630 const label own,
631 const label nei,
632 const bool flipFaceFlux,
633 const label patchID,
634 const label zoneID,
635 const bool zoneFlip,
636 const bool multiZone = false
637 );
638
639 //- Modify vertices or cell of face.
640 void modifyFace
641 (
642 const face& f,
643 const label facei,
644 const label own,
645 const label nei,
646 const bool flipFaceFlux,
647 const label patchID,
648 const labelUList& zoneIDs,
649 const UList<bool>& zoneFlips
650 );
651
652 //- Remove/merge face.
653 void removeFace(const label facei, const label mergeFacei);
654
655 //- Get current faceZone(s). Return number of zones.
656 label faceZones
657 (
658 const label facei,
659 DynamicList<label>& zones,
660 DynamicList<bool>& flips
661 ) const;
662
663 //- Add cell. Return new cell label.
664 label addCell
665 (
666 const label masterPointID,
667 const label masterEdgeID,
668 const label masterFaceID,
669 const label masterCellID,
670 const label zoneID
671 );
672
673 //- Add zoned cell (zones cannot be -1). Return new cell label.
674 label addCell
675 (
676 const label masterPointID,
677 const label masterEdgeID,
678 const label masterFaceID,
679 const label masterCellID,
680 const labelUList& zoneIDs
681 );
682
683 //- Modify zone of cell. Optionally add to zone.
684 void modifyCell
685 (
686 const label celli,
687 const label zoneID,
688 const bool multiZone = false
689 );
690
691 //- Set zones of cell
692 void modifyCell(const label celli, const labelUList& zoneIDs);
693
694 //- Remove/merge cell.
695 void removeCell(const label celli, const label mergeCelli);
696
697 //- Get current cellZone(s). Return number of zones.
698 label cellZones(const label celli, DynamicList<label>& zones) const;
699
700
701 //- Explicitly set the number of patches if construct-without-mesh
702 //- used.
703 inline void setNumPatches(const label nPatches);
704
705 // Other
706
707 //- Inplace changes mesh without change of patches.
708 // Adapts patch start/end and by default does parallel matching.
709 // Clears all data. Returns map.
710 // inflate = true : keep old mesh points. Put new points into the
711 // returned map (preMotionPoints) so we can use inflation. Any
712 // points out of nothing (appended points) are vector::zero.
713 // inflate = false: set mesh points directly. Empty preMotionPoints
714 // in the map.
715 // orderCells : whether to order the cells (see bandCompression.H)
716 // orderPoints : whether to order the points into internal first
717 // followed by boundary points. This is not fully consistent
718 // with upper-triangular ordering of points and edges so
719 // is only done when explicitly asked for.
721 (
722 polyMesh& mesh,
723 const labelUList& patchMap,
724 const bool inflate,
725 const bool syncParallel = true,
726 const bool orderCells = false,
727 const bool orderPoints = false
728 );
729
730 //- Without patch mapping
732 (
733 polyMesh& mesh,
734 const bool inflate,
735 const bool syncParallel = true,
736 const bool orderCells = false,
737 const bool orderPoints = false
738 );
739
740 //- Create new mesh with old mesh patches. Additional dictionaries
741 // (fv* etc) read according to IO flags
742 template<class Type>
744 (
745 autoPtr<Type>& newMesh,
746 const IOobject& io,
747 const polyMesh& mesh,
748 const labelUList& patchMap,
749 const bool syncParallel = true,
750 const bool orderCells = false,
751 const bool orderPoints = false
752 );
753
754 //- Create new mesh with old mesh patches. Additional dictionaries
755 // (fv* etc) read according to IO flags
756 template<class Type>
758 (
759 autoPtr<Type>& newMesh,
760 const IOobject& io,
761 const polyMesh& mesh,
762 const bool syncParallel = true,
763 const bool orderCells = false,
764 const bool orderPoints = false
765 );
766};
767
768
769// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
770
771} // End namespace Foam
772
773// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
774
775#include "polyTopoChangeI.H"
776
777#ifdef NoRepository
779#endif
780
781// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
782
783#endif
784
785// ************************************************************************* //
labelList faceLabels(nFaceLabels)
A packed storage of objects of type <T> using an offset table for access.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
A HashTable to objects of type <T> with a label key.
Definition Map.H:54
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A face is a list of labels corresponding to mesh vertices.
Definition face.H:71
A class for handling file names.
Definition fileName.H:75
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
An objectMap is a pair of labels defining the mapping of an object from another object,...
Definition objectMap.H:57
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
void movePoints(const pointField &newPoints)
Move all points. Incompatible with other topology changes.
void shrink()
Shrink storage (does not remove any elements; just compacts dynamic lists.
bool cellRemoved(const label celli) const
Is cell removed? Considered removed if the cellMap is -2.
label faceZones(const label facei, DynamicList< label > &zones, DynamicList< bool > &flips) const
Get current faceZone(s). Return number of zones.
const DynamicList< face > & faces() const
polyTopoChange(const label nPatches, const bool strict=true)
Construct without mesh. Either specify nPatches or use setNumPatches before trying to make a mesh (ma...
label addPoint(const point &pt, const label masterPointID, const label zoneID, const bool inCell)
Add point. Return new point label.
void removeCell(const label celli, const label mergeCelli)
Remove/merge cell.
void modifyCell(const label celli, const label zoneID, const bool multiZone=false)
Modify zone of cell. Optionally add to zone.
bool pointRemoved(const label pointi) const
Is point removed? Considered removed if point is GREAT.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
void modifyFace(const face &f, const label facei, const label own, const label nei, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip, const bool multiZone=false)
Modify vertices or cell of face.
label pointZones(const label pointi, DynamicList< label > &zones) const
Get current cellZone(s). Return number of zones.
const DynamicList< label > & region() const
void setNumPatches(const label nPatches)
Explicitly set the number of patches if construct-without-mesh used.
void setCapacity(const label nPoints, const label nFaces, const label nCells)
Explicitly pre-size the dynamic storage for expected mesh size for if construct-without-mesh.
label addCell(const label masterPointID, const label masterEdgeID, const label masterFaceID, const label masterCellID, const label zoneID)
Add cell. Return new cell label.
bool faceRemoved(const label facei) const
Is face removed? Considered removed if face is empty.
void addMesh(const polyMesh &mesh, const labelUList &patchMap, const labelUList &pointZoneMap, const labelUList &faceZoneMap, const labelUList &cellZoneMap)
Add all points/faces/cells of mesh. Additional offset for patch or zone ids.
void removePoint(const label pointi, const label mergePointi)
Remove/merge point.
void removeFace(const label facei, const label mergeFacei)
Remove/merge face.
void modifyPoint(const label pointi, const point &pt, const label zoneID, const bool inCell, const bool multiZone=false)
Modify coordinate.
const DynamicList< label > & faceOwner() const
label addFace(const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Add face to cells. Return new face label.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const labelUList &patchMap, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
ClassName("polyTopoChange")
Runtime type information.
autoPtr< mapPolyMesh > makeMesh(autoPtr< Type > &newMesh, const IOobject &io, const polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Create new mesh with old mesh patches. Additional dictionaries.
const DynamicList< point > & points() const
Points. Shrunk after constructing mesh (or calling of compact()).
void clear()
Clear all storage.
const DynamicList< label > & faceNeighbour() const
autoPtr< mapPolyMesh > makeMesh(autoPtr< Type > &newMesh, const IOobject &io, const polyMesh &mesh, const labelUList &patchMap, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Create new mesh with old mesh patches. Additional dictionaries.
label cellZones(const label celli, DynamicList< label > &zones) const
Get current cellZone(s). Return number of zones.
Cell-face mesh analysis engine.
A virtual base class for topological actions.
Definition topoAction.H:48
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition className.H:74
faceListList boundary
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
const auto & io
label nPoints
const labelIOList & zoneIDs
Definition correctPhi.H:59
Namespace for OpenFOAM.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition HashSet.H:85
vector point
Point is a vector.
Definition point.H:37
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
labelList f(nPoints)
label nPatches