34 inline Foam::scalar Foam::conformalVoronoiMesh::defaultCellSize()
const 40 inline Foam::scalar Foam::conformalVoronoiMesh::targetCellSize
45 return cellShapeControls().cellSize(pt);
49 inline Foam::scalar Foam::conformalVoronoiMesh::averageAnyCellSize
51 const Vertex_handle& vA,
52 const Vertex_handle& vB
57 (!vA->internalOrBoundaryPoint() || vA->referred())
58 && (!vB->internalOrBoundaryPoint() || vB->referred())
67 targetCellSize(
topoint(vA->point()))
68 *targetCellSize(
topoint(vB->point()))
71 else if (!vB->internalOrBoundaryPoint() || vB->referred())
73 return vA->targetCellSize();
75 else if (!vA->internalOrBoundaryPoint() || vA->referred())
77 return vB->targetCellSize();
84 inline Foam::scalar Foam::conformalVoronoiMesh::averageAnyCellSize
86 const Delaunay::Finite_facets_iterator& fit
95 const Cell_handle
c(fit->first);
96 const label oppositeVertex = fit->second;
98 for (label i = 0; i < 3; i++)
100 Vertex_handle v =
c->vertex(vertex_triple_index(oppositeVertex, i));
102 if (v->internalOrBoundaryPoint() && !v->referred())
105 sizeSum += v->targetCellSize();
116 for (label i = 0; i < 3; i++)
118 Vertex_handle v =
c->vertex(vertex_triple_index(oppositeVertex, i));
120 sizeSum += targetCellSize(
topoint(v->point()));
129 <<
"sizeSum = " << sizeSum
135 return pow(sizeSum, (1.0/nProducts));
144 return targetCellSize(pt)*foamyHexMeshControls().pointPairDistanceCoeff();
154 pointPairDistance(pt)
155 *foamyHexMeshControls().mixedFeaturePointPPDistanceCoeff();
168 *foamyHexMeshControls().featurePointExclusionDistanceCoeff()
182 *foamyHexMeshControls().featureEdgeExclusionDistanceCoeff()
196 *foamyHexMeshControls().surfacePtExclusionDistanceCoeff()
210 *foamyHexMeshControls().surfaceSearchDistanceCoeff()
222 *foamyHexMeshControls().maxSurfaceProtrusionCoeff();
226 inline void Foam::conformalVoronoiMesh::createPointPair
269 ptPairs_.addPointPair
287 inline Foam::point Foam::conformalVoronoiMesh::perturbPoint
297 scalar pert = 1
e-12*defaultCellSize();
299 perturbedPt.x() += pert*(rndGen_.sample01<scalar>() - 0.5);
300 perturbedPt.y() += pert*(rndGen_.sample01<scalar>() - 0.5);
301 perturbedPt.z() += pert*(rndGen_.sample01<scalar>() - 0.5);
307 inline void Foam::conformalVoronoiMesh::createBafflePointPair
342 ptPairs_.addPointPair
351 inline bool Foam::conformalVoronoiMesh::internalPointIsInside
358 !geometryToConformTo_.globalBounds().contains(pt)
359 || !geometryToConformTo_.inside(pt)
369 inline bool Foam::conformalVoronoiMesh::isBoundaryDualFace
371 const Delaunay::Finite_edges_iterator& eit
374 Cell_handle
c = eit->first;
375 Vertex_handle vA =
c->vertex(eit->second);
376 Vertex_handle vB =
c->vertex(eit->third);
400 (vA->internalOrBoundaryPoint() && !vA->referred())
401 || (vB->internalOrBoundaryPoint() && !vB->referred())
404 !vA->internalOrBoundaryPoint()
405 || !vB->internalOrBoundaryPoint()
413 const Delaunay::Finite_edges_iterator& eit
416 Cell_circulator ccStart = incident_cells(*eit);
417 Cell_circulator cc1 = ccStart;
418 Cell_circulator cc2 = cc1;
424 DynamicList<bool> tmpFaceBoundaryPoints;
428 label cc1I = cc1->cellIndex();
430 label cc2I = cc2->cellIndex();
434 if (cc1->boundaryDualVertex())
436 tmpFaceBoundaryPoints.append(
true);
440 tmpFaceBoundaryPoints.append(
false);
448 }
while (cc1 != ccStart);
450 return tmpFaceBoundaryPoints;
456 const Delaunay::Finite_facets_iterator& fit
459 DynamicList<label> procsAttached(8);
461 const Cell_handle
c1(fit->first);
462 const label oppositeVertex = fit->second;
463 const Cell_handle
c2(
c1->neighbor(oppositeVertex));
471 procsAttached.push_uniq(c1Procs[aPI]);
472 procsAttached.push_uniq(c2Procs[aPI]);
475 return List<label>(procsAttached);
479 inline bool Foam::conformalVoronoiMesh::isParallelDualEdge
481 const Delaunay::Finite_facets_iterator& fit
484 const Cell_handle
c1(fit->first);
485 const label oppositeVertex = fit->second;
489 c1->vertex(vertex_triple_index(oppositeVertex, 0))->referred()
490 ||
c1->vertex(vertex_triple_index(oppositeVertex, 1))->referred()
491 ||
c1->vertex(vertex_triple_index(oppositeVertex, 2))->referred()
496 inline bool Foam::conformalVoronoiMesh::isProcBoundaryEdge
498 const Delaunay::Finite_edges_iterator& eit
501 bool isProcBoundaryEdge =
false;
503 Cell_handle
c = eit->first;
504 Vertex_handle vA =
c->vertex(eit->second);
505 Vertex_handle vB =
c->vertex(eit->third);
510 (vA->referred() && !vB->referred())
511 || (vB->referred() && !vA->referred())
513 && vA->internalOrBoundaryPoint()
514 && vB->internalOrBoundaryPoint()
517 isProcBoundaryEdge =
true;
520 return isProcBoundaryEdge;
548 return geometryToConformTo_;
558 <<
"The backgroundMeshDecomposition cannot be asked for in serial." 562 return *decomposition_;
569 return cellShapeControl_;
576 return foamyHexMeshControls_;
void size(const label n)
Older name for setAddressableSize.
pointFromPoint topoint(const Point &P)
errorManipArg< error, int > exit(error &err, const int errNo=1)
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)
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
scalar defaultCellSize() const
Return the defaultCellSize.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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.
const dimensionedScalar e
Elementary charge.
Foam::FixedList< Foam::label, 4 > processorsAttached(const CellType &c)
Container for searchableSurfaces. The collection is specified as a dictionary. For example...
Controls for the conformalVoronoiMesh mesh generator.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
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.
const dimensionedScalar c
Speed of light in a vacuum.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...