boundaryLayers.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 "boundaryLayers.H"
29 #include "meshSurfaceEngine.H"
30 #include "demandDrivenData.H"
31 #include "helperFunctions.H"
32 #include "helperFunctionsPar.H"
34 #include "meshSurfacePartitioner.H"
35 #include "polyMeshGen2DEngine.H"
36 
37 #include "labelledPoint.H"
38 #include <map>
39 #include <set>
40 
41 # ifdef USE_OMP
42 #include <omp.h>
43 # endif
44 
45 //#define DEBUGLayer
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
55 {
56  if( !msePtr_ )
58 
59  return *msePtr_;
60 }
61 
63 {
64  if( !meshPartitionerPtr_ )
66 
67  return *meshPartitionerPtr_;
68 }
69 
71 {
72  if( geometryAnalysed_ )
73  return;
74 
76  treatPatchesWithPatch_[patchI].append(patchI);
77 
78  const meshSurfaceEngine& mse = surfaceEngine();
79 
80  const pointFieldPMG& points = mesh_.points();
81  const faceList::subList& bFaces = mse.boundaryFaces();
82  const edgeList& edges = mse.edges();
83  const VRWGraph& eFaces = mse.edgeFaces();
84  const labelList& boundaryFacePatches = mse.boundaryFacePatches();
85 
87  const VRWGraph& pPatches = mPart.pointPatches();
88 
89  //- patches must be treated together if there exist a corner where
90  //- more than three patches meet
91  const labelHashSet& corners = mPart.corners();
92  forAllConstIter(labelHashSet, corners, it)
93  {
94  const label bpI = it.key();
95 
96  if( mPart.numberOfFeatureEdgesAtPoint(bpI) > 3 )
97  {
98  labelHashSet commonPatches;
99  DynList<label> allPatches;
100 
101  forAllRow(pPatches, bpI, patchI)
102  {
103  const DynList<label>& tpwp =
104  treatPatchesWithPatch_[pPatches(bpI, patchI)];
105 
106  forAll(tpwp, pJ)
107  {
108  if( commonPatches.found(tpwp[pJ]) )
109  continue;
110 
111  commonPatches.insert(tpwp[pJ]);
112  allPatches.append(tpwp[pJ]);
113  }
114  }
115 
116  forAllRow(pPatches, bpI, patchI)
117  treatPatchesWithPatch_[pPatches(bpI, patchI)] = allPatches;
118 
119  # ifdef DEBUGLayer
120  Info << "Corner " << bpI << " is shared by patches "
121  << pPatches[bpI] << endl;
122  Info << "All patches " << allPatches << endl;
123  # endif
124  }
125  }
126 
127  //- patches must be treated together for concave geometries
128  //- edgeClassification map counts the number of convex and concave edges
129  //- for a given patch. The first counts convex edges and the second counts
130  //- concave ones. If the number of concave edges is of the considerable
131  //- percentage, it is treated as O-topology
132  meshSurfaceCheckInvertedVertices vertexCheck(mse);
133  const labelHashSet& invertedVertices = vertexCheck.invertedVertices();
134 
135  std::map<std::pair<label, label>, Pair<label> > edgeClassification;
136  forAll(eFaces, eI)
137  {
138  if( eFaces.sizeOfRow(eI) != 2 )
139  continue;
140 
141  //- check if the any of the face vertices is tangled
142  const edge& e = edges[eI];
143  if
144  (
145  !is2DMesh_ &&
146  (invertedVertices.found(e[0]) || invertedVertices.found(e[1]))
147  )
148  continue;
149 
150  const label patch0 = boundaryFacePatches[eFaces(eI, 0)];
151  const label patch1 = boundaryFacePatches[eFaces(eI, 1)];
152  if( patch0 != patch1 )
153  {
154  std::pair<label, label> pp
155  (
156  Foam::min(patch0, patch1),
157  Foam::max(patch0, patch1)
158  );
159  if( edgeClassification.find(pp) == edgeClassification.end() )
160  edgeClassification.insert
161  (
162  std::make_pair(pp, Pair<label>(0, 0))
163  );
164 
165  const face& f1 = bFaces[eFaces(eI, 0)];
166  const face& f2 = bFaces[eFaces(eI, 1)];
167 
168  if
169  (
171  (help::angleBetweenFaces(points, f1, f2) > 0.75 * M_PI)
172  )
173  {
174  ++edgeClassification[pp].second();
175  }
176  else
177  {
178  ++edgeClassification[pp].first();
179  }
180  }
181  }
182 
183  if( Pstream::parRun() )
184  {
185  const labelList& bPoints = mse.boundaryPoints();
186 
187  //- check faces over processor edges
188  const labelList& globalEdgeLabel = mse.globalBoundaryEdgeLabel();
189  const Map<label>& globalToLocal = mse.globalToLocalBndEdgeAddressing();
190 
191  const DynList<label>& neiProcs = mse.beNeiProcs();
192  const Map<label>& otherProcPatches = mse.otherEdgeFacePatch();
193  const Map<label>& otherFaceProc = mse.otherEdgeFaceAtProc();
194 
195  //- send faces sharing processor edges to other processors
196  //- faces are flattened into a single contiguous array
197  const labelList& bp = mse.bp();
198  const labelList& globalPointLabel = mse.globalBoundaryPointLabel();
199  const Map<label>& globalPointToLocal =
201 
202  std::map<label, LongList<labelledPoint> > exchangePoints;
203  forAll(neiProcs, procI)
204  {
205  exchangePoints.insert
206  (
207  std::make_pair(neiProcs[procI], LongList<labelledPoint>())
208  );
209  }
210 
211  //- store faces for sending
212  forAllConstIter(Map<label>, otherFaceProc, it)
213  {
214  const label beI = it.key();
215 
216  if( eFaces.sizeOfRow(beI) == 0 )
217  continue;
218 
219  const edge& e = edges[beI];
220 
221  if
222  (
223  !is2DMesh_ &&
224  (invertedVertices.found(e[0]) || invertedVertices.found(e[1]))
225  )
226  continue;
227 
228  //- do not send data if the face on other processor
229  //- is in the same patch
230  if( otherProcPatches[beI] == boundaryFacePatches[eFaces(beI, 0)] )
231  continue;
232 
233  const face& f = bFaces[eFaces(beI, 0)];
234 
235  const label neiProc = it();
236 
237  //- each face is sent as follows
238  //- 1. global edge label
239  //- 2. number of face nodes
240  //- 3. faces nodes and vertex coordinates
241  LongList<labelledPoint>& dps = exchangePoints[neiProc];
242  dps.append(labelledPoint(globalEdgeLabel[beI], point()));
243  dps.append(labelledPoint(f.size(), point()));
244  forAll(f, pI)
245  {
246  dps.append
247  (
249  (
250  globalPointLabel[bp[f[pI]]],
251  points[f[pI]]
252  )
253  );
254  }
255  }
256 
257  LongList<labelledPoint> receivedData;
258  help::exchangeMap(exchangePoints, receivedData);
259 
260  //- receive faces from other processors
261  Map<label> transferredPointToLocal;
262 
263  label counter(0);
264  while( counter < receivedData.size() )
265  {
266  const label beI =
267  globalToLocal[receivedData[counter++].pointLabel()];
268 
269  DynList<label> f(receivedData[counter++].pointLabel());
270  forAll(f, pI)
271  {
272  const labelledPoint& lp = receivedData[counter++];
273 
274  if( globalPointToLocal.found(lp.pointLabel()) )
275  {
276  //- this point already exist on this processor
277  f[pI] = bPoints[globalPointToLocal[lp.pointLabel()]];
278  }
279  else
280  {
281  //- this point does not exist on this processor
282  //- add it to the local list of points
283  //- it will be deleted when this procedure is finished
284  if( !transferredPointToLocal.found(lp.pointLabel()) )
285  {
286  //- this point has not yet been received
287  transferredPointToLocal.insert
288  (
289  lp.pointLabel(),
290  points.size()
291  );
292  mesh_.points().append(lp.coordinates());
293  }
294 
295  f[pI] = transferredPointToLocal[lp.pointLabel()];
296  }
297  }
298 
299  const face& bf = bFaces[eFaces(beI, 0)];
300 
301  const label patch0 = boundaryFacePatches[eFaces(beI, 0)];
302  const label patch1 = otherProcPatches[beI];
303 
304  std::pair<label, label> pp
305  (
306  Foam::min(patch0, patch1),
307  Foam::max(patch0, patch1)
308  );
309  if( edgeClassification.find(pp) == edgeClassification.end() )
310  edgeClassification.insert
311  (
312  std::make_pair(pp, Pair<label>(0, 0))
313  );
314 
315  if(
316  (otherFaceProc[beI] > Pstream::myProcNo()) &&
317  (
319  (help::angleBetweenFaces(points, bf, f) > 0.75 * M_PI)
320  )
321  )
322  {
323  ++edgeClassification[pp].second();
324  }
325  else if( otherFaceProc[beI] > Pstream::myProcNo() )
326  {
327  ++edgeClassification[pp].first();
328  }
329  }
330 
331  //- set the size of points back to their original number
333  }
334 
335  std::map<std::pair<label, label>, Pair<label> >::const_iterator it;
336  for(it=edgeClassification.begin();it!=edgeClassification.end();++it)
337  {
338  const std::pair<label, label>& edgePair = it->first;
339  const Pair<label>& nConvexAndConcave = it->second;
340 
341  if( nConvexAndConcave.second() != 0 )
342  {
343  //- number of concave edges is greater than the number
344  //- of the convex ones. Treat patches together.
345  const label patch0 = edgePair.first;
346  const label patch1 = edgePair.second;
347 
348  //- avoid adding unused patches in case of 2D meshing
349  if( treatedPatch_[patch0] || treatedPatch_[patch1] )
350  continue;
351 
352  treatPatchesWithPatch_[patch0].append(patch1);
353  treatPatchesWithPatch_[patch1].append(patch0);
354  }
355  }
356 
357  if( Pstream::parRun() )
358  {
359  //- make sure that all processors have the same graph
360  labelLongList flattenedPatches;
362  {
363  if( treatPatchesWithPatch_[patchI].size() <= 1 )
364  continue;
365 
366  flattenedPatches.append(patchI);
367  flattenedPatches.append(treatPatchesWithPatch_[patchI].size());
368  forAll(treatPatchesWithPatch_[patchI], itemI)
369  flattenedPatches.append(treatPatchesWithPatch_[patchI][itemI]);
370  }
371 
372  labelListList procPatches(Pstream::nProcs());
373  procPatches[Pstream::myProcNo()].setSize(flattenedPatches.size());
374  forAll(flattenedPatches, i)
375  procPatches[Pstream::myProcNo()][i] = flattenedPatches[i];
376  Pstream::gatherList(procPatches);
377  Pstream::scatterList(procPatches);
378 
379  forAll(procPatches, procI)
380  {
381  if( procI == Pstream::myProcNo() )
382  continue;
383 
384  const labelList& cPatches = procPatches[procI];
385  label counter(0);
386 
387  while( counter < cPatches.size() )
388  {
389  const label patchI = cPatches[counter++];
390  const label size = cPatches[counter++];
391  for(label i=0;i<size;++i)
392  treatPatchesWithPatch_[patchI].appendIfNotIn
393  (
394  cPatches[counter++]
395  );
396  }
397  }
398  }
399 
400  //- final adjusting of patches which shall be treated together
401  boolList confirmed(treatPatchesWithPatch_.size(), false);
403  {
404  if( treatPatchesWithPatch_[patchI].size() <= 1 )
405  {
406  confirmed[patchI] = true;
407  continue;
408  }
409 
410  if( confirmed[patchI] )
411  continue;
412 
413  std::set<label> commonPatches;
414  commonPatches.insert(patchI);
415 
416  DynList<label> front;
417  front.append(patchI);
418  confirmed[patchI] = true;
419 
420  while( front.size() )
421  {
422  const label fPatch = front.removeLastElement();
423 
424  forAll(treatPatchesWithPatch_[fPatch], i)
425  {
426  const label patchJ = treatPatchesWithPatch_[fPatch][i];
427 
428  if( confirmed[patchJ] )
429  continue;
430 
431  front.append(patchJ);
432  confirmed[patchJ] = true;
433  commonPatches.insert(patchJ);
434  forAll(treatPatchesWithPatch_[patchJ], j)
435  commonPatches.insert(treatPatchesWithPatch_[patchJ][j]);
436  }
437  }
438 
439  forAllConstIter(std::set<label>, commonPatches, it)
440  {
441  const label patchJ = *it;
442 
443  treatPatchesWithPatch_[patchJ].clear();
444  forAllConstIter(std::set<label>, commonPatches, iter)
445  treatPatchesWithPatch_[patchJ].append(*iter);
446  }
447  }
448 
449  # ifdef DEBUGLayer
450  for(it=edgeClassification.begin();it!=edgeClassification.end();++it)
451  {
452  const std::pair<label, label>& edgePair = it->first;
453  const Pair<label>& nConvexAndConcave = it->second;
454  Info << "Pair of patches " << edgePair.first << " "
455  << edgePair.second << " is " << nConvexAndConcave << endl;
456  }
457 
458  Info << "Patch names " << patchNames_ << endl;
459  Info << "Treat patches with patch " << treatPatchesWithPatch_ << endl;
460 
461  label layerI(0), subsetId;
462  boolList usedPatch(treatPatchesWithPatch_.size(), false);
463  const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
464 
466  {
467  if( usedPatch[patchI] || (boundaries[patchI].patchSize() == 0) )
468  continue;
469 
470  Info << "Adding layer subset " << layerI
471  << " for patch " << patchI << endl;
472  usedPatch[patchI] = true;
473  subsetId = mesh_.addFaceSubset("layer_"+help::scalarToText(layerI));
474  ++layerI;
475 
476  forAll(treatPatchesWithPatch_[patchI], i)
477  {
478  const label cPatch = treatPatchesWithPatch_[patchI][i];
479  usedPatch[cPatch] = true;
480 
481  label start = boundaries[cPatch].patchStart();
482  const label size = boundaries[cPatch].patchSize();
483  for(label i=0;i<size;++i)
484  mesh_.addFaceToSubset(subsetId, start++);
485  }
486  }
487 
488  mesh_.write();
489  # endif
490 
491  geometryAnalysed_ = true;
492 }
493 
495 {
496  if( treatedPatch_[patchLabel] )
497  return;
498 
499  const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
500 
501  if( returnReduce(boundaries[patchLabel].patchSize(), sumOp<label>()) == 0 )
502  return;
503 
504  boolList treatPatches(boundaries.size(), false);
505  if( patchWiseLayers_ )
506  {
507  forAll(treatPatchesWithPatch_[patchLabel], pI)
508  treatPatches[treatPatchesWithPatch_[patchLabel][pI]] = true;
509  }
510  else
511  {
512  forAll(treatedPatch_, patchI)
513  if( !treatedPatch_[patchI] )
514  treatPatches[patchI] = true;
515  }
516 
518  newLabelForVertex_ = -1;
519  otherVrts_.clear();
520  patchKey_.clear();
521 
522  createNewVertices(treatPatches);
523 
524  createNewFacesAndCells(treatPatches);
525 
526  forAll(treatPatches, patchI)
527  if( treatPatches[patchI] )
528  treatedPatch_[patchI] = true;
529 }
530 
531 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
532 
533 // Construct from mesh reference
535 (
537 )
538 :
539  mesh_(mesh),
540  msePtr_(NULL),
541  meshPartitionerPtr_(NULL),
542  patchWiseLayers_(true),
543  terminateLayersAtConcaveEdges_(false),
544  is2DMesh_(false),
545  patchNames_(),
546  patchTypes_(),
547  treatedPatch_(),
548  treatPatchesWithPatch_(),
549  newLabelForVertex_(),
550  otherVrts_(),
551  patchKey_(),
552  nPoints_(mesh.points().size()),
553  geometryAnalysed_(false)
554 {
555  const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
556  patchNames_.setSize(boundaries.size());
557  patchTypes_.setSize(boundaries.size());
558  forAll(boundaries, patchI)
559  {
560  patchNames_[patchI] = boundaries[patchI].patchName();
561  patchTypes_[patchI] = boundaries[patchI].patchType();
562  }
563 
564  treatedPatch_.setSize(boundaries.size());
565  treatedPatch_ = false;
566 
567  treatPatchesWithPatch_.setSize(boundaries.size());
568 }
569 
570 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
571 
573 {
574  clearOut();
575 
576  if( Pstream::parRun() )
578 }
579 
580 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
581 
583 {
584  if( !geometryAnalysed_ )
586 
587  const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
588 
589  forAll(boundaries, patchI)
590  if( boundaries[patchI].patchName() == patchName )
591  addLayerForPatch(patchI);
592 }
593 
595 {
596  patchWiseLayers_ = false;
597 }
598 
600 {
602 }
603 
605 {
606  polyMeshGen2DEngine mesh2DEngine(mesh_);
607  const boolList& zMinPoint = mesh2DEngine.zMinPoints();
608  const boolList& zMaxPoint = mesh2DEngine.zMaxPoints();
609 
610  const faceList::subList& bFaces = surfaceEngine().boundaryFaces();
611  const labelList& facePatch = surfaceEngine().boundaryFacePatches();
612 
613  boolList allZMax(mesh_.boundaries().size(), true);
614  boolList allZMin(mesh_.boundaries().size(), true);
615 
616  # ifdef USE_OMP
617  # pragma omp parallel for schedule(dynamic, 50)
618  # endif
619  forAll(bFaces, bfI)
620  {
621  const face& bf = bFaces[bfI];
622 
623  forAll(bf, pI)
624  {
625  if( !zMinPoint[bf[pI]] )
626  allZMin[facePatch[bfI]] = false;
627  if( !zMaxPoint[bf[pI]] )
628  allZMax[facePatch[bfI]] = false;
629  }
630  }
631 
632  //- mark empty patches as already used
633  forAll(allZMin, patchI)
634  {
635  if( allZMin[patchI] ^ allZMax[patchI] )
636  {
637  treatedPatch_[patchI] = true;
638  }
639  }
640 
642  {
644 
645  for(label i=patches.size()-1;i>=0;--i)
646  if( treatedPatch_[patches[i]] )
647  patches.removeElement(i);
648  }
649 
650  is2DMesh_ = true;
651 }
652 
654 {
655  if( !geometryAnalysed_ )
657 
658  const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
659 
660  if( !patchWiseLayers_ )
661  {
662  forAll(boundaries, patchI)
663  addLayerForPatch(patchI);
664  }
665  else
666  {
668  newLabelForVertex_ = -1;
669  otherVrts_.clear();
670  patchKey_.clear();
671 
672  //- avoid generating bnd layer at empty patches in case of 2D meshing
673  label counter(0);
674  forAll(treatedPatch_, patchI)
675  if( !treatedPatch_[patchI] )
676  ++counter;
677 
678  labelList treatedPatches(counter);
679  counter = 0;
681  if( !treatedPatch_[i] )
682  treatedPatches[counter++] = i;
683 
684  //- create bnd layer vertices
685  createNewVertices(treatedPatches);
686 
687  //- create bnd layer cells
688  createLayerCells(treatedPatches);
689  }
690 }
691 
692 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
693 
694 } // End namespace Foam
695 
696 // ************************************************************************* //
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:979
Foam::meshSurfaceEngine::bp
const labelList & bp() const
Definition: meshSurfaceEngineI.H:64
Foam::meshSurfaceCheckInvertedVertices
Definition: meshSurfaceCheckInvertedVertices.H:54
Foam::LongList::append
void append(const T &e)
Append an element at the end of the list.
Definition: LongListI.H:265
Foam::boundaryLayers::patchNames_
wordList patchNames_
patch names
Definition: boundaryLayers.H:82
Foam::labelledPoint::coordinates
const point & coordinates() const
return point coordinates
Definition: labelledPoint.H:93
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::boundaryLayers::~boundaryLayers
~boundaryLayers()
Definition: boundaryLayers.C:572
Foam::boundaryLayers::surfaceEngine
const meshSurfaceEngine & surfaceEngine() const
Return const reference to meshSurfaceEngine.
Definition: boundaryLayers.C:54
Foam::meshSurfaceEngine::globalToLocalBndEdgeAddressing
const Map< label > & globalToLocalBndEdgeAddressing() const
global boundary edge label to local label. Only for processor edges
Definition: meshSurfaceEngineI.H:510
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::meshSurfaceEngine::globalBoundaryEdgeLabel
const labelList & globalBoundaryEdgeLabel() const
global boundary edge label
Definition: meshSurfaceEngineI.H:489
Foam::UList::first
T & first()
Return the first element of the list.
Definition: UListI.H:117
helperFunctionsPar.H
Foam::boundaryLayers::nPoints_
label nPoints_
number of vertices in the mesh
Definition: boundaryLayers.H:105
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::meshSurfaceCheckInvertedVertices::invertedVertices
const labelHashSet & invertedVertices() const
return the labels of inverted vertices
Definition: meshSurfaceCheckInvertedVertices.H:102
Foam::meshSurfaceEngine::globalBoundaryPointLabel
const labelList & globalBoundaryPointLabel() const
global boundary point label
Definition: meshSurfaceEngineI.H:410
Foam::boundaryLayers::mesh_
polyMeshGen & mesh_
Reference to the mesh.
Definition: boundaryLayers.H:63
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::Pstream::scatterList
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
Definition: gatherScatterList.C:205
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
meshSurfaceCheckInvertedVertices.H
Foam::UPstream::nProcs
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Definition: UPstream.H:387
Foam::help::scalarToText
word scalarToText(const scalar s)
convert the scalar value into text
Definition: helperFunctionsStringConversion.C:61
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:377
Foam::polyMeshGenFaces::addFaceSubset
label addFaceSubset(const word &)
Definition: polyMeshGenFaces.C:262
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::meshSurfaceEngine::boundaryFacePatches
const labelList & boundaryFacePatches() const
patch label for each boundary face
Definition: meshSurfaceEngineI.H:123
Foam::Pair::first
const Type & first() const
Return first.
Definition: Pair.H:87
Foam::Map< label >
Foam::boundaryLayers::newLabelForVertex_
labelLongList newLabelForVertex_
label of a new node (helper)
Definition: boundaryLayers.H:95
Foam::boundaryLayers::otherVrts_
std::map< label, std::map< std::pair< label, label >, label > > otherVrts_
Definition: boundaryLayers.H:99
Foam::boundaryLayers::is2DMesh_
bool is2DMesh_
is it a 2D mesh
Definition: boundaryLayers.H:79
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::polyMeshGenPoints::points
const pointFieldPMG & points() const
access to points
Definition: polyMeshGenPointsI.H:44
Foam::LongList::size
label size() const
Size of the active part of the list.
Definition: LongListI.H:203
Foam::boundaryLayers::boundaryLayers
boundaryLayers(const boundaryLayers &)
Disallow bitwise copy construct.
Foam::HashSet< label, Hash< label > >
Foam::polyMeshGen2DEngine::zMinPoints
const boolList & zMinPoints() const
Definition: polyMeshGen2DEngineI.H:64
Foam::DynList::removeLastElement
T removeLastElement()
Return and remove the last element.
Definition: DynListI.H:384
Foam::meshSurfacePartitioner::pointPatches
const VRWGraph & pointPatches() const
Definition: meshSurfacePartitioner.H:123
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::LongList::setSize
void setSize(const label)
Reset size of List.
Definition: LongListI.H:223
Foam::LongList
Definition: LongList.H:55
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::boundaryLayers::findPatchesToBeTreatedTogether
void findPatchesToBeTreatedTogether()
Definition: boundaryLayers.C:70
Foam::Info
messageStream Info
Foam::boundaryLayers::addLayerForPatch
void addLayerForPatch(const label patchLabel)
create a bnd layer for a given patch
Definition: boundaryLayers.C:494
Foam::meshSurfaceEngine::otherEdgeFaceAtProc
const Map< label > & otherEdgeFaceAtProc() const
Definition: meshSurfaceEngineI.H:568
Foam::meshSurfaceEngine::beNeiProcs
const DynList< label > & beNeiProcs() const
communication matrix for sending edge data
Definition: meshSurfaceEngineI.H:549
Foam::boundaryLayers::geometryAnalysed_
bool geometryAnalysed_
has the geometry been analysed
Definition: boundaryLayers.H:108
f1
scalar f1
Definition: createFields.H:28
Foam::Pair::second
const Type & second() const
Return second.
Definition: Pair.H:99
Foam::boundaryLayers::terminateLayersAtConcaveEdges
void terminateLayersAtConcaveEdges()
terminate boundary layers at concave edges (used as a flag)
Definition: boundaryLayers.C:599
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::boundaryLayers::addLayerForAllPatches
void addLayerForAllPatches()
add layers for all patches
Definition: boundaryLayers.C:653
Foam::polyMeshGenModifier::removeUnusedVertices
void removeUnusedVertices()
remove unused vertices
Definition: polyMeshGenModifierRemoveUnusedVertices.C:37
Foam::help::isSharedEdgeConvex
bool isSharedEdgeConvex(const pointField &points, const Face1 &f1, const Face2 &f2)
check if the faces share a convex edge
Definition: helperFunctionsGeometryQueriesI.H:74
Foam::meshSurfacePartitioner::numberOfFeatureEdgesAtPoint
label numberOfFeatureEdgesAtPoint(const label bpI) const
return the number of feature edges attached to a boundary point
Definition: meshSurfacePartitioner.H:141
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::boundaryLayers::terminateLayersAtConcaveEdges_
bool terminateLayersAtConcaveEdges_
shall the layers be terminated at concave edges (true)
Definition: boundaryLayers.H:76
Foam::boundaryLayers::patchKey_
labelList patchKey_
a key assigned to each patch. It is needed to search in otherVrts_
Definition: boundaryLayers.H:102
labelledPoint.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::pointFieldPMG::setSize
void setSize(const label nElmts)
set the number of used elements
Definition: pointFieldPMGI.H:76
Foam::HashTable::found
bool found(const Key &) const
Return true if hashedEntry is found in table.
Definition: HashTable.C:109
Foam::boundaryLayers::createLayerCells
void createLayerCells(const labelList &patchLabels)
Definition: boundaryLayerCells.C:53
polyMeshGen2DEngine.H
Foam::meshSurfaceEngine::edgeFaces
const VRWGraph & edgeFaces() const
Definition: meshSurfaceEngineI.H:334
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
meshSurfaceEngine.H
Foam::pointFieldPMG::append
void append(const point &)
add a point at the end of the list
Definition: pointFieldPMGI.H:98
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::DynList< label >
Foam::meshSurfacePartitioner
Definition: meshSurfacePartitioner.H:52
Foam::meshSurfaceEngine::edges
const edgeList & edges() const
Definition: meshSurfaceEngineI.H:296
Foam::help::angleBetweenFaces
scalar angleBetweenFaces(const pointField &points, const Face1 &f1, const Face2 &f2)
angle between the two faces in radians
Definition: helperFunctionsGeometryQueriesI.H:132
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:405
Foam::boundaryLayers::clearOut
void clearOut()
delete meshSurfaceEngine
Definition: boundaryLayers.H:225
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::polyMeshGenModifier
Definition: polyMeshGenModifier.H:52
Foam::List::setSize
void setSize(const label)
Reset size of List.
Foam::Pstream::gatherList
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Definition: gatherScatterList.C:49
Foam::sumOp
Definition: ops.H:162
Foam::Pair< label >
Foam::boundaryLayers::treatPatchesWithPatch_
List< DynList< label > > treatPatchesWithPatch_
extrude patches with patch
Definition: boundaryLayers.H:92
Foam::polyMeshGen2DEngine
Definition: polyMeshGen2DEngine.H:51
helperFunctions.H
Foam::boundaryLayers::createOTopologyLayers
void createOTopologyLayers()
create O-topology layers (used as flag)
Definition: boundaryLayers.C:594
Foam::labelledPoint
Definition: labelledPoint.H:50
f
labelList f(nPoints)
Foam::boundaryLayers::meshPartitionerPtr_
meshSurfacePartitioner * meshPartitionerPtr_
poiner to meshSurfacePartitioner
Definition: boundaryLayers.H:69
Foam::Vector< scalar >
Foam::boundaryLayers::treatedPatch_
boolList treatedPatch_
Definition: boundaryLayers.H:89
Foam::polyMeshGenFaces::boundaries
const PtrList< boundaryPatch > & boundaries() const
ordinary boundaries
Definition: polyMeshGenFacesI.H:111
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::polyMeshGen::write
void write() const
Definition: polyMeshGen.C:126
Foam::boundaryLayers::activate2DMode
void activate2DMode()
Definition: boundaryLayers.C:604
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::List::clear
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:379
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::HashSet::insert
bool insert(const Key &key)
Insert a new entry.
Definition: HashSet.H:116
Foam::PtrList::setSize
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Definition: PtrList.C:142
Foam::boundaryLayers::patchWiseLayers_
bool patchWiseLayers_
Definition: boundaryLayers.H:73
Foam::meshSurfaceEngine::boundaryPoints
const labelList & boundaryPoints() const
Definition: meshSurfaceEngineI.H:84
Foam::polyMeshGenFaces::addFaceToSubset
void addFaceToSubset(const label, const label)
Definition: polyMeshGenFacesI.H:117
patches
patches[0]
Definition: createSingleCellMesh.H:36
Foam::boundaryLayers::createNewVertices
void createNewVertices(const boolList &treatPatches)
create new vertices for the selected patches
Definition: boundaryLayersCreateVertices.C:317
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Foam::DynList::size
label size() const
Definition: DynListI.H:235
Foam::meshSurfaceEngine::globalToLocalBndPointAddressing
const Map< label > & globalToLocalBndPointAddressing() const
global point label to local label. Only for processors points
Definition: meshSurfaceEngineI.H:431
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::boundaryLayers::createNewFacesAndCells
void createNewFacesAndCells(const boolList &treatPatches)
create a layer of cells
Definition: boundaryLayersFacesAndCells.C:45
Foam::point
vector point
Point is a vector.
Definition: point.H:41
Foam::meshSurfaceEngine::otherEdgeFacePatch
const Map< label > & otherEdgeFacePatch() const
Definition: meshSurfaceEngineI.H:588
Foam::meshSurfacePartitioner::corners
const labelHashSet & corners() const
return labels of corner points (from the list of boundary points)
Definition: meshSurfacePartitioner.H:129
Foam::pointFieldPMG
Definition: pointFieldPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::boundaryLayers::surfacePartitioner
const meshSurfacePartitioner & surfacePartitioner() const
return const reference to meshSurfacePartitioner
Definition: boundaryLayers.C:62
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
boundaryLayers.H
Foam::meshSurfaceEngine
Definition: meshSurfaceEngine.H:54
Foam::boundaryLayers::msePtr_
meshSurfaceEngine * msePtr_
pointer to mesh surface engine
Definition: boundaryLayers.H:66
meshSurfacePartitioner.H
Foam::labelledPoint::pointLabel
label pointLabel() const
return point label
Definition: labelledPoint.H:82
Foam::DynList::append
void append(const T &e)
Append an element at the end of the list.
Definition: DynListI.H:304