detectBoundaryLayersFunctions.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh 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 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "detectBoundaryLayers.H"
29 #include "meshSurfacePartitioner.H"
30 #include "helperFunctions.H"
31 #include "polyMeshGenAddressing.H"
32 #include "polyMeshGen2DEngine.H"
33 #include "VRWGraphList.H"
34 
35 #include "labelledPair.H"
36 #include "labelledScalar.H"
37 
38 # ifdef USE_OMP
39 #include <omp.h>
40 # endif
41 
42 //#define DEBUGLayer
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace bndLayerOps
52 {
53 
55 {
57  const label size_;
58 
59 public:
60 
62  :
63  mse_(mse),
64  size_(mse.boundaryFaces().size())
65  {}
66 
67  label size() const
68  {
69  return size_;
70  }
71 
72  void operator()(const label bfI, DynList<label>& neighbourFaces) const
73  {
74  neighbourFaces.clear();
75 
76  const cellListPMG& cells = mse_.cells();
77 
78  const labelList& faceOwner = mse_.faceOwners();
79  const label cellI = faceOwner[bfI];
80  const cell& c = cells[cellI];
81 
82  const VRWGraph& faceEdges = mse_.faceEdges();
83  const VRWGraph& edgeFaces = mse_.edgeFaces();
84 
85  forAllRow(faceEdges, bfI, feI)
86  {
87  const label edgeI = faceEdges(bfI, feI);
88 
89  if( edgeFaces.sizeOfRow(edgeI) == 2 )
90  {
91  label nei = edgeFaces(edgeI, 0);
92 
93  if( nei == bfI )
94  nei = edgeFaces(edgeI, 1);
95 
96  //- faces must not be part of the same cell
97  if( faceOwner[nei] == cellI )
98  continue;
99 
100  //- owner cell of the other face must
101  //- have cellI as its neighbour
102  const cell& neiC = cells[faceOwner[nei]];
103  bool sharedFace(false);
104  forAll(c, fI)
105  {
106  forAll(neiC, fJ)
107  {
108  if( c[fI] == neiC[fJ] )
109  {
110  sharedFace = true;
111  break;
112  }
113  }
114 
115  if( sharedFace )
116  break;
117  }
118 
119  if( sharedFace )
120  neighbourFaces.append(nei);
121  }
122  }
123  }
124 
125  template<class labelListType>
126  void collectGroups
127  (
128  std::map<label, DynList<label> >& neiGroups,
129  const labelListType& elementInGroup,
130  const DynList<label>& localGroupLabel
131  ) const
132  {
133  const polyMeshGen& mesh = mse_.mesh();
134  const faceListPMG& faces = mesh.faces();
135  const cellListPMG& cells = mesh.cells();
136 
137  const edgeList& edges = mse_.edges();
138  const labelList& faceOwner = mse_.faceOwners();
139  const VRWGraph& edgeFaces = mse_.edgeFaces();
140  const Map<label>& otherProc = mse_.otherEdgeFaceAtProc();
141  const Map<label>& globalToLocal =
143 
144  std::map<label, LongList<labelPair> > exchangeData;
145  forAll(mse_.beNeiProcs(), procI)
146  exchangeData[mse_.beNeiProcs()[procI]].clear();
147 
148  forAllConstIter(Map<label>, globalToLocal, it)
149  {
150  const label beI = it();
151 
152  //- combine data if the cell attached to this face has a face
153  //- attached to the inter-processor boundary
154  //- this must hold for boundary layer cells
155  const cell& c = cells[faceOwner[edgeFaces(beI, 0)]];
156 
157  bool validCell(false);
158  forAll(c, fI)
159  {
160  const face& f = faces[c[fI]];
161 
162  forAll(f, eI)
163  {
164  const edge fe = f.faceEdge(eI);
165 
166  if
167  (
168  (fe == edges[beI]) &&
169  (mesh.faceIsInProcPatch(c[fI]) >= 0)
170  )
171  {
172  validCell = true;
173  break;
174  }
175  }
176 
177  if( validCell )
178  break;
179  }
180 
181  if( !validCell )
182  continue;
183 
184  const label groupI = elementInGroup[edgeFaces(beI, 0)];
185 
186  if( groupI < 0 )
187  continue;
188 
189  const label lgI = localGroupLabel[groupI];
190  exchangeData[otherProc[beI]].append(labelPair(it.key(), lgI));
191  }
192 
193  LongList<labelPair> receivedData;
194  help::exchangeMap(exchangeData, receivedData);
195 
196  forAll(receivedData, i)
197  {
198  const labelPair& lp = receivedData[i];
199 
200  const label beI = globalToLocal[lp.first()];
201 
202  const cell& c = cells[faceOwner[edgeFaces(beI, 0)]];
203 
204  //- combine data if the cell attached to this face has a face
205  //- attached to the inter-processor boundary
206  //- this must hold for boundary layer cells
207  bool validCell(false);
208  forAll(c, fI)
209  {
210  const face& f = faces[c[fI]];
211 
212  forAll(f, eI)
213  {
214  const edge fe = f.faceEdge(eI);
215 
216  if
217  (
218  (fe == edges[beI]) &&
219  (mesh.faceIsInProcPatch(c[fI]) >= 0)
220  )
221  {
222  validCell = true;
223  break;
224  }
225  }
226 
227  if( validCell )
228  break;
229  }
230 
231  if( !validCell )
232  continue;
233 
234  const label groupI = elementInGroup[edgeFaces(beI, 0)];
235 
236  if( groupI < 0 )
237  continue;
238 
239  DynList<label>& ng = neiGroups[localGroupLabel[groupI]];
240 
241  //- store the connection over the inter-processor boundary
242  ng.appendIfNotIn(lp.second());
243  }
244  }
245 };
246 
248 {
250 
251 public:
252 
254  :
255  mse_(mse)
256  {}
257 
258  bool operator()(const label bfI) const
259  {
260  const labelList& faceOwner = mse_.faceOwners();
261  const polyMeshGen& mesh = mse_.mesh();
262  const faceListPMG& faces = mesh.faces();
263 
264  const cell& c = mesh.cells()[faceOwner[bfI]];
265  const PtrList<boundaryPatch>& boundaries = mesh.boundaries();
266  const label start = boundaries[0].patchStart();
267 
268  label nBndFaces(0), baseFace(-1), otherBase(-1), nQuads(0);
269  forAll(c, fI)
270  {
271  if( faces[c[fI]].size() == 4 )
272  ++nQuads;
273 
274  if( (c[fI] - start) == bfI )
275  {
276  baseFace = fI;
277  ++nBndFaces;
278  }
279  }
280 
281  if( nQuads == 6 )
282  {
283  //- cell is a hex
284  return true;
285  }
286 
287  if( (nQuads + 2) != c.size() )
288  return false;
289 
290  if( nBndFaces != 1 )
291  return false;
292 
293  label nQuadsAttachedToBaseFace(0);
294  forAll(c, fI)
295  {
296  if( fI == baseFace )
297  continue;
298 
299  const bool sEdge =
300  help::shareAnEdge(faces[c[baseFace]], faces[c[fI]]);
301 
302  if( (faces[c[fI]].size() == 4) && sEdge )
303  {
304  ++nQuadsAttachedToBaseFace;
305  }
306  else if( !sEdge )
307  {
308  if( otherBase != -1 )
309  return false;
310 
311  otherBase = fI;
312  }
313  }
314 
315  if(
316  (nQuads == 6) ||
317  (
318  ((nQuadsAttachedToBaseFace + 2) == c.size()) &&
319  otherBase != -1 &&
320  !help::shareAnEdge(faces[c[baseFace]], faces[c[otherBase]])
321  )
322  )
323  return true;
324 
325  return false;
326  }
327 };
328 
329 } // End namespace bndLayerOps
330 
331 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
332 
334 {
335  Info << "Analysing mesh for bnd layer existence" << endl;
336 
338  const polyMeshGen& mesh = mse.mesh();
339  const PtrList<boundaryPatch>& boundaries = mesh.boundaries();
340 
341  //- allocate data needed in parallel loops
342  mse.faceOwners();
343  mse.faceEdges();
344  mse.edgeFaces();
345  mse.edges();
346  mse.boundaryPointEdges();
347 
348  //- find layers in patch
349  nFirstLayers_ =
351  (
355  );
356 
357  # ifdef DEBUGLayer
358  labelList layerSubsetId(nFirstLayers_);
359  polyMeshGen& pmg = const_cast<polyMeshGen&>(mesh);
360  forAll(layerSubsetId, i)
361  layerSubsetId[i] = pmg.addCellSubset("bndLayer"+help::scalarToText(i));
362 
363 
364  forAll(layerAtBndFace_, bfI)
365  {
366  if( layerAtBndFace_[bfI] < 0 )
367  continue;
368 
369  pmg.addCellToSubset
370  (
371  layerSubsetId[layerAtBndFace_[bfI]],
372  mse.faceOwners()[bfI]
373  );
374  }
375  # endif
376 
377  if( is2DMesh_ )
378  {
379  polyMeshGen2DEngine mesh2DEngine(mse.mesh());
380  const boolList& zMinPoint = mesh2DEngine.zMinPoints();
381  const boolList& zMaxPoint = mesh2DEngine.zMaxPoints();
382 
383  const faceList::subList& bFaces = mse.boundaryFaces();
384 
385  # ifdef USE_OMP
386  # pragma omp parallel for schedule(dynamic, 50)
387  # endif
388  forAll(bFaces, bfI)
389  {
390  const face& bf = bFaces[bfI];
391 
392  bool allZMin(true), allZMax(true);
393  forAll(bf, pI)
394  {
395  if( !zMinPoint[bf[pI]] )
396  allZMin = false;
397  if( !zMaxPoint[bf[pI]] )
398  allZMax = false;
399  }
400 
401  if( allZMax ^ allZMin )
402  layerAtBndFace_[bfI] = -1;
403  }
404  }
405 
406  //- check the number of layer found at a patch
407  typedef std::map<label, DynList<label> > patchToLayerType;
408  patchToLayerType patchToLayer;
409 
410  const labelList& facePatch = meshSurface_.boundaryFacePatches();
411 
412  forAll(facePatch, bfI)
413  {
414  patchToLayer[facePatch[bfI]].appendIfNotIn(layerAtBndFace_[bfI]);
415  }
416 
417  //- all faces of a patch must be in the same layer
418  layerAtPatch_.setSize(boundaries.size());
420  layerAtPatch_[i].clear();
421 
422  for
423  (
424  patchToLayerType::const_iterator it=patchToLayer.begin();
425  it!=patchToLayer.end();
426  ++it
427  )
428  {
429  const DynList<label>& layersAtPatch = it->second;
430 
431  forAll(layersAtPatch, i)
432  {
433  if( layersAtPatch[i] < 0 )
434  {
435  layerAtPatch_[it->first].clear();
436  break;
437  }
438  else
439  {
440  layerAtPatch_[it->first].append(layersAtPatch[i]);
441  }
442  }
443  }
444 
445  //- set the layer ID to -1 for all faces where the patch is set to -1
446  forAll(facePatch, bfI)
447  {
448  if( layerAtPatch_[facePatch[bfI]].size() == 0 )
449  layerAtBndFace_[bfI] = -1;
450  }
451 
452  # ifdef DEBUGLayer
453  Info << "Layer at patch " << layerAtPatch_ << endl;
454  forAll(layerAtBndFace_, bfI)
455  if( layerAtBndFace_[bfI] < 0 )
456  Info << "0.2 No layer at boundary face " << bfI << endl;
457  # endif
458 }
459 
461 (
462  const label bfI,
463  DynList<edge>& hairEdges
464 ) const
465 {
466  const meshSurfaceEngine& mse = meshSurface_.surfaceEngine();
467  const polyMeshGen& mesh = mse.mesh();
468 
469  const label nInternalFaces = mesh.boundaries()[0].patchStart();
470 
471  const labelList& faceOwner = mse.faceOwners();
472 
473  const faceListPMG& faces = mesh.faces();
474  const cell& c = mesh.cells()[faceOwner[bfI]];
475 
476  //- check cell topology
477  DynList<edge, 48> edges;
478  DynList<DynList<label, 2>, 48> edgeFaces;
479  DynList<DynList<label, 10>, 24> faceEdges;
480  faceEdges.setSize(c.size());
481  label baseFace(-1);
482  forAll(c, fI)
483  {
484  if( c[fI] - nInternalFaces == bfI )
485  {
486  baseFace = fI;
487  }
488 
489  const face& f = faces[c[fI]];
490  faceEdges[fI].setSize(f.size());
491 
492  forAll(f, eI)
493  {
494  const edge e = f.faceEdge(eI);
495 
496  label pos = edges.containsAtPosition(e);
497 
498  if( pos < 0 )
499  {
500  pos = edges.size();
501  edges.append(e);
502  edgeFaces.setSize(pos+1);
503  }
504 
505  edgeFaces[pos].append(fI);
506  faceEdges[fI][eI] = pos;
507  }
508  }
509 
510  //- check does the base face exist and is the number of faces
511  //- in the cell corresponding to a prism cell
512  if( (baseFace < 0) || ((c.size() - faces[c[baseFace]].size()) != 2) )
513  return false;
514 
515  //- check if all faces attached to the base face are quads
516  bool isPrism(true);
517 
518  const face& bf = faces[c[baseFace]];
519  hairEdges.setSize(bf.size());
520 
521  forAll(bf, pI)
522  {
523  const label nextEdge = faceEdges[baseFace][pI];
524  const label prevEdge = faceEdges[baseFace][bf.rcIndex(pI)];
525 
526  if( edgeFaces[nextEdge].size() != 2 || edgeFaces[prevEdge].size() != 2 )
527  {
528  isPrism = false;
529  break;
530  }
531 
532  //- find the face attached to the edge after the current point
533  label otherNextFace = edgeFaces[nextEdge][0];
534  if( otherNextFace == baseFace )
535  otherNextFace = edgeFaces[nextEdge][1];
536 
537  //- find the face attached to the edge before the current point
538  label otherPrevFace = edgeFaces[prevEdge][0];
539  if( otherPrevFace == baseFace )
540  otherPrevFace = edgeFaces[prevEdge][1];
541 
542  label commonEdge;
543  for(commonEdge=0;commonEdge<edges.size();++commonEdge)
544  if(
545  edgeFaces[commonEdge].contains(otherNextFace) &&
546  edgeFaces[commonEdge].contains(otherPrevFace)
547  )
548  break;
549 
550  if( commonEdge == edges.size() )
551  {
552  isPrism = false;
553  break;
554  }
555 
556  //- there exists a common edge which shall be used as a hair
557  if( edges[commonEdge].start() == bf[pI] )
558  {
559  hairEdges[pI] = edges[commonEdge];
560  }
561  else
562  {
563  hairEdges[pI] = edges[commonEdge].reverseEdge();
564  }
565  }
566 
567  return isPrism;
568 }
569 
571 {
572  hairEdges_.clear();
574 
576  const faceList::subList& bFaces = mse.boundaryFaces();
577  mse.faceOwners();
578  const VRWGraph& pFaces = mse.pointFaces();
579  const labelList& bp = mse.bp();
580 
581  # ifdef USE_OMP
582  # pragma omp parallel if( bFaces.size() > 1000 )
583  # endif
584  {
585  edgeLongList localEdges;
586 
587  # ifdef USE_OMP
588  # pragma omp for schedule(dynamic, 100)
589  # endif
590  forAll(bFaces, bfI)
591  {
592  if( layerAtBndFace_[bfI] < 0 )
593  continue;
594 
595  //- find hair edges for this face
597  if( !findHairsForFace(bfI, hairEdges) )
598  continue;
599 
600  const face& bf = bFaces[bfI];
601 
602  forAll(bf, pI)
603  {
604  //- store hair edges in a list
605  const edge& he = hairEdges[pI];
606 
607  if( he.start() != bf[pI] )
609  (
610  "void detectBoundaryLayers::generateHairEdges()"
611  ) << "Wrong starting point" << abort(FatalError);
612 
613  localEdges.append(he);
614  }
615  }
616 
617  # ifdef USE_OMP
618  //- find the starting element for this thread
619  label startEl;
620  # pragma omp critical
621  {
622  startEl = hairEdges_.size();
623 
624  hairEdges_.setSize(startEl+localEdges.size());
625  }
626 
627  # pragma omp barrier
628 
629  //- copy the local data to splitEdges_
630  forAll(localEdges, i)
631  hairEdges_[startEl++] = localEdges[i];
632  # else
633  //- just transfer the data to splitEdges_
634  hairEdges_.transfer(localEdges);
635  # endif
636  }
637 
638  //- filter out duplicate edges
639  VRWGraph pHairEdges;
640  pHairEdges.reverseAddressing(hairEdges_);
641 
642  boolList duplicateEdge(hairEdges_.size(), false);
643  # ifdef USE_OMP
644  # pragma omp parallel for schedule(dynamic, 50)
645  # endif
646  forAll(pHairEdges, pointI)
647  {
648  forAllRow(pHairEdges, pointI, pheI)
649  {
650  const label heI = pHairEdges(pointI, pheI);
651  const edge& he = hairEdges_[heI];
652 
653  for(label pheJ=pheI+1;pheJ<pHairEdges.sizeOfRow(pointI);++pheJ)
654  {
655  const label heJ = pHairEdges(pointI, pheJ);
656  const edge& nhe = hairEdges_[heJ];
657 
658  if( he == nhe )
659  duplicateEdge[heJ] = true;
660  }
661  }
662  }
663 
664  label counter(0);
665  forAll(hairEdges_, heI)
666  {
667  if( !duplicateEdge[heI] )
668  {
669  if( heI > counter )
670  {
671  hairEdges_[counter++] = hairEdges_[heI];
672  }
673  else
674  {
675  ++counter;
676  }
677  }
678  }
679 
680  hairEdges_.setSize(counter);
681 
682  //- create point to split edges addressing
684 
685  forAll(hairEdges_, heI)
686  {
687  const edge& he = hairEdges_[heI];
688  hairEdgesAtBoundaryPoint_.append(bp[he.start()], heI);
689  }
690 }
691 
692 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
693 
694 } // End namespace Foam
695 
696 // ************************************************************************* //
Foam::meshSurfaceEngine::boundaryPointEdges
const VRWGraph & boundaryPointEdges() const
Definition: meshSurfaceEngineI.H:315
Foam::meshSurfaceEngine::bp
const labelList & bp() const
Definition: meshSurfaceEngineI.H:64
Foam::LongList::append
void append(const T &e)
Append an element at the end of the list.
Definition: LongListI.H:265
Foam::bndLayerOps::meshBndLayerSelectorOperator::operator()
bool operator()(const label bfI) const
Definition: detectBoundaryLayersFunctions.C:258
Foam::meshSurfaceEngine::globalToLocalBndEdgeAddressing
const Map< label > & globalToLocalBndEdgeAddressing() const
global boundary edge label to local label. Only for processor edges
Definition: meshSurfaceEngineI.H:510
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
Foam::help::scalarToText
word scalarToText(const scalar s)
convert the scalar value into text
Definition: helperFunctionsStringConversion.C:61
Foam::LongList::clear
void clear()
Clear the list, i.e. set next free to zero.
Definition: LongListI.H:230
Foam::primitiveMesh::cells
const cellList & cells() const
Definition: primitiveMeshCells.C:136
Foam::meshSurfaceEngine::pointFaces
const VRWGraph & pointFaces() const
Definition: meshSurfaceEngineI.H:162
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:58
Foam::Pair::first
const Type & first() const
Return first.
Definition: Pair.H:87
Foam::meshSurfaceEngine::faceEdges
const VRWGraph & faceEdges() const
Definition: meshSurfaceEngineI.H:353
Foam::detectBoundaryLayers::layerAtPatch_
List< DynList< label > > layerAtPatch_
layer at a boundary patch
Definition: detectBoundaryLayers.H:72
Foam::Map< label >
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::LongList::size
label size() const
Size of the active part of the list.
Definition: LongListI.H:203
Foam::bndLayerOps::meshBndLayerNeighbourOperator::size_
const label size_
Definition: detectBoundaryLayersFunctions.C:57
Foam::cellListPMG
Definition: cellListPMG.H:49
Foam::meshSurfacePartitioner::surfaceEngine
const meshSurfaceEngine & surfaceEngine() const
return const reference to meshSurfaceEngine
Definition: meshSurfacePartitioner.H:109
Foam::polyMeshGen2DEngine::zMinPoints
const boolList & zMinPoints() const
Definition: polyMeshGen2DEngineI.H:64
Foam::detectBoundaryLayers::meshSurface_
const meshSurfacePartitioner & meshSurface_
Reference to the meshSurfacePartitioner.
Definition: detectBoundaryLayers.H:62
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::bndLayerOps::meshBndLayerNeighbourOperator::meshBndLayerNeighbourOperator
meshBndLayerNeighbourOperator(const meshSurfaceEngine &mse)
Definition: detectBoundaryLayersFunctions.C:61
Foam::LongList::setSize
void setSize(const label)
Reset size of List.
Definition: LongListI.H:223
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::LongList
Definition: LongList.H:55
Foam::polyMeshGenCells::addCellToSubset
void addCellToSubset(const label, const label)
Definition: polyMeshGenCellsI.H:45
labelledPair.H
Foam::meshSurfaceEngine::boundaryFaces
const faceList::subList & boundaryFaces() const
Definition: meshSurfaceEngineI.H:103
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::help::groupMarking
label groupMarking(labelListType &elementInGroup, const neiOp &neighbourCalculator, const filterOp &selector)
Definition: helperFunctionsFrontalMarking.C:155
Foam::detectBoundaryLayers::is2DMesh_
const bool is2DMesh_
is it a 2D mesh
Definition: detectBoundaryLayers.H:81
Foam::Info
messageStream Info
Foam::detectBoundaryLayers::hairEdges
const edgeLongList & hairEdges() const
return hair edges found in the detection process
Definition: detectBoundaryLayers.H:116
Foam::bndLayerOps::meshBndLayerNeighbourOperator::collectGroups
void collectGroups(std::map< label, DynList< label > > &neiGroups, const labelListType &elementInGroup, const DynList< label > &localGroupLabel) const
Definition: detectBoundaryLayersFunctions.C:127
Foam::meshSurfaceEngine::otherEdgeFaceAtProc
const Map< label > & otherEdgeFaceAtProc() const
Definition: meshSurfaceEngineI.H:568
Foam::polyMeshGenCells::addCellSubset
label addCellSubset(const word &)
Definition: polyMeshGenCells.C:351
Foam::meshSurfaceEngine::beNeiProcs
const DynList< label > & beNeiProcs() const
communication matrix for sending edge data
Definition: meshSurfaceEngineI.H:549
Foam::DynList::appendIfNotIn
void appendIfNotIn(const T &e)
Definition: DynListI.H:324
Foam::LongList::transfer
void transfer(LongList< T, Offset > &)
transfer the list from another one without allocating it
Definition: LongListI.H:245
Foam::Pair::second
const Type & second() const
Return second.
Definition: Pair.H:99
Foam::VRWGraph::setSize
void setSize(const label)
Reset the number of rows.
Definition: VRWGraphI.H:132
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
forAllRow
#define forAllRow(graph, rowI, index)
Definition: VRWGraph.H:277
Foam::bndLayerOps::meshBndLayerSelectorOperator
Definition: detectBoundaryLayersFunctions.C:247
Foam::VRWGraph::sizeOfRow
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
Definition: VRWGraphI.H:127
Foam::polyMeshGen2DEngine::zMaxPoints
const boolList & zMaxPoints() const
Definition: polyMeshGen2DEngineI.H:88
Foam::FatalError
error FatalError
labelledScalar.H
Foam::bndLayerOps::meshBndLayerNeighbourOperator::size
label size() const
Definition: detectBoundaryLayersFunctions.C:67
Foam::bndLayerOps::meshBndLayerNeighbourOperator::operator()
void operator()(const label bfI, DynList< label > &neighbourFaces) const
Definition: detectBoundaryLayersFunctions.C:72
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::detectBoundaryLayers::hairEdgesAtBoundaryPoint_
VRWGraph hairEdgesAtBoundaryPoint_
hair edges at a boudary point
Definition: detectBoundaryLayers.H:78
Foam::detectBoundaryLayers::generateHairEdges
void generateHairEdges()
generate hair edges for all boundary points
Definition: detectBoundaryLayersFunctions.C:570
polyMeshGen2DEngine.H
Foam::meshSurfaceEngine::edgeFaces
const VRWGraph & edgeFaces() const
Definition: meshSurfaceEngineI.H:334
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::detectBoundaryLayers::hairEdges_
edgeLongList hairEdges_
hair edges found in the mesh
Definition: detectBoundaryLayers.H:75
Foam::DynList< label >
Foam::meshSurfaceEngine::edges
const edgeList & edges() const
Definition: meshSurfaceEngineI.H:296
Foam::meshSurfacePartitioner::boundaryFacePatches
const labelList & boundaryFacePatches() const
Definition: meshSurfacePartitioner.H:116
Foam::detectBoundaryLayers::analyseLayers
void analyseLayers()
analyse layers to check their topology
Definition: detectBoundaryLayersFunctions.C:333
Foam::DynList::containsAtPosition
label containsAtPosition(const T &e) const
Definition: DynListI.H:356
Foam::bndLayerOps::meshBndLayerSelectorOperator::mse_
const meshSurfaceEngine & mse_
Definition: detectBoundaryLayersFunctions.C:249
Foam::polyMesh::faces
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1004
Foam::bndLayerOps::meshBndLayerSelectorOperator::meshBndLayerSelectorOperator
meshBndLayerSelectorOperator(const meshSurfaceEngine &mse)
Definition: detectBoundaryLayersFunctions.C:253
Foam::VRWGraph::reverseAddressing
void reverseAddressing(const label nRows, const GraphType &origGraph)
Definition: VRWGraphI.H:406
he
volScalarField & he
Definition: YEEqn.H:56
Foam::Pair
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: contiguous.H:49
Foam::polyMeshGen2DEngine
Definition: polyMeshGen2DEngine.H:51
helperFunctions.H
f
labelList f(nPoints)
Foam::faceListPMG::size
label size() const
return the number of used elements
Definition: faceListPMGI.H:73
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::DynList::setSize
void setSize(const label)
Reset size of List.
Definition: DynListI.H:263
Foam::PtrList::size
label size() const
Return the number of elements in the PtrList.
Definition: PtrListI.H:32
Foam::help::exchangeMap
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
Definition: helperFunctionsPar.C:129
Foam::VRWGraph::clear
void clear()
Clear the graph.
Definition: VRWGraphI.H:278
Foam::VRWGraph::append
void append(const label rowI, const label)
Append an element to the given row.
Definition: VRWGraphI.H:303
Foam::detectBoundaryLayers::findHairsForFace
bool findHairsForFace(const label, DynList< edge > &hairEdges) const
provide hair edges in a cell above a boundary face
Definition: detectBoundaryLayersFunctions.C:461
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::bndLayerOps::meshBndLayerNeighbourOperator::mse_
const meshSurfaceEngine & mse_
Definition: detectBoundaryLayersFunctions.C:56
Foam::detectBoundaryLayers::layerAtBndFace_
labelList layerAtBndFace_
information about the existing boundary layer at a boundary face
Definition: detectBoundaryLayers.H:69
FatalErrorIn
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:313
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
detectBoundaryLayers.H
Foam::DynList::size
label size() const
Definition: DynListI.H:235
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::bndLayerOps::meshBndLayerNeighbourOperator
Definition: detectBoundaryLayersFunctions.C:54
Foam::faceListPMG
Definition: faceListPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
VRWGraphList.H
polyMeshGenAddressing.H
Foam::cell
A cell is defined as a list of faces with extra functionality.
Definition: cell.H:56
Foam::labelPair
Pair< label > labelPair
Label pair.
Definition: labelPair.H:48
Foam::meshSurfaceEngine::mesh
const polyMeshGen & mesh() const
Definition: meshSurfaceEngineI.H:44
Foam::DynList::clear
void clear()
Clear the list, i.e. set next free to zero.
Definition: DynListI.H:279
Foam::meshSurfaceEngine
Definition: meshSurfaceEngine.H:54
Foam::help::shareAnEdge
bool shareAnEdge(const faceType1 &f1, const faceType2 &f2)
check if two faces share an edge
Definition: helperFunctionsTopologyManipulationI.H:324
Foam::detectBoundaryLayers::nFirstLayers_
label nFirstLayers_
Definition: detectBoundaryLayers.H:66
meshSurfacePartitioner.H
Foam::meshSurfaceEngine::cells
const cellListPMG & cells() const
Definition: meshSurfaceEngineI.H:59
Foam::DynList::append
void append(const T &e)
Append an element at the end of the list.
Definition: DynListI.H:304
Foam::meshSurfaceEngine::faceOwners
const labelList & faceOwners() const
Definition: meshSurfaceEngineI.H:143
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:190