cellShapeControlMesh.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2017 OpenFOAM Foundation
9  Copyright (C) 2016 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "cellShapeControlMesh.H"
31 #include "pointIOField.H"
32 #include "scalarIOField.H"
33 #include "triadIOField.H"
34 #include "tetPointRef.H"
35 #include "plane.H"
36 #include "transform.H"
37 #include "meshTools.H"
38 
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 defineTypeNameAndDebug(cellShapeControlMesh, 0);
44 
45 word cellShapeControlMesh::meshSubDir = "cellShapeControlMesh";
46 }
47 
48 
49 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
50 
51 //Foam::tensor Foam::cellShapeControlMesh::requiredAlignment
52 //(
53 // const Foam::point& pt,
54 // const searchableSurfaces& allGeometry,
55 // const conformationSurfaces& geometryToConformTo
56 //) const
57 //{
58 // pointIndexHit surfHit;
59 // label hitSurface;
60 //
61 // geometryToConformTo.findSurfaceNearest
62 // (
63 // pt,
64 // sqr(GREAT),
65 // surfHit,
66 // hitSurface
67 // );
68 //
69 // if (!surfHit.hit())
70 // {
71 // FatalErrorInFunction
72 // << "findSurfaceNearest did not find a hit across the surfaces."
73 // << exit(FatalError) << endl;
74 // }
75 //
76 // // Primary alignment
77 //
78 // vectorField norm(1);
79 //
80 // allGeometry[hitSurface].getNormal
81 // (
82 // List<pointIndexHit>(1, surfHit),
83 // norm
84 // );
85 //
86 // const vector np = norm[0];
87 //
88 // // Generate equally spaced 'spokes' in a circle normal to the
89 // // direction from the vertex to the closest point on the surface
90 // // and look for a secondary intersection.
91 //
92 // const vector d = surfHit.hitPoint() - pt;
93 //
94 // const tensor Rp = rotationTensor(vector(0,0,1), np);
95 //
96 // const label s = 36;//foamyHexMeshControls().alignmentSearchSpokes();
97 //
98 // scalar closestSpokeHitDistance = GREAT;
99 //
100 // pointIndexHit closestSpokeHit;
101 //
102 // label closestSpokeSurface = -1;
103 //
104 // const scalar spanMag = geometryToConformTo.globalBounds().mag();
105 //
106 // for (label i = 0; i < s; i++)
107 // {
108 // vector spoke
109 // (
110 // Foam::cos(i*constant::mathematical::twoPi/s),
111 // Foam::sin(i*constant::mathematical::twoPi/s),
112 // 0
113 // );
114 //
115 // spoke *= spanMag;
116 //
117 // spoke = Rp & spoke;
118 //
119 // pointIndexHit spokeHit;
120 //
121 // label spokeSurface = -1;
122 //
123 // // internal spoke
124 //
125 // geometryToConformTo.findSurfaceNearestIntersection
126 // (
127 // pt,
128 // pt + spoke,
129 // spokeHit,
130 // spokeSurface
131 // );
132 //
133 // if (spokeHit.hit())
134 // {
135 // scalar spokeHitDistance = mag
136 // (
137 // spokeHit.hitPoint() - pt
138 // );
139 //
140 // if (spokeHitDistance < closestSpokeHitDistance)
141 // {
142 // closestSpokeHit = spokeHit;
143 // closestSpokeSurface = spokeSurface;
144 // closestSpokeHitDistance = spokeHitDistance;
145 // }
146 // }
147 //
148 // //external spoke
149 //
150 // Foam::point mirrorPt = pt + 2*d;
151 //
152 // geometryToConformTo.findSurfaceNearestIntersection
153 // (
154 // mirrorPt,
155 // mirrorPt + spoke,
156 // spokeHit,
157 // spokeSurface
158 // );
159 //
160 // if (spokeHit.hit())
161 // {
162 // scalar spokeHitDistance = mag
163 // (
164 // spokeHit.hitPoint() - mirrorPt
165 // );
166 //
167 // if (spokeHitDistance < closestSpokeHitDistance)
168 // {
169 // closestSpokeHit = spokeHit;
170 // closestSpokeSurface = spokeSurface;
171 // closestSpokeHitDistance = spokeHitDistance;
172 // }
173 // }
174 // }
175 //
176 // if (closestSpokeSurface == -1)
177 // {
183 //
184 // return I;
185 // }
186 //
187 // // Auxiliary alignment generated by spoke intersection normal.
188 //
189 // allGeometry[closestSpokeSurface].getNormal
190 // (
191 // List<pointIndexHit>(1, closestSpokeHit),
192 // norm
193 // );
194 //
195 // const vector& na = norm[0];
196 //
197 // // Secondary alignment
198 // vector ns = np ^ na;
199 //
200 // if (mag(ns) < SMALL)
201 // {
202 // FatalErrorInFunction
203 // << "Parallel normals detected in spoke search." << nl
204 // << "point: " << pt << nl
205 // << "closest surface point: " << surfHit.hitPoint() << nl
206 // << "closest spoke hit: " << closestSpokeHit.hitPoint() << nl
207 // << "np: " << surfHit.hitPoint() + np << nl
208 // << "ns: " << closestSpokeHit.hitPoint() + na << nl
209 // << exit(FatalError);
210 // }
211 //
212 // ns /= mag(ns);
213 //
214 // tensor Rs = rotationTensor((Rp & vector(0,1,0)), ns);
215 //
216 // return (Rs & Rp);
217 //}
218 
219 
221 {
222  label nRemoved = 0;
223  for
224  (
225  CellSizeDelaunay::Finite_vertices_iterator vit =
226  finite_vertices_begin();
227  vit != finite_vertices_end();
228  ++vit
229  )
230  {
231  std::list<Vertex_handle> verts;
232  adjacent_vertices(vit, std::back_inserter(verts));
233 
234  bool removePt = true;
235  for
236  (
237  std::list<Vertex_handle>::iterator aVit = verts.begin();
238  aVit != verts.end();
239  ++aVit
240  )
241  {
242  Vertex_handle avh = *aVit;
243 
244  scalar diff =
245  mag(avh->targetCellSize() - vit->targetCellSize())
246  /max(vit->targetCellSize(), 1e-6);
247 
248  if (diff > 0.05)
249  {
250  removePt = false;
251  }
252  }
253 
254  if (removePt)
255  {
256  remove(vit);
257  nRemoved++;
258  }
259  }
260 
261  return nRemoved;
262 }
263 
264 
266 {
267  tmp<pointField> tcellCentres(new pointField(number_of_finite_cells()));
268  pointField& cellCentres = tcellCentres.ref();
269 
270  label count = 0;
271  for
272  (
273  CellSizeDelaunay::Finite_cells_iterator c = finite_cells_begin();
274  c != finite_cells_end();
275  ++c
276  )
277  {
278  if (c->hasFarPoint())
279  {
280  continue;
281  }
282 
283  scalarList bary;
285 
286  const Foam::point centre = topoint
287  (
288  CGAL::centroid<baseK>
289  (
290  c->vertex(0)->point(),
291  c->vertex(1)->point(),
292  c->vertex(2)->point(),
293  c->vertex(3)->point()
294  )
295  );
296 
297  cellCentres[count++] = centre;
298  }
299 
300  cellCentres.resize(count);
301 
302  return tcellCentres;
303 }
304 
305 
307 {
308  OFstream str
309  (
310  "refinementTriangulation_"
312  + ".obj"
313  );
314 
315  label count = 0;
316 
317  Info<< "Write refinementTriangulation" << endl;
318 
319  for
320  (
321  CellSizeDelaunay::Finite_edges_iterator e = finite_edges_begin();
322  e != finite_edges_end();
323  ++e
324  )
325  {
326  Cell_handle c = e->first;
327  Vertex_handle vA = c->vertex(e->second);
328  Vertex_handle vB = c->vertex(e->third);
329 
330  // Don't write far edges
331  if (vA->farPoint() || vB->farPoint())
332  {
333  continue;
334  }
335 
336  // Don't write unowned edges
337  if (vA->referred() && vB->referred())
338  {
339  continue;
340  }
341 
342  pointFromPoint p1 = topoint(vA->point());
343  pointFromPoint p2 = topoint(vB->point());
344 
345  meshTools::writeOBJ(str, p1, p2, count);
346  }
347 
348  if (is_valid())
349  {
350  Info<< " Triangulation is valid" << endl;
351  }
352  else
353  {
355  << "Triangulation is not valid"
356  << abort(FatalError);
357  }
358 }
359 
360 
361 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
362 
363 Foam::cellShapeControlMesh::cellShapeControlMesh(const Time& runTime)
364 :
365  DistributedDelaunayMesh<CellSizeDelaunay>
366  (
367  runTime,
368  meshSubDir
369  ),
370  runTime_(runTime),
371  defaultCellSize_(0.0)
372 {
373  if (this->vertexCount())
374  {
375  fvMesh mesh
376  (
377  IOobject
378  (
379  meshSubDir,
380  runTime.timeName(),
381  runTime,
384  )
385  );
386 
387  if (mesh.nPoints() == this->vertexCount())
388  {
389  IOobject io
390  (
391  "sizes",
392  runTime.timeName(),
393  meshSubDir,
394  runTime,
397  false
398  );
399 
400  if (io.typeHeaderOk<pointScalarField>(true))
401  {
403 
404  triadIOField alignments
405  (
406  IOobject
407  (
408  "alignments",
409  mesh.time().timeName(),
410  meshSubDir,
411  mesh.time(),
414  false
415  )
416  );
417 
418  if (alignments.size() == this->vertexCount())
419  {
420  for
421  (
422  Finite_vertices_iterator vit = finite_vertices_begin();
423  vit != finite_vertices_end();
424  ++vit
425  )
426  {
427  vit->targetCellSize() = sizes[vit->index()];
428  vit->alignment() = alignments[vit->index()];
429  }
430  }
431  else
432  {
434  << "Cell alignments point field " << alignments.size()
435  << " is not the same size as the number of vertices"
436  << " in the mesh " << this->vertexCount()
437  << abort(FatalError);
438  }
439  }
440  }
441  }
442 }
443 
444 
445 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
446 
448 {}
449 
450 
451 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
452 
454 (
455  const Foam::point& pt,
456  barycentric& bary,
457  Cell_handle& ch
458 ) const
459 {
460  // Use the previous cell handle as a hint on where to start searching
461  // Giving a hint causes strange errors...
462  ch = locate(toPoint(pt));
463 
464  if (dimension() > 2 && !is_infinite(ch))
465  {
466  oldCellHandle_ = ch;
467 
468  tetPointRef tet
469  (
470  topoint(ch->vertex(0)->point()),
471  topoint(ch->vertex(1)->point()),
472  topoint(ch->vertex(2)->point()),
473  topoint(ch->vertex(3)->point())
474  );
475 
476  bary = tet.pointToBarycentric(pt);
477  }
478 }
479 
480 
482 {
483  DynamicList<Foam::point> pts(number_of_vertices());
484 
485  for
486  (
487  Finite_vertices_iterator vit = finite_vertices_begin();
488  vit != finite_vertices_end();
489  ++vit
490  )
491  {
492  if (vit->real())
493  {
494  pts.append(topoint(vit->point()));
495  }
496  }
497 
498  boundBox bb(pts);
499 
500  return bb;
501 }
502 
503 
505 (
506  const backgroundMeshDecomposition& decomposition
507 )
508 {
509  DynamicList<Foam::point> points(number_of_vertices());
510  DynamicList<scalar> sizes(number_of_vertices());
511  DynamicList<tensor> alignments(number_of_vertices());
512 
513  DynamicList<Vb> farPts(8);
514 
515  for
516  (
517  Finite_vertices_iterator vit = finite_vertices_begin();
518  vit != finite_vertices_end();
519  ++vit
520  )
521  {
522  if (vit->real())
523  {
524  points.append(topoint(vit->point()));
525  sizes.append(vit->targetCellSize());
526  alignments.append(vit->alignment());
527  }
528  else if (vit->farPoint())
529  {
530  farPts.append
531  (
532  Vb
533  (
534  vit->point(),
535  -1,
536  Vb::vtFar,
538  )
539  );
540 
541  farPts.last().targetCellSize() = vit->targetCellSize();
542  farPts.last().alignment() = vit->alignment();
543  }
544  }
545 
546  autoPtr<mapDistribute> mapDist =
548  (
549  decomposition,
550  points
551  );
552 
553  mapDist().distribute(sizes);
554  mapDist().distribute(alignments);
555 
556  // Reset the entire tessellation
558 
559 
560  // Internal points have to be inserted first
561  DynamicList<Vb> verticesToInsert(points.size());
562 
563 
564  forAll(farPts, ptI)
565  {
566  verticesToInsert.append(farPts[ptI]);
567  }
568 
569 
570  forAll(points, pI)
571  {
572  verticesToInsert.append
573  (
574  Vb
575  (
576  toPoint(points[pI]),
577  -1,
578  Vb::vtInternal,
580  )
581  );
582 
583  verticesToInsert.last().targetCellSize() = sizes[pI];
584  verticesToInsert.last().alignment() = alignments[pI];
585  }
586 
587  Info<< nl << " Inserting distributed background tessellation..." << endl;
588 
589  this->rangeInsertWithInfo
590  (
591  verticesToInsert.begin(),
592  verticesToInsert.end(),
593  true
594  );
595 
596  sync(decomposition.procBounds());
597 
598  Info<< " Total number of vertices after redistribution "
599  << returnReduce(label(number_of_vertices()), sumOp<label>()) << endl;
600 }
601 
602 
604 {
605  tensorField alignmentsTmp(number_of_vertices(), Zero);
606 
607  label count = 0;
608  for
609  (
610  Finite_vertices_iterator vit = finite_vertices_begin();
611  vit != finite_vertices_end();
612  ++vit
613  )
614  {
615  alignmentsTmp[count++] = vit->alignment();
616  }
617 
618  return alignmentsTmp;
619 }
620 
621 
623 {
624  Info<< "Writing " << meshSubDir << endl;
625 
626  // Reindex the cells
627  label cellCount = 0;
628  for
629  (
630  Finite_cells_iterator cit = finite_cells_begin();
631  cit != finite_cells_end();
632  ++cit
633  )
634  {
635  if (!cit->hasFarPoint() && !is_infinite(cit))
636  {
637  cit->cellIndex() = cellCount++;
638  }
639  }
640 
641  labelPairLookup vertexMap;
642  labelList cellMap;
643 
645  (
646  meshSubDir,
647  vertexMap,
648  cellMap
649  );
650  const polyMesh& mesh = meshPtr();
651 
652  pointScalarField sizes
653  (
654  IOobject
655  (
656  "sizes",
657  mesh.time().timeName(),
658  meshSubDir,
659  mesh.time(),
662  ),
665  );
666 
667  triadIOField alignments
668  (
669  IOobject
670  (
671  "alignments",
672  mesh.time().timeName(),
673  meshSubDir,
674  mesh.time(),
677  ),
678  sizes.size()
679  );
680 
681  // Write alignments
682 // OFstream str(runTime_.path()/"alignments.obj");
683 
684  for
685  (
686  Finite_vertices_iterator vit = finite_vertices_begin();
687  vit != finite_vertices_end();
688  ++vit
689  )
690  {
691  if (!vit->farPoint())
692  {
693  // Populate sizes
694  sizes[vertexMap[labelPair(vit->index(), vit->procIndex())]] =
695  vit->targetCellSize();
696 
697  alignments[vertexMap[labelPair(vit->index(), vit->procIndex())]] =
698  vit->alignment();
699 
700 // // Write alignments
701 // const tensor& alignment = vit->alignment();
702 // pointFromPoint pt = topoint(vit->point());
703 //
704 // if
705 // (
706 // alignment.x() == triad::unset[0]
707 // || alignment.y() == triad::unset[0]
708 // || alignment.z() == triad::unset[0]
709 // )
710 // {
711 // Info<< "Bad alignment = " << vit->info();
712 //
713 // vit->alignment() = tensor::I;
714 //
715 // Info<< "New alignment = " << vit->info();
716 //
717 // continue;
718 // }
719 //
720 // meshTools::writeOBJ(str, pt, alignment.x() + pt);
721 // meshTools::writeOBJ(str, pt, alignment.y() + pt);
722 // meshTools::writeOBJ(str, pt, alignment.z() + pt);
723  }
724  }
725 
726  mesh.write();
727  sizes.write();
728  alignments.write();
729 }
730 
731 
733 (
734  const autoPtr<backgroundMeshDecomposition>& decomposition
735 ) const
736 {
737  // Loop over all the tets and estimate the cell count in each one
738 
739  scalar cellCount = 0;
740 
741  for
742  (
743  Finite_cells_iterator cit = finite_cells_begin();
744  cit != finite_cells_end();
745  ++cit
746  )
747  {
748  if (!cit->hasFarPoint() && !is_infinite(cit))
749  {
750  // TODO: Check if tet centre is on the processor..
751  CGAL::Tetrahedron_3<baseK> tet
752  (
753  cit->vertex(0)->point(),
754  cit->vertex(1)->point(),
755  cit->vertex(2)->point(),
756  cit->vertex(3)->point()
757  );
758 
759  pointFromPoint centre = topoint(CGAL::centroid(tet));
760 
761  if
762  (
764  && !decomposition().positionOnThisProcessor(centre)
765  )
766  {
767  continue;
768  }
769 
770  scalar volume = CGAL::to_double(tet.volume());
771 
772  scalar averagedPointCellSize = 0;
773  //scalar averagedPointCellSize = 1;
774 
775  // Get an average volume by averaging the cell size of the vertices
776  for (label vI = 0; vI < 4; ++vI)
777  {
778  averagedPointCellSize += cit->vertex(vI)->targetCellSize();
779  //averagedPointCellSize *= cit->vertex(vI)->targetCellSize();
780  }
781 
782  averagedPointCellSize /= 4;
783  //averagedPointCellSize = ::sqrt(averagedPointCellSize);
784 
785 // if (averagedPointCellSize < SMALL)
786 // {
787 // Pout<< "Volume = " << volume << endl;
788 //
789 // for (label vI = 0; vI < 4; ++vI)
790 // {
791 // Pout<< "Point " << vI
792 // << ", point = " << topoint(cit->vertex(vI)->point())
793 // << ", size = " << cit->vertex(vI)->targetCellSize()
794 // << endl;
795 // }
796 // }
797 
798  cellCount += volume/pow(averagedPointCellSize, 3);
799  }
800  }
801 
802  return cellCount;
803 }
804 
805 
806 // ************************************************************************* //
cellSizeAndAlignmentControls.H
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
runTime
engineTime & runTime
Definition: createEngineTime.H:13
meshTools.H
Foam::scalarList
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:64
meshPtr
Foam::autoPtr< Foam::fvMesh > meshPtr(nullptr)
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::cellShapeControlMesh::dumpAlignments
tensorField dumpAlignments() const
Foam::fvMesh::write
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
Definition: fvMesh.C:895
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
Foam::cellShapeControlMesh::~cellShapeControlMesh
~cellShapeControlMesh()
Destructor.
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::cellShapeControlMesh::estimateCellCount
label estimateCellCount(const autoPtr< backgroundMeshDecomposition > &decomposition) const
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::meshTools::writeOBJ
void writeOBJ(Ostream &os, const point &pt)
Write obj representation of a point.
Definition: meshTools.C:203
Foam::DelaunayMesh::createMesh
autoPtr< polyMesh > createMesh(const fileName &name, labelPairLookup &vertexMap, labelList &cellMap, const bool writeDelaunayData=true) const
Create an fvMesh from the triangulation.
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:415
Foam::MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
Definition: MeshObject.C:48
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:785
CGAL::indexedVertex
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:54
Foam::tensorField
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Definition: primitiveFieldsFwd.H:57
Foam::cellShapeControlMesh::write
void write() const
pointIOField.H
tetPointRef.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::fieldTypes::volume
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
scalarIOField.H
Foam::topoint
pointFromPoint topoint(const Point &P)
Definition: pointConversion.H:72
Foam::tetPointRef
tetrahedron< point, const point & > tetPointRef
Definition: tetPointRef.H:46
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::cellShapeControlMesh::removePoints
label removePoints()
Foam::labelPair
Pair< label > labelPair
A pair of labels.
Definition: Pair.H:54
Foam::diff
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
Definition: triad.C:378
Foam::Field< tensor >
Foam::cellShapeControlMesh::barycentricCoords
void barycentricCoords(const Foam::point &pt, barycentric &bary, Cell_handle &ch) const
Calculate and return the barycentric coordinates for.
plane.H
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::IOobject::READ_IF_PRESENT
Definition: IOobject.H:122
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
Foam::cellShapeControlMesh::Vertex_handle
CellSizeDelaunay::Vertex_handle Vertex_handle
Definition: cellShapeControlMesh.H:70
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::labelPairLookup
HashTable< label, labelPair, labelPair::Hash<> > labelPairLookup
This is a Map of a labelPair to a label. Used for e.g. for face1, face2 to shared edge....
Definition: labelPairHashes.H:67
Foam::FatalError
error FatalError
Foam::toPoint
PointFrompoint toPoint(const Foam::point &p)
Definition: pointConversion.H:82
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cellShapeControlMesh::distribute
void distribute(const backgroundMeshDecomposition &decomposition)
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:137
Foam::pointScalarField
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
Definition: pointFields.H:51
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:445
Foam::cellShapeControlMesh::bounds
boundBox bounds() const
cellShapeControlMesh.H
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:372
Foam::cellShapeControlMesh::meshSubDir
static word meshSubDir
Return the mesh sub-directory name (usually "cellShapeControlMesh")
Definition: cellShapeControlMesh.H:100
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::DistributedDelaunayMesh::distribute
bool distribute(const boundBox &bb)
Foam::BitOps::count
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Definition: BitOps.H:74
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::cellShapeControlMesh::writeTriangulation
void writeTriangulation()
Foam::cellShapeControlMesh::Cell_handle
CellSizeDelaunay::Cell_handle Cell_handle
Definition: cellShapeControlMesh.H:69
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:248
Foam::barycentric
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
Definition: barycentric.H:47
triadIOField.H
transform.H
3D tensor transformation operations.
Foam::cellShapeControlMesh::cellCentres
tmp< pointField > cellCentres() const
Get the centres of all the tets.
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::triadIOField
IOField< triad > triadIOField
triadField with IO.
Definition: triadIOField.H:44
CellSizeDelaunay
CGAL::Delaunay_triangulation_3< K, Tds, FastLocator > CellSizeDelaunay
Definition: CGALTriangulation3Ddefs.H:56
Foam::DelaunayMesh::reset
void reset()
Clear the entire triangulation.
Foam::IOobject::MUST_READ
Definition: IOobject.H:120