localPointRegion.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 | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "localPointRegion.H"
27 #include "syncTools.H"
28 #include "polyMesh.H"
29 #include "mapPolyMesh.H"
30 #include "globalIndex.H"
31 #include "indirectPrimitivePatch.H"
32 #include "dummyTransform.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
39 defineTypeNameAndDebug(localPointRegion, 0);
40 
41 // Reduction class to get minimum value over face.
43 {
44 public:
45 
46  void operator()(face& x, const face& y) const
47  {
48  if (x.size())
49  {
50  label j = 0;
51  forAll(x, i)
52  {
53  x[i] = min(x[i], y[j]);
54 
55  j = y.rcIndex(j);
56  }
57  }
58  }
59 };
60 
61 }
62 
63 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
64 
65 // Are two lists identical either in forward or in reverse order.
67 (
68  const face& f0,
69  const face& f1,
70  const bool forward
71 )
72 {
73  if (f0.size() != f1.size())
74  {
75  return false;
76  }
77 
78  label fp1 = findIndex(f1, f0[0]);
79 
80  if (fp1 == -1)
81  {
82  return false;
83  }
84 
85  forAll(f0, fp0)
86  {
87  if (f0[fp0] != f1[fp1])
88  {
89  return false;
90  }
91 
92  if (forward)
93  {
94  fp1 = f1.fcIndex(fp1);
95  }
96  else
97  {
98  fp1 = f1.rcIndex(fp1);
99  }
100  }
101  return true;
102 }
103 
104 
105 // Count regions per point
107 (
108  const polyMesh& mesh,
109  const boolList& candidatePoint,
110  const Map<label>& candidateFace,
111  faceList& minRegion
112 )
113 {
114  // Almost all will have only one so only
115  // populate Map if more than one.
116  labelList minPointRegion(mesh.nPoints(), -1);
117  // From global point to local (multi-region) point numbering
118  meshPointMap_.resize(candidateFace.size()/100);
119  // From local (multi-region) point to regions
120  DynamicList<labelList> pointRegions(meshPointMap_.size());
121 
122  // From faces with any duplicated point on it to local face
123  meshFaceMap_.resize(meshPointMap_.size());
124 
125  forAllConstIter(Map<label>, candidateFace, iter)
126  {
127  label faceI = iter.key();
128 
129  if (!mesh.isInternalFace(faceI))
130  {
131  const face& f = mesh.faces()[faceI];
132 
133  if (minRegion[faceI].empty())
134  {
136  << "Face from candidateFace without minRegion set." << endl
137  << "Face:" << faceI << " fc:" << mesh.faceCentres()[faceI]
138  << " verts:" << f << abort(FatalError);
139  }
140 
141  forAll(f, fp)
142  {
143  label pointI = f[fp];
144 
145  // Even points which were not candidates for splitting might
146  // be on multiple baffles that are being split so check.
147 
148  if (candidatePoint[pointI])
149  {
150  label region = minRegion[faceI][fp];
151 
152  if (minPointRegion[pointI] == -1)
153  {
154  minPointRegion[pointI] = region;
155  }
156  else if (minPointRegion[pointI] != region)
157  {
158  // Multiple regions for this point. Add.
159  Map<label>::iterator iter = meshPointMap_.find(pointI);
160  if (iter != meshPointMap_.end())
161  {
162  labelList& regions = pointRegions[iter()];
163  if (findIndex(regions, region) == -1)
164  {
165  label sz = regions.size();
166  regions.setSize(sz+1);
167  regions[sz] = region;
168  }
169  }
170  else
171  {
172  label localPointI = meshPointMap_.size();
173  meshPointMap_.insert(pointI, localPointI);
174  labelList regions(2);
175  regions[0] = minPointRegion[pointI];
176  regions[1] = region;
177  pointRegions.append(regions);
178  }
179 
180  label meshFaceMapI = meshFaceMap_.size();
181  meshFaceMap_.insert(faceI, meshFaceMapI);
182  }
183  }
184  }
185  }
186  }
187  minPointRegion.clear();
188 
189  // Add internal faces that use any duplicated point. Can only have one
190  // region!
191  forAllConstIter(Map<label>, candidateFace, iter)
192  {
193  label faceI = iter.key();
194 
195  if (mesh.isInternalFace(faceI))
196  {
197  const face& f = mesh.faces()[faceI];
198 
199  forAll(f, fp)
200  {
201  // Note: candidatePoint test not really necessary but
202  // speeds up rejection.
203  if (candidatePoint[f[fp]] && meshPointMap_.found(f[fp]))
204  {
205  label meshFaceMapI = meshFaceMap_.size();
206  meshFaceMap_.insert(faceI, meshFaceMapI);
207  }
208  }
209  }
210  }
211 
212 
213  // Transfer to member data
214  pointRegions.shrink();
215  pointRegions_.setSize(pointRegions.size());
216  forAll(pointRegions, i)
217  {
218  pointRegions_[i].transfer(pointRegions[i]);
219  }
220 
221  // Compact minRegion
222  faceRegions_.setSize(meshFaceMap_.size());
223  forAllConstIter(Map<label>, meshFaceMap_, iter)
224  {
225  faceRegions_[iter()].labelList::transfer(minRegion[iter.key()]);
226 
228  //{
229  // label faceI = iter.key();
230  // const face& f = mesh.faces()[faceI];
231  // Pout<< "Face:" << faceI << " fc:" << mesh.faceCentres()[faceI]
232  // << " verts:" << f << endl;
233  // forAll(f, fp)
234  // {
235  // Pout<< " " << f[fp] << " min:" << faceRegions_[iter()][fp]
236  // << endl;
237  // }
238  // Pout<< endl;
239  //}
240  }
241 
242  // Compact region numbering
243  // ? TBD.
244 }
245 
246 
248 (
249  const polyMesh& mesh,
250  const labelPairList& baffles,
251  boolList& candidatePoint
252 )
253 {
254  label nBnd = mesh.nFaces()-mesh.nInternalFaces();
255  const labelList& faceOwner = mesh.faceOwner();
256  const labelList& faceNeighbour = mesh.faceNeighbour();
257 
258 
259  syncTools::syncPointList
260  (
261  mesh,
262  candidatePoint,
263  orEqOp<bool>(),
264  false // nullValue
265  );
266 
267 
268  // Mark any face/boundaryFace/cell with a point on a candidate point.
269  // - candidateFace does not necessary have to be a baffle!
270  // - candidateFace is synchronised (since candidatePoint is)
271  Map<label> candidateFace(2*nBnd);
272  label candidateFaceI = 0;
273 
274  Map<label> candidateCell(nBnd);
275  label candidateCellI = 0;
276 
277  forAll(mesh.faces(), faceI)
278  {
279  const face& f = mesh.faces()[faceI];
280 
281  forAll(f, fp)
282  {
283  if (candidatePoint[f[fp]])
284  {
285  // Mark face
286  if (candidateFace.insert(faceI, candidateFaceI))
287  {
288  candidateFaceI++;
289  }
290 
291  // Mark cells
292  if (candidateCell.insert(faceOwner[faceI], candidateCellI))
293  {
294  candidateCellI++;
295  }
296 
297  if (mesh.isInternalFace(faceI))
298  {
299  label nei = faceNeighbour[faceI];
300  if (candidateCell.insert(nei, candidateCellI))
301  {
302  candidateCellI++;
303  }
304  }
305 
306  break;
307  }
308  }
309  }
310 
311 
312 
313  // Get global indices for cells
314  globalIndex globalCells(mesh.nCells());
315 
316 
317  // Determine for every candidate face per point the minimum region
318  // (global cell) it is connected to. (candidateFaces are the
319  // only ones using a
320  // candidate point so the only ones that can be affected)
321  faceList minRegion(mesh.nFaces());
322  forAllConstIter(Map<label>, candidateFace, iter)
323  {
324  label faceI = iter.key();
325  const face& f = mesh.faces()[faceI];
326 
327  if (mesh.isInternalFace(faceI))
328  {
329  label globOwn = globalCells.toGlobal(faceOwner[faceI]);
330  label globNei = globalCells.toGlobal(faceNeighbour[faceI]);
331  minRegion[faceI].setSize(f.size(), min(globOwn, globNei));
332  }
333  else
334  {
335  label globOwn = globalCells.toGlobal(faceOwner[faceI]);
336  minRegion[faceI].setSize(f.size(), globOwn);
337  }
338  }
339 
340  // Now minimize over all faces that are connected through internal
341  // faces or through cells. This loop iterates over the max number of
342  // cells connected to a point (=8 for hex mesh)
343 
344  while (true)
345  {
346  // Transport minimum from face across cell
347  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348 
349  Map<label> minPointValue(100);
350  label nChanged = 0;
351  forAllConstIter(Map<label>, candidateCell, iter)
352  {
353  minPointValue.clear();
354 
355  label cellI = iter.key();
356  const cell& cFaces = mesh.cells()[cellI];
357 
358  // Determine minimum per point
359  forAll(cFaces, cFaceI)
360  {
361  label faceI = cFaces[cFaceI];
362 
363  if (minRegion[faceI].size())
364  {
365  const face& f = mesh.faces()[faceI];
366 
367  forAll(f, fp)
368  {
369  label pointI = f[fp];
370  Map<label>::iterator iter = minPointValue.find(pointI);
371 
372  if (iter == minPointValue.end())
373  {
374  minPointValue.insert(pointI, minRegion[faceI][fp]);
375  }
376  else
377  {
378  label currentMin = iter();
379  iter() = min(currentMin, minRegion[faceI][fp]);
380  }
381  }
382  }
383  }
384 
385  // Set face minimum from point minimum
386  forAll(cFaces, cFaceI)
387  {
388  label faceI = cFaces[cFaceI];
389 
390  if (minRegion[faceI].size())
391  {
392  const face& f = mesh.faces()[faceI];
393 
394  forAll(f, fp)
395  {
396  label minVal = minPointValue[f[fp]];
397 
398  if (minVal != minRegion[faceI][fp])
399  {
400  minRegion[faceI][fp] = minVal;
401  nChanged++;
402  }
403  }
404  }
405  }
406  }
407 
408  //Pout<< "nChanged:" << nChanged << endl;
409 
410  if (returnReduce(nChanged, sumOp<label>()) == 0)
411  {
412  break;
413  }
414 
415 
416  // Transport minimum across coupled faces
417  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
418 
419  SubList<face> l
420  (
421  minRegion,
422  mesh.nFaces()-mesh.nInternalFaces(),
423  mesh.nInternalFaces()
424  );
425  syncTools::syncBoundaryFaceList
426  (
427  mesh,
428  l,
429  minEqOpFace(),
430  Foam::dummyTransform() // dummy transformation
431  );
432  forAll(baffles, i)
433  {
434  label f0 = baffles[i].first();
435  label f1 = baffles[i].second();
436  minEqOpFace()(minRegion[f0], minRegion[f1]);
437  minRegion[f1] = minRegion[f0];
438  }
439  }
440 
441 
442  // Count regions per point
443  countPointRegions(mesh, candidatePoint, candidateFace, minRegion);
444  minRegion.clear();
445 
446 
448  //forAllConstIter(Map<label>, meshPointMap_, iter)
449  //{
450  // Pout<< "point:" << iter.key()
451  // << " coord:" << mesh.points()[iter.key()]
452  // << " regions:" << pointRegions_[iter()] << endl;
453  //}
454 }
455 
456 
457 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
458 
460 :
461  //nRegions_(0),
462  meshPointMap_(0),
463  pointRegions_(0),
464  meshFaceMap_(0),
465  faceRegions_(0)
466 {
467  const polyBoundaryMesh& patches = mesh.boundaryMesh();
468 
469  // Get any point on the outside which is on a non-coupled boundary
470  boolList candidatePoint(mesh.nPoints(), false);
471 
472  forAll(patches, patchI)
473  {
474  if (!patches[patchI].coupled())
475  {
476  const polyPatch& pp = patches[patchI];
477 
478  forAll(pp.meshPoints(), i)
479  {
480  candidatePoint[pp.meshPoints()[i]] = true;
481  }
482  }
483  }
484 
485  calcPointRegions(mesh, labelPairList(0), candidatePoint);
486 }
487 
488 
490 (
491  const polyMesh& mesh,
492  const labelList& candidatePoints
493 )
494 :
495  //nRegions_(0),
496  meshPointMap_(0),
497  pointRegions_(0),
498  meshFaceMap_(0),
499  faceRegions_(0)
500 {
501  boolList candidatePoint(mesh.nPoints(), false);
502 
503  forAll(candidatePoints, i)
504  {
505  candidatePoint[candidatePoints[i]] = true;
506  }
507 
508  calcPointRegions(mesh, labelPairList(0), candidatePoint);
509 }
510 
511 
513 (
514  const polyMesh& mesh,
515  const labelPairList& baffles,
516  const labelList& candidatePoints
517 )
518 :
519  //nRegions_(0),
520  meshPointMap_(0),
521  pointRegions_(0),
522  meshFaceMap_(0),
523  faceRegions_(0)
524 {
525  boolList candidatePoint(mesh.nPoints(), false);
526 
527  forAll(candidatePoints, i)
528  {
529  candidatePoint[candidatePoints[i]] = true;
530  }
531 
532  calcPointRegions(mesh, baffles, candidatePoint);
533 }
534 
535 
536 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
537 
538 // Return a list (in allPatch indices) with either -1 or the face label
539 // of the face that uses the same vertices.
541 (
542  const primitiveMesh& mesh,
543  const labelList& boundaryFaces
544 )
545 {
546  // Addressing engine for all boundary faces.
547  indirectPrimitivePatch allPatch
548  (
549  IndirectList<face>(mesh.faces(), boundaryFaces),
550  mesh.points()
551  );
552 
553  labelList duplicateFace(allPatch.size(), -1);
554  label nDuplicateFaces = 0;
555 
556  // Find all duplicate faces.
557  forAll(allPatch, bFaceI)
558  {
559  const face& f = allPatch.localFaces()[bFaceI];
560 
561  // Get faces connected to f[0].
562  // Check whether share all points with f.
563  const labelList& pFaces = allPatch.pointFaces()[f[0]];
564 
565  forAll(pFaces, i)
566  {
567  label otherFaceI = pFaces[i];
568 
569  if (otherFaceI > bFaceI)
570  {
571  const face& otherF = allPatch.localFaces()[otherFaceI];
572 
573  if (isDuplicate(f, otherF, true))
574  {
576  << "Face:" << bFaceI + mesh.nInternalFaces()
577  << " has local points:" << f
578  << " which are in same order as face:"
579  << otherFaceI + mesh.nInternalFaces()
580  << " with local points:" << otherF
581  << abort(FatalError);
582  }
583  else if (isDuplicate(f, otherF, false))
584  {
585  label meshFace0 = bFaceI + mesh.nInternalFaces();
586  label meshFace1 = otherFaceI + mesh.nInternalFaces();
587 
588  if
589  (
590  duplicateFace[bFaceI] != -1
591  || duplicateFace[otherFaceI] != -1
592  )
593  {
595  << "One of two duplicate faces already marked"
596  << " as duplicate." << nl
597  << "This means that three or more faces share"
598  << " the same points and this is illegal." << nl
599  << "Face:" << meshFace0
600  << " with local points:" << f
601  << " which are in same order as face:"
602  << meshFace1
603  << " with local points:" << otherF
604  << abort(FatalError);
605  }
606 
607  duplicateFace[bFaceI] = otherFaceI;
608  duplicateFace[otherFaceI] = bFaceI;
609  nDuplicateFaces++;
610  }
611  }
612  }
613  }
614 
615  return duplicateFace;
616 }
617 
618 
620 (
621  const polyMesh& mesh
622 )
623 {
625 
626  // Faces to test: all boundary faces
627  labelList testFaces
628  (
630  + mesh.nInternalFaces()
631  );
632 
633  // Find correspondencing baffle face (or -1)
634  const labelList duplicateFace(findDuplicateFaces(mesh, testFaces));
635 
636  // Convert into list of coupled face pairs (mesh face labels).
637  DynamicList<labelPair> baffles(testFaces.size());
638 
639  forAll(duplicateFace, i)
640  {
641  label otherFaceI = duplicateFace[i];
642 
643  if (otherFaceI != -1 && i < otherFaceI)
644  {
645  label meshFace0 = testFaces[i];
646  label patch0 = patches.whichPatch(meshFace0);
647  label meshFace1 = testFaces[otherFaceI];
648  label patch1 = patches.whichPatch(meshFace1);
649 
650  // Check for illegal topology. Should normally not happen!
651  if
652  (
653  (patch0 != -1 && isA<processorPolyPatch>(patches[patch0]))
654  || (patch1 != -1 && isA<processorPolyPatch>(patches[patch1]))
655  )
656  {
658  << "One of two duplicate faces is on"
659  << " processorPolyPatch."
660  << "This is not allowed." << nl
661  << "Face:" << meshFace0
662  << " fc:" << mesh.faceCentres()[meshFace0]
663  << " is on patch:" << patches[patch0].name()
664  << nl
665  << "Face:" << meshFace1
666  << " fc:" << mesh.faceCentres()[meshFace1]
667  << " is on patch:" << patches[patch1].name()
668  << abort(FatalError);
669  }
670  else
671  {
672  baffles.append(labelPair(meshFace0, meshFace1));
673  }
674  }
675  }
676  return baffles.shrink();
677 }
678 
679 
681 {
682  {
683  Map<label> newMap(meshFaceMap_.size());
684 
685  forAllConstIter(Map<label>, meshFaceMap_, iter)
686  {
687  label newFaceI = map.reverseFaceMap()[iter.key()];
688 
689  if (newFaceI >= 0)
690  {
691  newMap.insert(newFaceI, iter());
692  }
693  }
694  meshFaceMap_.transfer(newMap);
695  }
696  {
697  Map<label> newMap(meshPointMap_.size());
698 
699  forAllConstIter(Map<label>, meshPointMap_, iter)
700  {
701  label newPointI = map.reversePointMap()[iter.key()];
702 
703  if (newPointI >= 0)
704  {
705  newMap.insert(newPointI, iter());
706  }
707  }
708 
709  meshPointMap_.transfer(newMap);
710  }
711 }
712 
713 
714 // ************************************************************************* //
Foam::localPointRegion::isDuplicate
static bool isDuplicate(const face &f0, const face &f1, const bool forward)
Check if two faces are equal. If forward = false checks f1 in.
Definition: localPointRegion.C:67
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:979
Foam::PrimitivePatch::pointFaces
const labelListList & pointFaces() const
Return point-face addressing.
Definition: PrimitivePatchTemplate.C:352
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:86
Foam::polyBoundaryMesh
Foam::polyBoundaryMesh.
Definition: polyBoundaryMesh.H:60
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::findIndex
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:56
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
mapPolyMesh.H
globalIndex.H
Foam::labelPairList
List< labelPair > labelPairList
List of labelPairs.
Definition: labelPair.H:49
localPointRegion.H
dummyTransform.H
Dummy transform to be used with syncTools.
Foam::Map< label >
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:421
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::localPointRegion::calcPointRegions
void calcPointRegions(const polyMesh &mesh, const labelPairList &baffles, boolList &candidatePoint)
Do all: calculate points that need to be duplicated.
Definition: localPointRegion.C:248
Foam::dummyTransform
Definition: dummyTransform.H:44
polyMesh.H
syncTools.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
pFaces
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
Definition: readKivaGrid.H:235
Foam::localPointRegion::localPointRegion
localPointRegion(const polyMesh &mesh)
Construct from mesh. Assumes all non-coupled boundary points.
Definition: localPointRegion.C:459
Foam::primitiveMesh::nPoints
label nPoints() const
Definition: primitiveMeshI.H:35
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:59
Foam::localPointRegion::countPointRegions
void countPointRegions(const polyMesh &mesh, const boolList &candidatePoint, const Map< label > &candidateFace, faceList &minRegion)
Given minimum cell the points on a face are connected to.
Definition: localPointRegion.C:107
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::IndirectList
A List with indirect addressing.
Definition: IndirectList.H:102
f1
scalar f1
Definition: createFields.H:28
Foam::DynamicList::shrink
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
Definition: DynamicListI.H:258
Foam::orEqOp
Definition: ops.H:82
Foam::identity
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Definition: ListOps.C:104
Foam::FatalError
error FatalError
Foam::primitiveMesh::nInternalFaces
label nInternalFaces() const
Definition: primitiveMeshI.H:52
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::localPointRegion::findDuplicateFaces
static labelList findDuplicateFaces(const primitiveMesh &, const labelList &)
Helper routine to find baffles (two boundary faces using the.
Definition: localPointRegion.C:541
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:63
Foam::DynamicList::append
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Foam::mapPolyMesh::reverseFaceMap
const labelList & reverseFaceMap() const
Reverse face map.
Definition: mapPolyMesh.H:497
Foam::List::setSize
void setSize(const label)
Reset size of List.
Foam::localPointRegion::updateMesh
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: localPointRegion.C:680
Foam::polyMesh::faces
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1004
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::primitiveMesh::nFaces
label nFaces() const
Definition: primitiveMeshI.H:58
Foam::sumOp
Definition: ops.H:162
f
labelList f(nPoints)
Foam::mapPolyMesh::reversePointMap
const labelList & reversePointMap() const
Reverse point map.
Definition: mapPolyMesh.H:465
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:59
Foam::primitiveMesh::faceCentres
const vectorField & faceCentres() const
Definition: primitiveMeshFaceCentresAndAreas.C:130
Foam::List::clear
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:379
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::PrimitivePatch::localFaces
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
Definition: PrimitivePatchTemplate.C:372
patches
patches[0]
Definition: createSingleCellMesh.H:36
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::PrimitivePatch::meshPoints
const labelList & meshPoints() const
Return labelList of mesh points in patch.
Definition: PrimitivePatchTemplate.C:392
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::cell
A cell is defined as a list of faces with extra functionality.
Definition: cell.H:56
Foam::minEqOpFace::operator()
void operator()(face &x, const face &y) const
Definition: localPointRegion.C:46
Foam::labelPair
Pair< label > labelPair
Label pair.
Definition: labelPair.H:48
Foam::minEqOpFace
Definition: localPointRegion.C:42
Foam::localPointRegion::findDuplicateFacePairs
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Definition: localPointRegion.C:620
Foam::globalIndex::toGlobal
label toGlobal(const label i) const
From local to global.
Definition: globalIndexI.H:82
y
scalar y
Definition: LISASMDCalcMethod1.H:14
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79