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