58 { dualMeshPointType::featureEdge,
"featureEdge" },
59 { dualMeshPointType::featurePoint,
"featurePoint" },
60 { dualMeshPointType::constrained,
"constrained" },
66 void Foam::conformalVoronoiMesh::cellSizeMeshOverlapsBackground()
const 68 const cellShapeControlMesh& cellSizeMesh =
71 DynamicList<Foam::point>
pts(number_of_vertices());
75 Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
76 vit != finite_vertices_end();
80 if (vit->internalOrBoundaryPoint() && !vit->referred())
88 boundBox cellSizeMeshBb = cellSizeMesh.bounds();
90 bool fullyContained = cellSizeMeshBb.contains(bb);
94 Pout<<
"Triangulation not fully contained in cell size mesh." <<
endl 95 <<
"Cell Size Mesh Bounds = " << cellSizeMeshBb <<
endl 96 <<
"foamyHexMesh Bounds = " << bb <<
endl;
99 Info<<
"Triangulation is " 101 <<
" contained in the cell size mesh" 106 void Foam::conformalVoronoiMesh::insertInternalPoints
118 List<Foam::point> transferPoints(
points.
size());
129 decomposition_().distributePoints(transferPoints)
132 transferPoints.clear();
137 label preReinsertionSize(number_of_vertices());
143 label(number_of_vertices()) - preReinsertionSize,
147 Info<<
" " << nInserted <<
" points inserted" 148 <<
", failed to insert " <<
nPoints - nInserted
150 << 100.0*(
nPoints - nInserted)/(nInserted + SMALL)
155 Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
156 vit != finite_vertices_end();
162 vit->index() = getNewVertexIndex();
178 autoPtr<mapDistribute> mapDist =
179 decomposition_().distributePoints(
vertices);
193 label preReinsertionSize(number_of_vertices());
195 Map<label> oldToNewIndices =
200 label(number_of_vertices()) - preReinsertionSize,
204 Info<<
" Reinserted " << nReinserted <<
" vertices out of " 208 return oldToNewIndices;
212 void Foam::conformalVoronoiMesh::insertSurfacePointPairs
214 const pointIndexHitAndFeatureList& surfaceHits,
215 const fileName fName,
224 const label featureIndex = surfaceHits[i].second();
226 allGeometry_[featureIndex].getNormal
228 List<pointIndexHit>(1, surfaceHit),
232 const vector& normal = norm[0];
234 const Foam::point& surfacePt = surfaceHit.hitPoint();
237 geometryToConformTo_.meshableSide(featureIndex, surfaceHit);
241 createBafflePointPair
243 pointPairDistance(surfacePt),
254 pointPairDistance(surfacePt),
265 pointPairDistance(surfacePt),
275 << meshableSide <<
", bad" 280 if (foamyHexMeshControls().objOutput() && !fName.empty())
287 void Foam::conformalVoronoiMesh::insertEdgePointGroups
289 const pointIndexHitAndFeatureList& edgeHits,
290 const fileName fName,
296 if (edgeHits[i].first().hit())
298 const extendedFeatureEdgeMesh& feMesh
300 geometryToConformTo_.features()[edgeHits[i].second()]
315 if (foamyHexMeshControls().objOutput() && !fName.empty())
322 bool Foam::conformalVoronoiMesh::nearFeaturePt(
const Foam::point& pt)
const 324 scalar exclusionRangeSqr = featurePointExclusionDistanceSqr(pt);
329 geometryToConformTo_.findFeaturePointNearest
341 bool Foam::conformalVoronoiMesh::surfacePtNearFeatureEdge
346 scalar exclusionRangeSqr = surfacePtExclusionDistanceSqr(pt);
351 geometryToConformTo_.findEdgeNearest
363 void Foam::conformalVoronoiMesh::insertInitialPoints()
365 Info<<
nl <<
"Inserting initial points" <<
endl;
367 timeCheck(
"Before initial points call");
369 List<Point> initPts = initialPointsMethod_->initialPoints();
371 timeCheck(
"After initial points call");
375 insertInternalPoints(initPts);
377 if (initialPointsMethod_->fixInitialPoints())
381 Finite_vertices_iterator vit = finite_vertices_begin();
382 vit != finite_vertices_end();
390 if (foamyHexMeshControls().objOutput())
394 time().
path()/
"initialPoints.obj",
402 void Foam::conformalVoronoiMesh::distribute()
409 DynamicList<Foam::point>
points(number_of_vertices());
410 DynamicList<Foam::indexedVertexEnum::vertexType> types
414 DynamicList<scalar> sizes(number_of_vertices());
415 DynamicList<tensor> alignments(number_of_vertices());
419 Finite_vertices_iterator vit = finite_vertices_begin();
420 vit != finite_vertices_end();
427 types.append(vit->type());
428 sizes.append(vit->targetCellSize());
429 alignments.append(vit->alignment());
433 autoPtr<mapDistribute> mapDist =
436 mapDist().distribute(types);
437 mapDist().distribute(sizes);
438 mapDist().distribute(alignments);
443 Info<<
nl <<
" Inserting distributed tessellation" <<
endl;
447 DynamicList<Vb> verticesToInsert(
points.
size());
451 verticesToInsert.append
462 verticesToInsert.last().targetCellSize() = sizes[pI];
463 verticesToInsert.last().alignment() = alignments[pI];
466 this->rangeInsertWithInfo
468 verticesToInsert.begin(),
469 verticesToInsert.end(),
473 Info<<
" Total number of vertices after redistribution " 476 label(number_of_vertices()), sumOp<label>()
482 void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
484 controlMeshRefinement meshRefinement
489 smoothAlignmentSolver meshAlignmentSmoother
491 cellShapeControl_.shapeControlMesh()
494 meshRefinement.initialMeshPopulation(decomposition_);
496 cellShapeControlMesh& cellSizeMesh = cellShapeControl_.shapeControlMesh();
500 if (!distributeBackground(cellSizeMesh))
503 cellSizeMesh.distribute(decomposition_());
508 = foamyHexMeshControls().foamyHexMeshDict().subDict(
"motionControl");
510 const label nMaxIter =
511 motionControlDict.get<label>(
"maxRefinementIterations");
513 Info<<
"Maximum number of refinement iterations : " << nMaxIter <<
endl;
515 for (label i = 0; i < nMaxIter; ++i)
517 label nAdded = meshRefinement.refineMesh(decomposition_);
519 reduce(nAdded, sumOp<label>());
523 cellSizeMesh.distribute(decomposition_());
526 Info<<
" Iteration " << i
527 <<
" Added = " << nAdded <<
" points" 539 if (!distributeBackground(cellSizeMesh))
541 cellSizeMesh.distribute(decomposition_());
545 meshAlignmentSmoother.smoothAlignments
547 motionControlDict.get<label>(
"maxSmoothingIterations")
550 Info<<
"Background cell size and alignment mesh:" <<
endl;
551 cellSizeMesh.printInfo(
Info);
553 Info<<
"Triangulation is " 554 << (cellSizeMesh.is_valid() ?
"valid" :
"not valid!" )
557 if (foamyHexMeshControls().writeCellShapeControlMesh())
560 cellSizeMesh.
write();
563 if (foamyHexMeshControls().printVertexInfo())
565 cellSizeMesh.printVertexInfo(
Info);
578 void Foam::conformalVoronoiMesh::setVertexSizeAndAlignment()
580 Info<<
nl <<
"Calculating target cell alignment and size" <<
endl;
584 Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
585 vit != finite_vertices_end();
589 if (vit->internalOrBoundaryPoint())
593 cellShapeControls().cellSizeAndAlignment
596 vit->targetCellSize(),
604 Foam::face Foam::conformalVoronoiMesh::buildDualFace
606 const Delaunay::Finite_edges_iterator& eit
609 Cell_circulator ccStart = incident_cells(*eit);
610 Cell_circulator cc1 = ccStart;
611 Cell_circulator cc2 = cc1;
617 DynamicList<label> verticesOnFace;
619 label nUniqueVertices = 0;
625 cc1->hasFarPoint() || cc2->hasFarPoint()
626 || is_infinite(cc1) || is_infinite(cc2)
629 Cell_handle
c = eit->first;
630 Vertex_handle vA =
c->vertex(eit->second);
631 Vertex_handle vB =
c->vertex(eit->third);
637 <<
"Dual face uses circumcenter defined by a " 638 <<
"Delaunay tetrahedron with no internal " 639 <<
"or boundary points. Defining Delaunay edge ends: " 646 label cc1I = cc1->cellIndex();
647 label cc2I = cc2->cellIndex();
651 if (!verticesOnFace.found(cc1I))
656 verticesOnFace.append(cc1I);
663 }
while (cc1 != ccStart);
665 verticesOnFace.shrink();
667 if (verticesOnFace.size() >= 3 && nUniqueVertices < 3)
682 verticesOnFace.setSize(nUniqueVertices);
685 return face(verticesOnFace);
689 Foam::label Foam::conformalVoronoiMesh::maxFilterCount
691 const Delaunay::Finite_edges_iterator& eit
694 Cell_circulator ccStart = incident_cells(*eit);
695 Cell_circulator cc = ccStart;
701 if (cc->hasFarPoint())
703 Cell_handle
c = eit->first;
704 Vertex_handle vA =
c->vertex(eit->second);
705 Vertex_handle vB =
c->vertex(eit->third);
708 <<
"Dual face uses circumcenter defined by a " 709 <<
"Delaunay tetrahedron with no internal " 710 <<
"or boundary points. Defining Delaunay edge ends: " 716 if (cc->filterCount() > maxFC)
718 maxFC = cc->filterCount();
723 }
while (cc != ccStart);
729 bool Foam::conformalVoronoiMesh::ownerAndNeighbour
742 label dualCellIndexA = vA->index();
744 if (!vA->internalOrBoundaryPoint() || vA->referred())
746 if (!vA->constrained())
752 label dualCellIndexB = vB->index();
754 if (!vB->internalOrBoundaryPoint() || vB->referred())
756 if (!vB->constrained())
762 if (dualCellIndexA == -1 && dualCellIndexB == -1)
765 <<
"Attempting to create a face joining " 766 <<
"two unindexed dual cells " 769 else if (dualCellIndexA == -1 || dualCellIndexB == -1)
773 if (dualCellIndexA == -1)
775 owner = dualCellIndexB;
781 owner = dualCellIndexA;
788 if (dualCellIndexB > dualCellIndexA)
790 owner = dualCellIndexA;
791 neighbour = dualCellIndexB;
795 owner = dualCellIndexB;
796 neighbour = dualCellIndexA;
809 Foam::conformalVoronoiMesh::conformalVoronoiMesh
812 const dictionary& foamyHexMeshDict,
813 const fileName& decompDictFile
818 rndGen_(64293*Pstream::myProcNo()),
819 foamyHexMeshControls_(foamyHexMeshDict),
824 "cvSearchableSurfaces",
831 foamyHexMeshDict.subDict(
"geometry"),
832 foamyHexMeshDict.getOrDefault(
"singleRegionName", true)
839 foamyHexMeshDict.subDict(
"surfaceConformation")
844 ? new backgroundMeshDecomposition
848 geometryToConformTo_,
849 foamyHexMeshControls().foamyHexMeshDict().subDict
851 "backgroundMeshDecomposition" 860 foamyHexMeshControls_,
866 ftPtConformer_(*this),
867 edgeLocationTreePtr_(),
868 surfacePtLocationTreePtr_(),
869 surfaceConformationVertices_(),
872 initialPointsMethod::
New 874 foamyHexMeshDict.subDict(
"initialPoints"),
877 geometryToConformTo_,
886 foamyHexMeshDict.subDict(
"motionControl"),
892 faceAreaWeightModel::
New 894 foamyHexMeshDict.subDict(
"motionControl")
910 if (foamyHexMeshControls().objOutput())
912 geometryToConformTo_.writeFeatureObj(
"foamyHexMesh");
915 buildCellSizeAndAlignmentMesh();
917 insertInitialPoints();
919 insertFeaturePoints(
true);
921 setVertexSizeAndAlignment();
923 cellSizeMeshOverlapsBackground();
928 distributeBackground(*
this);
930 buildSurfaceConformation();
934 distributeBackground(*
this);
938 sync(decomposition_().procBounds());
943 storeSurfaceConformation();
949 cellSizeMeshOverlapsBackground();
951 if (foamyHexMeshControls().printVertexInfo())
953 printVertexInfo(
Info);
956 if (foamyHexMeshControls().objOutput())
960 time().
path()/
"internalPoints_" + time().
timeName() +
".obj",
975 new backgroundMeshDecomposition
979 geometryToConformTo_,
980 foamyHexMeshControls().foamyHexMeshDict().subDict
982 "backgroundMeshDecomposition" 988 insertInitialPoints();
990 insertFeaturePoints();
995 distributeBackground(*
this);
997 buildSurfaceConformation();
1001 distributeBackground(*
this);
1005 sync(decomposition_().procBounds());
1008 cellSizeMeshOverlapsBackground();
1010 if (foamyHexMeshControls().printVertexInfo())
1012 printVertexInfo(
Info);
1019 timeCheck(
"Start of move");
1021 scalar relaxation = relaxationModel_->relaxation();
1023 Info<<
nl <<
"Relaxation = " << relaxation <<
endl;
1025 pointField dualVertices(number_of_finite_cells());
1027 this->resetCellCount();
1032 Delaunay::Finite_cells_iterator cit = finite_cells_begin();
1033 cit != finite_cells_end();
1039 if (cit->anyInternalOrBoundaryDualVertex())
1041 cit->cellIndex() = getNewCellIndex();
1043 dualVertices[cit->cellIndex()] = cit->dual();
1046 if (cit->hasFarPoint())
1052 dualVertices.setSize(cellCount());
1054 setVertexSizeAndAlignment();
1056 timeCheck(
"Determined sizes and alignments");
1058 Info<<
nl <<
"Determining vertex displacements" <<
endl;
1062 cartesianDirections[0] =
vector(1, 0, 0);
1063 cartesianDirections[1] =
vector(0, 1, 0);
1064 cartesianDirections[2] =
vector(0, 0, 1);
1068 number_of_vertices(),
1072 bitSet pointToBeRetained(number_of_vertices(),
true);
1074 DynamicList<Point> pointsToInsert(number_of_vertices());
1078 Delaunay::Finite_edges_iterator eit = finite_edges_begin();
1079 eit != finite_edges_end();
1083 Cell_handle
c = eit->first;
1084 Vertex_handle vA =
c->vertex(eit->second);
1085 Vertex_handle vB =
c->vertex(eit->third);
1090 vA->internalPoint() && !vA->referred()
1091 && vB->internalOrBoundaryPoint()
1094 vB->internalPoint() && !vB->referred()
1095 && vA->internalOrBoundaryPoint()
1102 Field<vector> alignmentDirsA
1104 vA->alignment().T() & cartesianDirections
1106 Field<vector> alignmentDirsB
1108 vB->alignment().T() & cartesianDirections
1111 Field<vector> alignmentDirs(alignmentDirsA);
1113 forAll(alignmentDirsA, aA)
1115 const vector& a = alignmentDirsA[aA];
1117 scalar maxDotProduct = 0.0;
1119 forAll(alignmentDirsB, aB)
1121 const vector&
b = alignmentDirsB[aB];
1123 const scalar dotProduct = a &
b;
1125 if (
mag(dotProduct) > maxDotProduct)
1127 maxDotProduct =
mag(dotProduct);
1129 alignmentDirs[aA] = a +
sign(dotProduct)*
b;
1131 alignmentDirs[aA].normalise();
1138 scalar rABMag =
mag(rAB);
1146 vA->internalPoint() && !vA->referred() && !vA->fixed()
1147 && vB->internalPoint() && !vB->referred() && !vB->fixed()
1157 pointToBeRetained.test(vA->index())
1158 && pointToBeRetained.test(vB->index())
1163 if (internalPointIsInside(pt))
1165 pointsToInsert.append(
toPoint(pt));
1170 if (vA->internalPoint() && !vA->referred() && !vA->fixed())
1172 pointToBeRetained.unset(vA->index());
1175 if (vB->internalPoint() && !vB->referred() && !vB->fixed())
1177 pointToBeRetained.unset(vB->index());
1185 forAll(alignmentDirs, aD)
1187 vector& alignmentDir = alignmentDirs[aD];
1189 scalar dotProd = rAB & alignmentDir;
1199 const scalar alignmentDotProd = dotProd/rABMag;
1204 > foamyHexMeshControls().cosAlignmentAcceptanceAngle()
1207 scalar targetCellSize =
1210 scalar targetFaceArea =
sqr(targetCellSize);
1212 const vector originalAlignmentDir = alignmentDir;
1215 cellShapeControls().aspectRatio().updateCellSizeAndFaceArea
1227 face dualFace = buildDualFace(eit);
1233 const scalar faceArea = dualFace.mag(dualVertices);
1236 cellShapeControls().aspectRatio().updateDeltaVector
1238 originalAlignmentDir,
1261 delta *= faceAreaWeightModel_->faceAreaWeight
1263 faceArea/targetFaceArea
1269 (vA->internalPoint() && vB->internalPoint())
1270 && (!vA->referred() || !vB->referred())
1278 > foamyHexMeshControls().insertionDistCoeff()
1281 > foamyHexMeshControls().faceAreaRatioCoeff()
1284 > foamyHexMeshControls().cosInsertionAcceptanceAngle()
1290 !geometryToConformTo_.findSurfaceAnyIntersection
1300 if (internalPointIsInside(newPt))
1306 decomposition().positionOnThisProcessor
1312 pointsToInsert.append(
toPoint(newPt));
1317 pointsToInsert.append(
toPoint(newPt));
1325 (vA->internalPoint() && !vA->referred())
1326 || (vB->internalPoint() && !vB->referred())
1329 < foamyHexMeshControls().removalDistCoeff()
1355 pointToBeRetained.test(vA->index())
1356 && pointToBeRetained.test(vB->index())
1361 if (internalPointIsInside(pt))
1363 pointsToInsert.append(
toPoint(pt));
1375 pointToBeRetained.unset(vA->index());
1385 pointToBeRetained.unset(vB->index());
1399 displacementAccumulator[vA->index()] += 2*
delta;
1403 displacementAccumulator[vA->index()] +=
delta;
1416 displacementAccumulator[vB->index()] -= 2*
delta;
1420 displacementAccumulator[vB->index()] -=
delta;
1429 Info<<
"Limit displacements" <<
endl;
1434 Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
1435 vit != finite_vertices_end();
1439 if (vit->internalPoint() && !vit->referred() && !vit->fixed())
1441 if (pointToBeRetained.test(vit->index()))
1446 displacementAccumulator[vit->index()]
1452 vector totalDisp =
gSum(displacementAccumulator);
1453 scalar totalDist =
gSum(
mag(displacementAccumulator));
1455 displacementAccumulator *= relaxation;
1457 Info<<
"Sum displacements" <<
endl;
1459 label nPointsToRetain = 0;
1460 label nPointsToRemove = 0;
1464 Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
1465 vit != finite_vertices_end();
1469 if (vit->internalPoint() && !vit->referred() && !vit->fixed())
1471 if (pointToBeRetained.test(vit->index()))
1485 + displacementAccumulator[vit->index()]
1488 if (internalPointIsInside(pt))
1490 pointsToInsert.append(
toPoint(pt));
1499 pointsToInsert.shrink();
1503 nPointsToRetain - nPointsToRemove,
1506 <<
" internal points are outside the domain. " 1507 <<
"They will not be inserted." <<
endl;
1510 if (foamyHexMeshControls().objOutput() && time().writeTime())
1512 Info<<
"Writing point displacement vectors to file." <<
endl;
1515 time().
path()/
"displacements_" + runTime_.timeName() +
".obj" 1520 Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
1521 vit != finite_vertices_end();
1525 if (vit->internalPoint() && !vit->referred())
1527 if (pointToBeRetained.test(vit->index()))
1532 << displacementAccumulator[vit->index()][0] <<
" " 1533 << displacementAccumulator[vit->index()][1] <<
" " 1534 << displacementAccumulator[vit->index()][2] <<
" " 1544 timeCheck(
"Displacement calculated");
1546 Info<<
nl<<
"Inserting displaced tessellation" <<
endl;
1548 insertFeaturePoints(
true);
1550 insertInternalPoints(pointsToInsert,
true);
1573 timeCheck(
"Internal points inserted");
1580 Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
1581 vit != finite_vertices_end();
1585 if (!vit->referred() && !usedIndices.insert(vit->index()))
1588 <<
"Index already used! Could not insert: " <<
nl 1597 if (foamyHexMeshControls().objOutput())
1601 time().
path()/
"internalPoints_" + time().
timeName() +
".obj",
1606 if (reconformToSurface())
1610 time().
path()/
"boundaryPoints_" + time().
timeName() +
".obj",
1616 time().
path()/
"internalBoundaryPoints_" + time().
timeName()
1625 time().
path()/
"externalBoundaryPoints_" + time().
timeName()
1632 OBJstream multipleIntersections
1634 "multipleIntersections_" 1641 Delaunay::Finite_edges_iterator eit = finite_edges_begin();
1642 eit != finite_edges_end();
1646 Cell_handle
c = eit->first;
1647 Vertex_handle vA =
c->vertex(eit->second);
1648 Vertex_handle vB =
c->vertex(eit->third);
1653 List<pointIndexHit> surfHits;
1656 geometryToConformTo().findSurfaceAllIntersections
1666 surfHits.size() >= 2
1668 surfHits.size() == 0
1670 (vA->externalBoundaryPoint()
1671 && vB->internalBoundaryPoint())
1672 || (vB->externalBoundaryPoint()
1673 && vA->internalBoundaryPoint())
1678 multipleIntersections.writeLine(ptA, ptB);
1684 timeCheck(
"After conformToSurface");
1686 if (foamyHexMeshControls().printVertexInfo())
1688 printVertexInfo(
Info);
1691 if (time().writeTime())
1697 <<
"Total displacement = " << totalDisp <<
nl 1698 <<
"Total distance = " << totalDist <<
nl 1703 void Foam::conformalVoronoiMesh::checkCoPlanarCells()
const 1705 typedef CGAL::Exact_predicates_exact_constructions_kernel Kexact;
1706 typedef CGAL::Point_3<Kexact> PointExact;
1710 Pout<<
"Triangulation is invalid!" <<
endl;
1713 OFstream str(
"badCells.obj");
1719 Delaunay::Finite_cells_iterator cit = finite_cells_begin();
1720 cit != finite_cells_end();
1729 <<
" quality = " << quality <<
nl 1734 FixedList<PointExact, 4> cellVerticesExact(PointExact(0,0,0));
1735 forAll(cellVerticesExact, vI)
1737 cellVerticesExact[vI] = PointExact
1739 cit->vertex(vI)->point().x(),
1740 cit->vertex(vI)->point().y(),
1741 cit->vertex(vI)->point().z()
1745 PointExact synchronisedDual = CGAL::circumcenter<Kexact>
1747 cellVerticesExact[0],
1748 cellVerticesExact[1],
1749 cellVerticesExact[2],
1750 cellVerticesExact[3]
1755 CGAL::to_double(synchronisedDual.x()),
1756 CGAL::to_double(synchronisedDual.y()),
1757 CGAL::to_double(synchronisedDual.z())
1760 Info<<
"inexact = " << cit->dual() <<
nl 1761 <<
"exact = " << exactPt <<
endl;
1765 Pout<<
"There are " << badCells <<
" bad cells out of " 1766 << number_of_finite_cells() <<
endl;
1769 label nNonGabriel = 0;
1772 Delaunay::Finite_facets_iterator fit = finite_facets_begin();
1773 fit != finite_facets_end();
1777 if (!is_Gabriel(*fit))
1783 Pout<<
"There are " << nNonGabriel <<
" non-Gabriel faces out of " 1784 << number_of_finite_facets() <<
endl;
dimensionedScalar sign(const dimensionedScalar &ds)
CGAL::Delaunay_triangulation_3< K, Tds, CompactLocator > Delaunay
void size(const label n)
Older name for setAddressableSize.
pointFromPoint topoint(const Point &P)
errorManipArg< error, int > exit(error &err, const int errNo=1)
A face is a list of labels corresponding to mesh vertices.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
static bool & parRun() noexcept
Test if this a parallel run.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
bool distribute(const boundBox &bb)
InfoProxy< IOstream > info() const noexcept
Return info proxy, used to print IOstream information to a stream.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
void reduce(T &value, [[maybe_unused]] BinaryOp bop, [[maybe_unused]] const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce)
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
pointField vertices(const blockVertexList &bvl)
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
bool uninitialised(const VertexType &v)
Type gSum(const FieldField< Field, Type > &f)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
sideVolumeType
Normals point to the outside.
void reset()
Clear the entire triangulation.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
PointFrompoint toPoint(const Foam::point &p)
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
errorManip< error > abort(error &err)
iterator begin() noexcept
Return an iterator to begin traversing the UList.
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
Istream and Ostream manipulators taking arguments.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
const wordList internal
Standard dimensioned field types (scalar, vector, tensor, etc)
Foam::scalar averageCellSize(const VertexType &vA, const VertexType &vB)
Return the target cell size from that stored on a pair of Delaunay vertices,.
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const dimensionedScalar c
Speed of light in a vacuum.
messageStream Info
Information stream (stdout output on master, null elsewhere)
cellShapeControlMesh & shapeControlMesh()
Field< vector > vectorField
Specialisation of Field<T> for vector.
scalar coplanarTet(Cell &c, const scalar tol=1e-12)
Map< label > insertPoints(const List< Vb > &vertices, const bool reIndex)
Insert the list of vertices (calls rangeInsertWithInfo)
iterator end() noexcept
Return an iterator to end traversing the UList.
List< label > labelList
A List of labels.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
A HashTable to objects of type <T> with a label key.
static constexpr const zero Zero
Global zero (0)