partTetMesh.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 "demandDrivenData.H"
29 #include "partTetMesh.H"
30 #include "polyMeshGenModifier.H"
31 #include "VRWGraphList.H"
32 #include "polyMeshGenAddressing.H"
33 #include "helperFunctions.H"
34 
35 #include <map>
36 
37 # ifdef USE_OMP
38 #include <omp.h>
39 # endif
40 
41 //#define DEBUGSmooth
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
51 :
52  origMesh_(mesh),
53  points_(),
54  tets_(),
55  nodeLabelInOrigMesh_(),
56  smoothVertex_(),
57  pointTets_(),
58  internalPointsOrderPtr_(NULL),
59  boundaryPointsOrderPtr_(NULL),
60  globalPointLabelPtr_(NULL),
61  pAtProcsPtr_(NULL),
62  globalToLocalPointAddressingPtr_(NULL),
63  neiProcsPtr_(NULL),
64  pAtParallelBoundariesPtr_(NULL),
65  pAtBufferLayersPtr_(NULL)
66 {
67  List<direction> useCell(mesh.cells().size(), direction(1));
68 
69  boolList lockedPoint(mesh.points().size(), false);
70  forAll(lockedPoints, i)
71  lockedPoint[lockedPoints[i]] = true;
72 
73  createPointsAndTets(useCell, lockedPoint);
74 }
75 
77 (
79  const labelLongList& lockedPoints,
80  const direction nLayers
81 )
82 :
83  origMesh_(mesh),
84  points_(),
85  tets_(),
86  nodeLabelInOrigMesh_(),
87  smoothVertex_(),
88  pointTets_(),
89  internalPointsOrderPtr_(NULL),
90  boundaryPointsOrderPtr_(NULL),
91  globalPointLabelPtr_(NULL),
92  pAtProcsPtr_(NULL),
93  globalToLocalPointAddressingPtr_(NULL),
94  neiProcsPtr_(NULL),
95  pAtParallelBoundariesPtr_(NULL),
96  pAtBufferLayersPtr_(NULL)
97 {
98  const faceListPMG& faces = mesh.faces();
99  const cellListPMG& cells = mesh.cells();
100  const labelList& owner = mesh.owner();
101  const PtrList<boundaryPatch>& boundaries = mesh.boundaries();
102  const VRWGraph& pointCells = mesh.addressingData().pointCells();
103 
104  List<direction> useCell(cells.size(), direction(0));
105 
106  //- select cells containing at least one vertex of the bad faces
107  forAll(boundaries, patchI)
108  {
109  const label start = boundaries[patchI].patchStart();
110  const label size = boundaries[patchI].patchSize();
111 
112  for(label fI=0;fI<size;++fI)
113  {
114  useCell[owner[start+fI]] = 1;
115  }
116  }
117 
118  //- add additional layer of cells
119  for(direction layerI=1;layerI<(nLayers+1);++layerI)
120  {
121  forAll(useCell, cI)
122  if( useCell[cI] == layerI )
123  {
124  const cell& c = cells[cI];
125 
126  forAll(c, fI)
127  {
128  const face& f = faces[c[fI]];
129 
130  forAll(f, pI)
131  {
132  forAllRow(pointCells, f[pI], pcI)
133  {
134  const label cLabel = pointCells(f[pI], pcI);
135  if( !useCell[cLabel] )
136  useCell[cLabel] = layerI + 1;
137  }
138  }
139  }
140  }
141 
142  if( Pstream::parRun() )
143  {
144  const labelLongList& globalPointLabel =
145  mesh.addressingData().globalPointLabel();
146  const VRWGraph& pProcs = mesh.addressingData().pointAtProcs();
147  const Map<label>& globalToLocal =
148  mesh.addressingData().globalToLocalPointAddressing();
149 
150  std::map<label, LongList<label> > eData;
151  forAllConstIter(Map<label>, globalToLocal, iter)
152  {
153  const label pointI = iter();
154 
155  forAllRow(pProcs, pointI, procI)
156  {
157  const label neiProc = pProcs(pointI, procI);
158  if( neiProc == Pstream::myProcNo() )
159  continue;
160 
161  if( eData.find(neiProc) == eData.end() )
162  {
163  eData.insert
164  (
165  std::make_pair(neiProc, LongList<label>())
166  );
167  }
168 
169  forAllRow(pointCells, pointI, pcI)
170  if( useCell[pointCells(pointI, pcI)] == layerI )
171  {
172  eData[neiProc].append(globalPointLabel[pointI]);
173  break;
174  }
175  }
176  }
177 
178  //- exchange data with other processors
179  labelLongList receivedData;
180  help::exchangeMap(eData, receivedData);
181 
182  forAll(receivedData, i)
183  {
184  const label pointI = globalToLocal[receivedData[i]];
185 
186  forAllRow(pointCells, pointI, pcI)
187  {
188  const label cLabel = pointCells(pointI, pcI);
189  if( !useCell[cLabel] )
190  useCell[cLabel] = layerI + 1;
191  }
192  }
193  }
194  }
195 
196  boolList lockedPoint(mesh.points().size(), false);
197  forAll(lockedPoints, i)
198  lockedPoint[lockedPoints[i]] = true;
199 
200  createPointsAndTets(useCell, lockedPoint);
201 }
202 
204 (
205  polyMeshGen& mesh,
206  const labelLongList& lockedPoints,
207  labelHashSet& badFaces,
208  const direction additionalLayers
209 )
210 :
211  origMesh_(mesh),
212  points_(),
213  tets_(),
214  nodeLabelInOrigMesh_(),
215  smoothVertex_(),
216  pointTets_(),
217  internalPointsOrderPtr_(NULL),
218  boundaryPointsOrderPtr_(NULL),
219  globalPointLabelPtr_(NULL),
220  pAtProcsPtr_(NULL),
221  globalToLocalPointAddressingPtr_(NULL),
222  neiProcsPtr_(NULL),
223  pAtParallelBoundariesPtr_(NULL),
224  pAtBufferLayersPtr_(NULL)
225 {
226  const faceListPMG& faces = mesh.faces();
227  const cellListPMG& cells = mesh.cells();
228  const VRWGraph& pointCells = mesh.addressingData().pointCells();
229 
230  List<direction> useCell(cells.size(), direction(0));
231 
232  //- select cells containing at least one vertex of the bad faces
233  forAll(faces, faceI)
234  if( badFaces.found(faceI) )
235  {
236  const face& f = faces[faceI];
237 
238  forAll(f, pI)
239  {
240  forAllRow(pointCells, f[pI], pcI)
241  useCell[pointCells(f[pI], pcI)] = 1;
242  }
243  }
244 
245  //- add additional layer of cells
246  for(direction layerI=1;layerI<(additionalLayers+1);++layerI)
247  {
248  forAll(useCell, cI)
249  if( useCell[cI] == layerI )
250  {
251  const cell& c = cells[cI];
252 
253  forAll(c, fI)
254  {
255  const face& f = faces[c[fI]];
256 
257  forAll(f, pI)
258  {
259  forAllRow(pointCells, f[pI], pcI)
260  {
261  const label cLabel = pointCells(f[pI], pcI);
262  if( !useCell[cLabel] )
263  useCell[cLabel] = layerI + 1;
264  }
265  }
266  }
267  }
268 
269  if( Pstream::parRun() )
270  {
271  const labelLongList& globalPointLabel =
272  mesh.addressingData().globalPointLabel();
273  const VRWGraph& pProcs = mesh.addressingData().pointAtProcs();
274  const Map<label>& globalToLocal =
275  mesh.addressingData().globalToLocalPointAddressing();
276 
277  std::map<label, LongList<label> > eData;
278  forAllConstIter(Map<label>, globalToLocal, iter)
279  {
280  const label pointI = iter();
281 
282  forAllRow(pProcs, pointI, procI)
283  {
284  const label neiProc = pProcs(pointI, procI);
285  if( neiProc == Pstream::myProcNo() )
286  continue;
287 
288  if( eData.find(neiProc) == eData.end() )
289  {
290  eData.insert
291  (
292  std::make_pair(neiProc, LongList<label>())
293  );
294  }
295 
296  forAllRow(pointCells, pointI, pcI)
297  if( useCell[pointCells(pointI, pcI)] == layerI )
298  {
299  eData[neiProc].append(globalPointLabel[pointI]);
300  break;
301  }
302  }
303  }
304 
305  //- exchange data with other processors
306  labelLongList receivedData;
307  help::exchangeMap(eData, receivedData);
308 
309  forAll(receivedData, i)
310  {
311  const label pointI = globalToLocal[receivedData[i]];
312 
313  forAllRow(pointCells, pointI, pcI)
314  {
315  const label cLabel = pointCells(pointI, pcI);
316  if( !useCell[cLabel] )
317  useCell[cLabel] = layerI + 1;
318  }
319  }
320  }
321  }
322 
323  boolList lockedPoint(mesh.points().size(), false);
324  forAll(lockedPoints, i)
325  lockedPoint[lockedPoints[i]] = true;
326 
327  createPointsAndTets(useCell, lockedPoint);
328 }
329 
331 {
340 }
341 
342 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
343 
345 {
346  # ifdef USE_OMP
347  if( omp_in_parallel() )
348  {
350  (
351  "const VRWGraph& partTetMesh::internalPointOrdering() const"
352  ) << "Calculating addressing inside a parallel region."
353  << " This is not thread safe" << exit(FatalError);
354  }
355  # endif
356 
359 
360  return *internalPointsOrderPtr_;
361 }
362 
364 {
365  # ifdef USE_OMP
366  if( omp_in_parallel() )
367  {
369  (
370  "const VRWGraph& partTetMesh::boundaryPointOrdering() const"
371  ) << "Calculating addressing inside a parallel region."
372  << " This is not thread safe" << exit(FatalError);
373  }
374  # endif
375 
378 
379  return *boundaryPointsOrderPtr_;
380 }
381 void partTetMesh::updateVertex(const label pointI, const point& newP)
382 {
383  points_[pointI] = newP;
384 
385  if( smoothVertex_[pointI] & (FACECENTRE+CELLCENTRE) )
386  {
387  Warning << "Smoothing auxiliary vertex."
388  << " This has no effect on the original mesh" << endl;
389  return;
390  }
391 
392  //- find face centres attached
393  DynList<label, 64> helper;
394  forAllRow(pointTets_, pointI, ptI)
395  {
396  const label centreI = tets_[pointTets_(pointI, ptI)][2];
397  if( smoothVertex_[centreI] & FACECENTRE )
398  helper.appendIfNotIn(centreI);
399  }
400 
401  //- update coordinates of FACECENTRE vertices
402  forAll(helper, i)
403  {
404  const label centreI = helper[i];
405 
406  point centre(vector::zero);
407  scalar faceArea(0.0);
408  forAllRow(pointTets_, centreI, ptI)
409  {
410  const partTet& tet = tets_[pointTets_(centreI, ptI)];
412  for(label i=0;i<3;++i)
413  c += points_[tet[i]];
414  c /= 3;
415  const scalar area = Foam::mag(tet.Sd(points_)) + VSMALL;
416 
417  centre += c * area;
418  faceArea += area;
419  }
420 
421  points_[centreI] = centre / faceArea;
422  }
423 
424  //- find cell centres attached
425  helper.clear();
426  forAllRow(pointTets_, pointI, ptI)
427  {
428  const label centreI = tets_[pointTets_(pointI, ptI)][3];
429  if( smoothVertex_[centreI] & CELLCENTRE )
430  helper.appendIfNotIn(centreI);
431  }
432 
433  //- update coordinates of CELLCENTRE vertices
434  forAll(helper, i)
435  {
436  const label centreI = helper[i];
437 
438  point centre(vector::zero);
439  scalar cellVol(0.0);
440  forAllRow(pointTets_, centreI, ptI)
441  {
442  const partTet& tet = tets_[pointTets_(centreI, ptI)];
443  const point c = tet.centroid(points_);
444  const scalar vol = Foam::mag(tet.mag(points_)) + VSMALL;
445 
446  centre += c * vol;
447  cellVol += vol;
448  }
449 
450  points_[centreI] = centre / cellVol;
451  }
452 }
453 
455 {
456  List<direction> updateType(points_.size(), direction(0));
457 
458  # ifdef USE_OMP
459  # pragma omp parallel num_threads(np.size())
460  # endif
461  {
462  # ifdef USE_OMP
463  const LongList<labelledPoint>& newPoints = np[omp_get_thread_num()];
464  # else
465  const LongList<labelledPoint>& newPoints = np[0];
466  # endif
467 
468  forAll(newPoints, i)
469  {
470  const labelledPoint& lp = newPoints[i];
471  const label pointI = lp.pointLabel();
472 
473  points_[pointI] = lp.coordinates();
474 
475  forAllRow(pointTets_, pointI, ptI)
476  {
477  const partTet& pt = tets_[pointTets_(pointI, ptI)];
478 
479  if( smoothVertex_[pt[3]] & CELLCENTRE )
480  updateType[pt[3]] |= CELLCENTRE;
481  if( smoothVertex_[pt[2]] & FACECENTRE )
482  updateType[pt[2]] |= FACECENTRE;
483  }
484  }
485 
486  # ifdef USE_OMP
487  # pragma omp barrier
488 
489  # pragma omp flush(updateType)
490 
491  //- update coordinates of CELLCENTRE and FACECENTRE vertices
492  # pragma omp for schedule(dynamic, 20)
493  # endif
494  forAll(updateType, pI)
495  {
496  if( updateType[pI] & CELLCENTRE )
497  {
498  point centre(vector::zero);
499  scalar cellVol(0.0);
500  forAllRow(pointTets_, pI, ptI)
501  {
502  const partTet& tet = tets_[pointTets_(pI, ptI)];
503  const point c = tet.centroid(points_);
504  const scalar vol = Foam::mag(tet.mag(points_)) + VSMALL;
505 
506  centre += c * vol;
507  cellVol += vol;
508  }
509 
510  points_[pI] = centre / cellVol;
511  }
512  else if( updateType[pI] & FACECENTRE )
513  {
514  point centre(vector::zero);
515  scalar faceArea(0.0);
516  forAllRow(pointTets_, pI, ptI)
517  {
518  const partTet& tet = tets_[pointTets_(pI, ptI)];
520  for(label i=0;i<3;++i)
521  c += points_[tet[i]];
522  c /= 3;
523  const scalar area = Foam::mag(tet.Sd(points_)) + VSMALL;
524 
525  centre += c * area;
526  faceArea += area;
527  }
528 
529  points_[pI] = centre / faceArea;
530  }
531  }
532  }
533 }
534 
536 {
537  pointFieldPMG& pts = origMesh_.points();
538 
539  boolList changedNode(pts.size(), false);
540 
541  # ifdef USE_OMP
542  # pragma omp parallel for if( pts.size() > 1000 ) \
543  schedule(guided, 10)
544  # endif
546  if( nodeLabelInOrigMesh_[pI] != -1 )
547  {
548  changedNode[nodeLabelInOrigMesh_[pI]] = true;
549  pts[nodeLabelInOrigMesh_[pI]] = points_[pI];
550  }
551 
552  if( changedFacePtr )
553  {
554  boolList& chF = *changedFacePtr;
555  chF = false;
556 
557  const cellListPMG& cells = origMesh_.cells();
558  const VRWGraph& pointCells = origMesh_.addressingData().pointCells();
559 
560  # ifdef USE_OMP
561  # pragma omp parallel for if( pointCells.size() > 100 ) \
562  schedule(dynamic, 20)
563  # endif
564  forAll(pointCells, pointI)
565  {
566  if( changedNode[pointI] )
567  {
568  forAllRow(pointCells, pointI, pcI)
569  {
570  const cell& c = cells[pointCells(pointI, pcI)];
571 
572  forAll(c, fI)
573  chF[c[fI]] = true;
574  }
575  }
576  }
577 
578  //- make sure that neighbouring processors get the same information
580  forAll(pBnd, patchI)
581  {
582  const label start = pBnd[patchI].patchStart();
583  const label size = pBnd[patchI].patchSize();
584 
585  labelLongList sendData;
586  for(label faceI=0;faceI<size;++faceI)
587  {
588  if( chF[start+faceI] )
589  sendData.append(faceI);
590  }
591 
592  OPstream toOtherProc
593  (
595  pBnd[patchI].neiProcNo(),
596  sendData.byteSize()
597  );
598 
599  toOtherProc << sendData;
600  }
601 
602  forAll(pBnd, patchI)
603  {
604  labelList receivedData;
605 
606  IPstream fromOtherProc
607  (
609  pBnd[patchI].neiProcNo()
610  );
611 
612  fromOtherProc >> receivedData;
613 
614  const label start = pBnd[patchI].patchStart();
615  forAll(receivedData, i)
616  chF[start+receivedData[i]] = true;
617  }
618 
619  //- update geometry information
620  const_cast<polyMeshGenAddressing&>
621  (
623  ).updateGeometry(chF);
624  }
625  else
626  {
627  const_cast<polyMeshGenAddressing&>
628  (
630  ).clearGeom();
631  }
632 }
633 
635 {
636  polyMeshGenModifier meshModifier(pmg);
637 
638  pointFieldPMG& pAccess = meshModifier.pointsAccess();
639  pAccess.setSize(points_.size());
640  forAll(points_, pI)
641  pAccess[pI] = points_[pI];
642 
643  VRWGraphList cellFaces;
644 
645  forAll(tets_, tetI)
646  {
647  const partTet& tet = tets_[tetI];
648 
649  FixedList<FixedList<label, 3>, 4> tetFaces;
650 
651  //- face 0
652  tetFaces[0][0] = tet[0];
653  tetFaces[0][1] = tet[2];
654  tetFaces[0][2] = tet[1];
655 
656  //- face 1
657  tetFaces[1][0] = tet[0];
658  tetFaces[1][1] = tet[1];
659  tetFaces[1][2] = tet[3];
660 
661  //- face 2
662  tetFaces[2][0] = tet[0];
663  tetFaces[2][1] = tet[3];
664  tetFaces[2][2] = tet[2];
665 
666  //- face 3
667  tetFaces[3][0] = tet[1];
668  tetFaces[3][1] = tet[2];
669  tetFaces[3][2] = tet[3];
670 
671  cellFaces.appendGraph(tetFaces);
672  }
673 
674  meshModifier.addCells(cellFaces);
675  meshModifier.reorderBoundaryFaces();
676 
677  //- store points into subsets
678  const label bndPointID = pmg.addPointSubset("boundaryPoints");
679  const label smoothPointID = pmg.addPointSubset("smoothPoints");
680  const label faceCentreID = pmg.addPointSubset("faceCentres");
681  const label cellCentreID = pmg.addPointSubset("cellCentres");
682 
683  forAll(smoothVertex_, pointI)
684  {
685  if( smoothVertex_[pointI] & SMOOTH )
686  pmg.addPointToSubset(smoothPointID, pointI);
687  if( smoothVertex_[pointI] & BOUNDARY )
688  pmg.addPointToSubset(bndPointID, pointI);
689  if( smoothVertex_[pointI] & FACECENTRE )
690  pmg.addPointToSubset(faceCentreID, pointI);
691  if( smoothVertex_[pointI] & CELLCENTRE )
692  pmg.addPointToSubset(cellCentreID, pointI);
693  }
694 
695  const VRWGraph& internalOrdering = internalPointOrdering();
696  const VRWGraph& boundaryOrdering = boundaryPointOrdering();
697 
698  forAll(internalOrdering, i)
699  {
700  const word name = "smoothPoints_"+help::scalarToText(i);
701  const label orderID = pmg.addPointSubset(name);
702 
703  forAllRow(internalOrdering, i, nI)
704  pmg.addPointToSubset(orderID, internalOrdering(i, nI));
705  }
706 
707  forAll(boundaryOrdering, i)
708  {
709  const word name = "boundaryPoints_"+help::scalarToText(i);
710  const label orderID = pmg.addPointSubset(name);
711 
712  forAllRow(boundaryOrdering, i, nI)
713  pmg.addPointToSubset(orderID, boundaryOrdering(i, nI));
714  }
715 }
716 
717 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
718 
719 } // End namespace Foam
720 
721 // ************************************************************************* //
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:979
Foam::partTetMesh::neiProcsPtr_
DynList< label > * neiProcsPtr_
processors which should communicate with the current one
Definition: partTetMesh.H:97
Foam::polyMeshGenCells::addressingData
const polyMeshGenAddressing & addressingData() const
addressing which may be needed
Definition: polyMeshGenCells.C:327
Foam::LongList::append
void append(const T &e)
Append an element at the end of the list.
Definition: LongListI.H:265
Foam::partTetMesh::FACECENTRE
@ FACECENTRE
Definition: partTetMesh.H:162
Foam::partTetMesh::smoothVertex_
LongList< direction > smoothVertex_
shall a node be used for smoothing or not
Definition: partTetMesh.H:75
Foam::labelledPoint::coordinates
const point & coordinates() const
return point coordinates
Definition: labelledPoint.H:93
Foam::Vector< scalar >::zero
static const Vector zero
Definition: Vector.H:80
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::partTetMesh::createPolyMesh
void createPolyMesh(polyMeshGen &pmg) const
creates polyMeshGen from this partTetMesh
Definition: partTetMesh.C:634
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::partTetMesh::pAtParallelBoundariesPtr_
labelLongList * pAtParallelBoundariesPtr_
labels of points at parallel boundaries
Definition: partTetMesh.H:100
Foam::partTetMesh::boundaryPointsOrderPtr_
VRWGraph * boundaryPointsOrderPtr_
boundary point ordering for parallel runs
Definition: partTetMesh.H:84
Foam::OPstream
Output inter-processor communications stream.
Definition: OPstream.H:50
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::Warning
messageStream Warning
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::primitiveMesh::cells
const cellList & cells() const
Definition: primitiveMeshCells.C:136
polyMeshGenModifier.H
Foam::partTet
Definition: partTet.H:53
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::polyMeshGenPoints::points
const pointFieldPMG & points() const
access to points
Definition: polyMeshGenPointsI.H:44
Foam::partTetMesh::tets_
LongList< partTet > tets_
tetrahedra making the mesh
Definition: partTetMesh.H:69
Foam::polyMeshGenAddressing::pointCells
const VRWGraph & pointCells() const
Definition: polyMeshGenAddressingPointCells.C:59
Foam::partTetMesh::globalPointLabelPtr_
labelLongList * globalPointLabelPtr_
global point label
Definition: partTetMesh.H:88
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::VRWGraphList
Definition: VRWGraphList.H:51
Foam::cellListPMG
Definition: cellListPMG.H:49
Foam::polyMeshGenAddressing
Definition: polyMeshGenAddressing.H:69
Foam::HashSet< label, Hash< label > >
Foam::partTetMesh::partTetMesh
partTetMesh(polyMeshGen &mesh, const labelLongList &lockedPoints)
construct from polyMeshGen and locked points
Definition: partTetMesh.C:50
Foam::VRWGraphList::appendGraph
void appendGraph(const GraphType &l)
Append a graph at the end of the graphList.
Definition: VRWGraphListI.H:123
Foam::partTet::Sd
vector Sd(const PointField &) const
Definition: partTetI.H:140
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::LongList< label >
Foam::partTet::centroid
point centroid(const PointField &) const
Return centroid of the tetrahedron.
Definition: partTetI.H:197
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:40
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::partTetMesh::internalPointsOrderPtr_
VRWGraph * internalPointsOrderPtr_
internal point ordering for parallel runs
Definition: partTetMesh.H:81
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::polyMeshGenModifier::reorderBoundaryFaces
void reorderBoundaryFaces()
Definition: polyMeshGenModifierReorderBoundaryFaces.C:44
Foam::partTetMesh::pAtProcsPtr_
VRWGraph * pAtProcsPtr_
processor for containing points
Definition: partTetMesh.H:91
Foam::polyMeshGenCells::cells
const cellListPMG & cells() const
access to cells
Definition: polyMeshGenCellsI.H:39
Foam::partTetMesh::updateOrigMesh
void updateOrigMesh(boolList *changedFacePtr=NULL)
updates the vertices of the original polyMeshGen
Definition: partTetMesh.C:535
Foam::DynList::appendIfNotIn
void appendIfNotIn(const T &e)
Definition: DynListI.H:324
Foam::partTetMesh::createSMOOTHPointsOrdering
void createSMOOTHPointsOrdering() const
create ordering of internal points for parallel execution
Definition: partTetMeshAddressing.C:403
partTetMesh.H
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::partTetMesh::~partTetMesh
~partTetMesh()
Definition: partTetMesh.C:330
Foam::pointFieldPMG::size
label size() const
return the number of used elements
Definition: pointFieldPMGI.H:71
Foam::partTetMesh::createPointsAndTets
void createPointsAndTets(const List< direction > &usedCells, const boolList &lockedPoints)
create points and tets
Definition: partTetMeshAddressing.C:45
Foam::FatalError
error FatalError
Foam::partTetMesh::SMOOTH
@ SMOOTH
Definition: partTetMesh.H:161
Foam::polyMeshGenPoints::addPointToSubset
void addPointToSubset(const label, const label)
Definition: polyMeshGenPointsI.H:60
Foam::polyMeshGenModifier::pointsAccess
pointFieldPMG & pointsAccess()
access to mesh points
Definition: polyMeshGenModifier.H:107
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::partTetMesh::pAtBufferLayersPtr_
labelLongList * pAtBufferLayersPtr_
labels of points serving as buffer layers on other processors
Definition: partTetMesh.H:103
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList< label, 64 >
Foam::partTetMesh::globalToLocalPointAddressingPtr_
Map< label > * globalToLocalPointAddressingPtr_
mapping between global and local point labels
Definition: partTetMesh.H:94
Foam::fvMesh::owner
const labelUList & owner() const
Internal face owner.
Definition: fvMesh.H:282
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:405
Foam::partTetMesh::BOUNDARY
@ BOUNDARY
Definition: partTetMesh.H:165
Foam::polyMeshGenModifier
Definition: polyMeshGenModifier.H:52
Foam::partTet::mag
scalar mag(const PointField &) const
Return volume.
Definition: partTetI.H:154
Foam::partTetMesh::createBOUNDARYPointsOrdering
void createBOUNDARYPointsOrdering() const
create order of boundary points for parallel execution
Definition: partTetMeshAddressing.C:478
Foam::partTetMesh::CELLCENTRE
@ CELLCENTRE
Definition: partTetMesh.H:163
Foam::polyMesh::faces
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1004
Foam::partTetMesh::pointTets_
VRWGraph pointTets_
addressing data
Definition: partTetMesh.H:78
Foam::LongList::byteSize
label byteSize() const
Return the binary size in number of characters of the UList.
Definition: LongListI.H:209
helperFunctions.H
Foam::labelledPoint
Definition: labelledPoint.H:50
f
labelList f(nPoints)
Foam::Vector< scalar >
Foam::List< direction >
Foam::partTetMesh::origMesh_
polyMeshGen & origMesh_
reference to the original mesh
Definition: partTetMesh.H:63
Foam::FixedList
A 1D vector of objects of type <T> with a fixed size <Size>.
Definition: FixedList.H:53
Foam::partTetMesh::nodeLabelInOrigMesh_
labelLongList nodeLabelInOrigMesh_
label of node in the polyMeshGen
Definition: partTetMesh.H:72
Foam::help::exchangeMap
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
Definition: helperFunctionsPar.C:129
Foam::primitiveMesh::pointCells
const labelListList & pointCells() const
Definition: primitiveMeshPointCells.C:108
Foam::partTetMesh::boundaryPointOrdering
const VRWGraph & boundaryPointOrdering() const
return vertex ordering for boundary points
Definition: partTetMesh.C:363
Foam::polyMeshGenFaces::procBoundaries
const PtrList< processorBoundaryPatch > & procBoundaries() const
inter-processor boundaries
Definition: polyMeshGenFacesI.H:106
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::polyMeshGenModifier::addCells
void addCells(const LongList< faceList > &cellFaces)
add cells (vertices must be added)
Definition: polyMeshGenModifierAddCells.C:37
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::partTetMesh::internalPointOrdering
const VRWGraph & internalPointOrdering() const
Definition: partTetMesh.C:344
Foam::partTetMesh::points_
LongList< point > points_
points in the tet mesh
Definition: partTetMesh.H:66
Foam::IPstream
Input inter-processor communications stream.
Definition: IPstream.H:50
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
Foam::partTetMesh::updateVerticesSMP
void updateVerticesSMP(const List< LongList< labelledPoint > > &)
Definition: partTetMesh.C:454
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::faceListPMG
Definition: faceListPMG.H:50
Foam::pointFieldPMG
Definition: pointFieldPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
VRWGraphList.H
polyMeshGenAddressing.H
Foam::polyMeshGenPoints::addPointSubset
label addPointSubset(const word &)
point subsets
Definition: polyMeshGenPoints.C:88
Foam::cell
A cell is defined as a list of faces with extra functionality.
Definition: cell.H:56
Foam::DynList::clear
void clear()
Clear the list, i.e. set next free to zero.
Definition: DynListI.H:279
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::partTetMesh::updateVertex
void updateVertex(const label pointI, const point &newP)
move the vertex to a new position
Definition: partTetMesh.C:381
Foam::labelledPoint::pointLabel
label pointLabel() const
return point label
Definition: labelledPoint.H:82