boundaryCutter.C
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) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "boundaryCutter.H"
30 #include "polyMesh.H"
31 #include "polyTopoChange.H"
32 #include "polyAddCell.H"
33 #include "polyAddFace.H"
34 #include "polyAddPoint.H"
35 #include "polyModifyFace.H"
36 #include "polyModifyPoint.H"
37 #include "mapPolyMesh.H"
38 #include "meshTools.H"
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44  defineTypeNameAndDebug(boundaryCutter, 0);
45 }
46 
47 
48 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
49 
50 void Foam::boundaryCutter::getFaceInfo
51 (
52  const label facei,
53  label& patchID,
54  label& zoneID,
55  label& zoneFlip
56 ) const
57 {
58  patchID = -1;
59 
60  if (!mesh_.isInternalFace(facei))
61  {
62  patchID = mesh_.boundaryMesh().whichPatch(facei);
63  }
64 
65  zoneID = mesh_.faceZones().whichZone(facei);
66 
67  zoneFlip = false;
68 
69  if (zoneID >= 0)
70  {
71  const faceZone& fZone = mesh_.faceZones()[zoneID];
72 
73  zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
74  }
75 }
76 
77 
78 // Adds additional vertices (from edge cutting) to face. Used for faces which
79 // are not split but still might use edge that has been cut.
80 Foam::face Foam::boundaryCutter::addEdgeCutsToFace
81 (
82  const label facei,
83  const Map<labelList>& edgeToAddedPoints
84 ) const
85 {
86  const edgeList& edges = mesh_.edges();
87  const face& f = mesh_.faces()[facei];
88  const labelList& fEdges = mesh_.faceEdges()[facei];
89 
90  // Storage for face
91  DynamicList<label> newFace(2 * f.size());
92 
93  forAll(f, fp)
94  {
95  // Duplicate face vertex .
96  newFace.append(f[fp]);
97 
98  // Check if edge has been cut.
99  label v1 = f.nextLabel(fp);
100 
101  label edgeI = meshTools::findEdge(edges, fEdges, f[fp], v1);
102 
103  const auto fnd = edgeToAddedPoints.cfind(edgeI);
104 
105  if (fnd.found())
106  {
107  // edge has been cut. Introduce new vertices. Check order.
108  const labelList& addedPoints = fnd();
109 
110  if (edges[edgeI].start() == f[fp])
111  {
112  // Introduce in same order.
113  forAll(addedPoints, i)
114  {
115  newFace.append(addedPoints[i]);
116  }
117  }
118  else
119  {
120  // Introduce in opposite order.
121  forAllReverse(addedPoints, i)
122  {
123  newFace.append(addedPoints[i]);
124  }
125  }
126  }
127  }
128 
129  face returnFace;
130  returnFace.transfer(newFace);
131 
132  if (debug)
133  {
134  Pout<< "addEdgeCutsToFace:" << nl
135  << " from : " << f << nl
136  << " to : " << returnFace << endl;
137  }
138 
139  return returnFace;
140 }
141 
142 
143 void Foam::boundaryCutter::addFace
144 (
145  const label facei,
146  const face& newFace,
147 
148  bool& modifiedFace, // have we already 'used' facei
149  polyTopoChange& meshMod
150 ) const
151 {
152  // Information about old face
153  label patchID, zoneID, zoneFlip;
154  getFaceInfo(facei, patchID, zoneID, zoneFlip);
155  label own = mesh_.faceOwner()[facei];
156  label masterPoint = mesh_.faces()[facei][0];
157 
158  if (!modifiedFace)
159  {
160  meshMod.setAction
161  (
162  polyModifyFace
163  (
164  newFace, // face
165  facei,
166  own, // owner
167  -1, // neighbour
168  false, // flux flip
169  patchID, // patch for face
170  false, // remove from zone
171  zoneID, // zone for face
172  zoneFlip // face zone flip
173  )
174  );
175 
176  modifiedFace = true;
177  }
178  else
179  {
180  meshMod.setAction
181  (
182  polyAddFace
183  (
184  newFace, // face
185  own, // owner
186  -1, // neighbour
187  masterPoint, // master point
188  -1, // master edge
189  -1, // master face for addition
190  false, // flux flip
191  patchID, // patch for face
192  zoneID, // zone for face
193  zoneFlip // face zone flip
194  )
195  );
196  }
197 }
198 
199 
200 
201 // Splits a face using the cut edges and modified points
202 bool Foam::boundaryCutter::splitFace
203 (
204  const label facei,
205  const Map<point>& pointToPos,
206  const Map<labelList>& edgeToAddedPoints,
207  polyTopoChange& meshMod
208 ) const
209 {
210  const edgeList& edges = mesh_.edges();
211  const face& f = mesh_.faces()[facei];
212  const labelList& fEdges = mesh_.faceEdges()[facei];
213 
214  // Count number of split edges and total number of splits.
215  label nSplitEdges = 0;
216  label nModPoints = 0;
217  label nTotalSplits = 0;
218 
219  forAll(f, fp)
220  {
221  if (pointToPos.found(f[fp]))
222  {
223  nModPoints++;
224  nTotalSplits++;
225  }
226 
227  // Check if edge has been cut.
228  label nextV = f.nextLabel(fp);
229 
230  label edgeI = meshTools::findEdge(edges, fEdges, f[fp], nextV);
231 
232  const auto fnd = edgeToAddedPoints.cfind(edgeI);
233 
234  if (fnd.found())
235  {
236  nSplitEdges++;
237  nTotalSplits += fnd().size();
238  }
239  }
240 
241  if (debug)
242  {
243  Pout<< "Face:" << facei
244  << " nModPoints:" << nModPoints
245  << " nSplitEdges:" << nSplitEdges
246  << " nTotalSplits:" << nTotalSplits << endl;
247  }
248 
249  if (nSplitEdges == 0 && nModPoints == 0)
250  {
252  << " nSplitEdges:" << nSplitEdges
253  << " nTotalSplits:" << nTotalSplits
254  << abort(FatalError);
255  return false;
256  }
257  else if (nSplitEdges + nModPoints == 1)
258  {
259  // single or multiple cuts on a single edge or single modified point
260  // Don't cut and let caller handle this.
261  Warning << "Face " << facei << " has only one edge cut " << endl;
262  return false;
263  }
264  else
265  {
266  // So guaranteed to have two edges cut or points modified. Split face:
267  // - find starting cut
268  // - walk to next cut. Make face
269  // - loop until face done.
270 
271  // Information about old face
272  label patchID, zoneID, zoneFlip;
273  getFaceInfo(facei, patchID, zoneID, zoneFlip);
274 
275  // Get face with new points on cut edges for ease of looping
276  face extendedFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
277 
278  // Find first added point. This is the starting vertex for splitting.
279  label startFp = -1;
280 
281  forAll(extendedFace, fp)
282  {
283  if (extendedFace[fp] >= mesh_.nPoints())
284  {
285  startFp = fp;
286  break;
287  }
288  }
289 
290  if (startFp == -1)
291  {
292  // No added point. Maybe there is a modified point?
293  forAll(extendedFace, fp)
294  {
295  if (pointToPos.found(extendedFace[fp]))
296  {
297  startFp = fp;
298  break;
299  }
300  }
301  }
302 
303  if (startFp == -1)
304  {
306  << "Problem" << abort(FatalError);
307  }
308 
309  // Have we already modified existing face (first face gets done
310  // as modification; all following ones as polyAddFace)
311  bool modifiedFace = false;
312 
313  // Example face:
314  // +--+
315  // / |
316  // / |
317  // + +
318  // \ |
319  // \ |
320  // +--+
321  //
322  // Needs to get split into:
323  // - three 'side' faces a,b,c
324  // - one middle face d
325  // +--+
326  // /|\A|
327  // / | \|
328  // + C|D +
329  // \ | /|
330  // \|/B|
331  // +--+
332 
333 
334  // Storage for new face
335  DynamicList<label> newFace(extendedFace.size());
336 
337  label fp = startFp;
338 
339  forAll(extendedFace, i)
340  {
341  label pointi = extendedFace[fp];
342 
343  newFace.append(pointi);
344 
345  if
346  (
347  newFace.size() > 2
348  && (
349  pointi >= mesh_.nPoints()
350  || pointToPos.found(pointi)
351  )
352  )
353  {
354  // Enough vertices to create a face from.
355  face tmpFace;
356  tmpFace.transfer(newFace);
357 
358  // Add face tmpFace
359  addFace(facei, tmpFace, modifiedFace, meshMod);
360 
361  // Starting point is also the starting point for the new face
362  newFace.append(extendedFace[startFp]);
363  newFace.append(extendedFace[fp]);
364  }
365 
366  fp = (fp+1) % extendedFace.size();
367  }
368 
369  // Check final face.
370  if (newFace.size() > 2)
371  {
372  // Enough vertices to create a face from.
373  face tmpFace;
374  tmpFace.transfer(newFace);
375 
376  // Add face tmpFace
377  addFace(facei, tmpFace, modifiedFace, meshMod);
378  }
379 
380  // Split something
381  return true;
382  }
383 }
384 
385 
386 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
387 
388 // Construct from components
389 Foam::boundaryCutter::boundaryCutter(const polyMesh& mesh)
390 :
391  mesh_(mesh),
392  edgeAddedPoints_(),
393  faceAddedPoint_()
394 {}
395 
396 
397 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
398 
400 {}
401 
402 
403 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
404 
406 (
407  const Map<point>& pointToPos,
408  const Map<List<point>>& edgeToCuts,
409  const Map<labelPair>& faceToSplit,
410  const Map<point>& faceToFeaturePoint,
411  polyTopoChange& meshMod
412 )
413 {
414  // Clear and size maps here since mesh size will change.
415  edgeAddedPoints_.clear();
416 
417  faceAddedPoint_.clear();
418  faceAddedPoint_.resize(faceToFeaturePoint.size());
419 
420 
421  //
422  // Points that just need to be moved
423  // Note: could just as well be handled outside of setRefinement.
424  //
425 
426  forAllConstIters(pointToPos, iter)
427  {
428  meshMod.setAction
429  (
431  (
432  iter.key(), // point
433  iter.val(), // position
434  false, // no zone
435  -1, // zone for point
436  true // supports a cell
437  )
438  );
439  }
440 
441 
442  //
443  // Add new points along cut edges.
444  //
445 
446  // Map from edge label to sorted list of points
447  Map<labelList> edgeToAddedPoints(edgeToCuts.size());
448 
449  forAllConstIters(edgeToCuts, iter)
450  {
451  const label edgeI = iter.key();
452  const List<point>& cuts = iter.val();
453 
454  const edge& e = mesh_.edges()[edgeI];
455 
456  // Sorted (from start to end) list of cuts on edge
457 
458  forAll(cuts, cutI)
459  {
460  // point on feature to move to
461  const point& featurePoint = cuts[cutI];
462 
463  label addedPointi =
464  meshMod.setAction
465  (
467  (
468  featurePoint, // point
469  e.start(), // master point
470  -1, // zone for point
471  true // supports a cell
472  )
473  );
474 
475  auto fnd = edgeToAddedPoints.find(edgeI);
476 
477  if (fnd.found())
478  {
479  labelList& addedPoints = fnd();
480 
481  label sz = addedPoints.size();
482  addedPoints.setSize(sz+1);
483  addedPoints[sz] = addedPointi;
484  }
485  else
486  {
487  edgeToAddedPoints.insert(edgeI, labelList(1, addedPointi));
488  }
489 
490  if (debug)
491  {
492  Pout<< "Added point " << addedPointi << " for edge " << edgeI
493  << " with cuts:" << edgeToAddedPoints[edgeI] << endl;
494  }
495  }
496  }
497 
498 
499  //
500  // Introduce feature points.
501  //
502 
503  forAllConstIters(faceToFeaturePoint, iter)
504  {
505  const label facei = iter.key();
506 
507  const face& f = mesh_.faces()[facei];
508 
509  if (faceToSplit.found(facei))
510  {
512  << "Face " << facei << " vertices " << f
513  << " is both marked for face-centre decomposition and"
514  << " diagonal splitting."
515  << abort(FatalError);
516  }
517 
518  if (mesh_.isInternalFace(facei))
519  {
521  << "Face " << facei << " vertices " << f
522  << " is not an external face. Cannot split it"
523  << abort(FatalError);
524  }
525 
526  label addedPointi =
527  meshMod.setAction
528  (
530  (
531  iter.val(), // point
532  f[0], // master point
533  -1, // zone for point
534  true // supports a cell
535  )
536  );
537 
538  faceAddedPoint_.insert(facei, addedPointi);
539 
540  if (debug)
541  {
542  Pout<< "Added point " << addedPointi << " for feature point "
543  << iter.val() << " on face " << facei << " with centre "
544  << mesh_.faceCentres()[facei] << endl;
545  }
546  }
547 
548 
549  //
550  // Split or retriangulate faces
551  //
552 
553 
554  // Maintain whether face has been updated (for -split edges
555  // -new owner/neighbour)
556  boolList faceUptodate(mesh_.nFaces(), false);
557 
558 
559  // Triangulate faces containing feature points
560  forAllConstIters(faceAddedPoint_, iter)
561  {
562  const label facei = iter.key();
563  const label addedPointi = iter.val();
564 
565  // Get face with new points on cut edges.
566  face newFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
567 
568  // Information about old face
569  label patchID, zoneID, zoneFlip;
570  getFaceInfo(facei, patchID, zoneID, zoneFlip);
571  label own = mesh_.faceOwner()[facei];
572  label masterPoint = mesh_.faces()[facei][0];
573 
574  // Triangulate face around mid point
575 
576  face tri(3);
577 
578  forAll(newFace, fp)
579  {
580  label nextV = newFace.nextLabel(fp);
581 
582  tri[0] = newFace[fp];
583  tri[1] = nextV;
584  tri[2] = addedPointi;
585 
586  if (fp == 0)
587  {
588  // Modify the existing face.
589  meshMod.setAction
590  (
592  (
593  tri, // face
594  facei,
595  own, // owner
596  -1, // neighbour
597  false, // flux flip
598  patchID, // patch for face
599  false, // remove from zone
600  zoneID, // zone for face
601  zoneFlip // face zone flip
602  )
603  );
604  }
605  else
606  {
607  // Add additional faces
608  meshMod.setAction
609  (
611  (
612  tri, // face
613  own, // owner
614  -1, // neighbour
615  masterPoint, // master point
616  -1, // master edge
617  -1, // master face for addition
618  false, // flux flip
619  patchID, // patch for face
620  zoneID, // zone for face
621  zoneFlip // face zone flip
622  )
623  );
624  }
625  }
626 
627  faceUptodate[facei] = true;
628  }
629 
630 
631  // Diagonally split faces
632  forAllConstIters(faceToSplit, iter)
633  {
634  const label facei = iter.key();
635 
636  const face& f = mesh_.faces()[facei];
637 
638  if (faceAddedPoint_.found(facei))
639  {
641  << "Face " << facei << " vertices " << f
642  << " is both marked for face-centre decomposition and"
643  << " diagonal splitting."
644  << abort(FatalError);
645  }
646 
647 
648  // Get face with new points on cut edges.
649  face newFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
650 
651  // Information about old face
652  label patchID, zoneID, zoneFlip;
653  getFaceInfo(facei, patchID, zoneID, zoneFlip);
654  label own = mesh_.faceOwner()[facei];
655  label masterPoint = mesh_.faces()[facei][0];
656 
657  // Split face from one side of diagonal to other.
658  const labelPair& diag = iter.val();
659 
660  label fp0 = newFace.find(f[diag[0]]);
661  label fp1 = newFace.find(f[diag[1]]);
662 
663  if (fp0 == -1 || fp1 == -1 || fp0 == fp1)
664  {
666  << "Problem : Face " << facei << " vertices " << f
667  << " newFace:" << newFace << " diagonal:" << f[diag[0]]
668  << ' ' << f[diag[1]]
669  << abort(FatalError);
670  }
671 
672  // Replace existing face by newFace from fp0 to fp1 and add new one
673  // from fp1 to fp0.
674 
675  DynamicList<label> newVerts(newFace.size());
676 
677  // Get vertices from fp0 to (and including) fp1
678  label fp = fp0;
679 
680  do
681  {
682  newVerts.append(newFace[fp]);
683 
684  fp = (fp == newFace.size()-1 ? 0 : fp+1);
685 
686  } while (fp != fp1);
687 
688  newVerts.append(newFace[fp1]);
689 
690 
691  // Modify the existing face.
692  meshMod.setAction
693  (
695  (
696  face(newVerts.shrink()), // face
697  facei,
698  own, // owner
699  -1, // neighbour
700  false, // flux flip
701  patchID, // patch for face
702  false, // remove from zone
703  zoneID, // zone for face
704  zoneFlip // face zone flip
705  )
706  );
707 
708 
709  newVerts.clear();
710 
711  // Get vertices from fp1 to (and including) fp0
712 
713  do
714  {
715  newVerts.append(newFace[fp]);
716 
717  fp = (fp == newFace.size()-1 ? 0 : fp+1);
718 
719  } while (fp != fp0);
720 
721  newVerts.append(newFace[fp0]);
722 
723  // Add additional face
724  meshMod.setAction
725  (
727  (
728  face(newVerts.shrink()), // face
729  own, // owner
730  -1, // neighbour
731  masterPoint, // master point
732  -1, // master edge
733  -1, // master face for addition
734  false, // flux flip
735  patchID, // patch for face
736  zoneID, // zone for face
737  zoneFlip // face zone flip
738  )
739  );
740 
741  faceUptodate[facei] = true;
742  }
743 
744 
745  // Split external faces without feature point but using cut edges.
746  // Does right handed walk but not really.
747  forAllConstIters(edgeToAddedPoints, iter)
748  {
749  const label edgeI = iter.key();
750 
751  const labelList& eFaces = mesh_.edgeFaces()[edgeI];
752 
753  forAll(eFaces, i)
754  {
755  label facei = eFaces[i];
756 
757  if (!faceUptodate[facei] && !mesh_.isInternalFace(facei))
758  {
759  // Is external face so split
760  if (splitFace(facei, pointToPos, edgeToAddedPoints, meshMod))
761  {
762  // Successful split
763  faceUptodate[facei] = true;
764  }
765  }
766  }
767  }
768 
769 
770  // Add cut edges (but don't split) any other faces using any cut edge.
771  // These can be external faces where splitFace hasn't cut them or
772  // internal faces.
773  forAllConstIters(edgeToAddedPoints, iter)
774  {
775  const label edgeI = iter.key();
776 
777  const labelList& eFaces = mesh_.edgeFaces()[edgeI];
778 
779  forAll(eFaces, i)
780  {
781  label facei = eFaces[i];
782 
783  if (!faceUptodate[facei])
784  {
785  // Renumber face to include split edges.
786  face newFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
787 
788  const label own = mesh_.faceOwner()[facei];
789 
790  label nei = -1;
791 
792  if (mesh_.isInternalFace(facei))
793  {
794  nei = mesh_.faceNeighbour()[facei];
795  }
796 
797  label patchID, zoneID, zoneFlip;
798  getFaceInfo(facei, patchID, zoneID, zoneFlip);
799 
800  meshMod.setAction
801  (
803  (
804  newFace, // modified face
805  facei, // label of face being modified
806  own, // owner
807  nei, // neighbour
808  false, // face flip
809  patchID, // patch for face
810  false, // remove from zone
811  zoneID, // zone for face
812  zoneFlip // face flip in zone
813  )
814  );
815 
816  faceUptodate[facei] = true;
817  }
818  }
819  }
820 
821  // Convert edge to points storage from edge labels (not preserved)
822  // to point labels
823  edgeAddedPoints_.resize(edgeToCuts.size());
824 
825  forAllConstIters(edgeToAddedPoints, iter)
826  {
827  edgeAddedPoints_.insert(mesh_.edges()[iter.key()], iter.val());
828  }
829 }
830 
831 
833 {
834  // Update stored labels for mesh change.
835 
836  //
837  // Do faceToAddedPoint
838  //
839 
840  {
841  // Create copy since we're deleting entries.
842  Map<label> newAddedPoints(faceAddedPoint_.size());
843 
844  forAllConstIters(faceAddedPoint_, iter)
845  {
846  const label oldFacei = iter.key();
847  const label oldPointi = iter.val();
848 
849  const label newFacei = morphMap.reverseFaceMap()[oldFacei];
850  const label newPointi = morphMap.reversePointMap()[oldPointi];
851 
852  if (newFacei >= 0 && newPointi >= 0)
853  {
854  newAddedPoints.insert(newFacei, newPointi);
855  }
856  }
857 
858  // Copy
859  faceAddedPoint_.transfer(newAddedPoints);
860  }
861 
862 
863  //
864  // Do edgeToAddedPoints
865  //
866 
867 
868  {
869  // Create copy since we're deleting entries
870  EdgeMap<labelList> newEdgeAddedPoints(edgeAddedPoints_.size());
871 
872  forAllConstIters(edgeAddedPoints_, iter)
873  {
874  const edge& e = iter.key();
875  const labelList& addedPoints = iter.val();
876 
877  const label newStart = morphMap.reversePointMap()[e.start()];
878  const label newEnd = morphMap.reversePointMap()[e.end()];
879 
880  if (newStart >= 0 && newEnd >= 0)
881  {
882  labelList newAddedPoints(addedPoints.size());
883  label newI = 0;
884 
885  forAll(addedPoints, i)
886  {
887  label newAddedPointi =
888  morphMap.reversePointMap()[addedPoints[i]];
889 
890  if (newAddedPointi >= 0)
891  {
892  newAddedPoints[newI++] = newAddedPointi;
893  }
894  }
895  if (newI > 0)
896  {
897  newAddedPoints.setSize(newI);
898 
899  edge newE = edge(newStart, newEnd);
900 
901  newEdgeAddedPoints.insert(newE, newAddedPoints);
902  }
903  }
904  }
905 
906  // Copy
907  edgeAddedPoints_.transfer(newEdgeAddedPoints);
908  }
909 }
910 
911 
912 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:74
meshTools.H
Foam::boundaryCutter::~boundaryCutter
~boundaryCutter()
Destructor.
Definition: boundaryCutter.C:399
Foam::edgeList
List< edge > edgeList
A List of edges.
Definition: edgeList.H:63
Foam::boundaryCutter::setRefinement
void setRefinement(const Map< point > &pointToPos, const Map< List< point >> &edgeToCuts, const Map< labelPair > &faceToSplit, const Map< point > &faceToFeaturePoint, polyTopoChange &meshMod)
Do actual cutting with cut description. Inserts mesh changes.
Definition: boundaryCutter.C:406
Foam::DynamicList< label >
Foam::diag
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
Definition: pointPatchFieldFunctions.H:287
polyAddFace.H
mapPolyMesh.H
Foam::Warning
messageStream Warning
polyTopoChange.H
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:100
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:63
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: HashTableFwd.H:46
Foam::polyModifyFace
Class describing modification of a face.
Definition: polyModifyFace.H:50
Foam::polyModifyPoint
Class describing modification of a point.
Definition: polyModifyPoint.H:49
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:435
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
boundaryCutter.H
Foam::Pout
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
Foam::polyMesh::faceZones
const faceZoneMesh & faceZones() const
Return face zone mesh.
Definition: polyMesh.H:477
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::meshTools::findEdge
label findEdge(const edgeList &edges, const labelList &candidates, const label v0, const label v1)
Return edge among candidates that uses the two vertices.
Definition: meshTools.C:359
polyModifyPoint.H
Foam::DynamicList::append
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
Definition: DynamicListI.H:472
patchID
label patchID
Definition: boundaryProcessorFaPatchPoints.H:5
Foam::List::transfer
void transfer(List< T > &list)
Definition: List.C:436
Foam::polyBoundaryMesh::whichPatch
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Definition: polyBoundaryMesh.C:805
polyAddPoint.H
Foam::ZoneMesh::whichZone
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
Definition: ZoneMesh.C:315
newPointi
label newPointi
Definition: readKivaGrid.H:496
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
zoneID
const labelIOList & zoneID
Definition: interpolatedFaces.H:22
Foam::boundaryCutter::updateMesh
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: boundaryCutter.C:832
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:137
polyModifyFace.H
Foam::mapPolyMesh::reverseFaceMap
const labelList & reverseFaceMap() const
Reverse face map.
Definition: mapPolyMesh.H:500
polyAddCell.H
Foam::EdgeMap
Map from edge (expressed as its endpoints) to value. For easier forward declaration it is currently i...
Definition: EdgeMap.H:51
Foam::face::nextLabel
label nextLabel(const label i) const
Next vertex on face.
Definition: faceI.H:150
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::polyTopoChange::setAction
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
Definition: polyTopoChange.C:2458
Foam::nl
constexpr char nl
Definition: Ostream.H:372
Foam::Pair
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:54
forAllConstIters
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
f
labelList f(nPoints)
Foam::mapPolyMesh::reversePointMap
const labelList & reversePointMap() const
Reverse point map.
Definition: mapPolyMesh.H:468
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:102
Foam::primitiveMesh::isInternalFace
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
Definition: primitiveMeshI.H:102
Foam::start
label ListType::const_reference const label start
Definition: ListOps.H:408
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::polyAddPoint
Class containing data for point addition.
Definition: polyAddPoint.H:49
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
forAllReverse
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Definition: stdFoam.H:303
Foam::polyAddFace
A face addition data class. A face can be inflated either from a point or from another face and can e...
Definition: polyAddFace.H:53
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:74
Foam::List::setSize
void setSize(const label newSize)
Alias for resize(const label)
Definition: ListI.H:146
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)