31 inline Foam::scalar Foam::conformalVoronoiMesh::defaultCellSize()
const 37 inline Foam::scalar Foam::conformalVoronoiMesh::targetCellSize
46 inline Foam::scalar Foam::conformalVoronoiMesh::averageAnyCellSize
54 (!vA->internalOrBoundaryPoint() || vA->referred())
55 && (!vB->internalOrBoundaryPoint() || vB->referred())
64 targetCellSize(
topoint(vA->point()))
65 *targetCellSize(
topoint(vB->point()))
68 else if (!vB->internalOrBoundaryPoint() || vB->referred())
70 return vA->targetCellSize();
72 else if (!vA->internalOrBoundaryPoint() || vA->referred())
74 return vB->targetCellSize();
81 inline Foam::scalar Foam::conformalVoronoiMesh::averageAnyCellSize
83 const Delaunay::Finite_facets_iterator& fit
93 const label oppositeVertex = fit->second;
95 for (
label i = 0; i < 3; i++)
97 Vertex_handle v =
c->vertex(vertex_triple_index(oppositeVertex, i));
99 if (v->internalOrBoundaryPoint() && !v->referred())
102 sizeSum += v->targetCellSize();
113 for (
label i = 0; i < 3; i++)
115 Vertex_handle v =
c->vertex(vertex_triple_index(oppositeVertex, i));
117 sizeSum += targetCellSize(
topoint(v->point()));
125 WarningIn(
"averageAnyCellSize(const Delaunay::Finite_facets_iterator&)")
126 <<
"sizeSum = " << sizeSum
132 return pow(sizeSum, (1.0/nProducts));
223 inline void Foam::conformalVoronoiMesh::createPointPair
268 pts[pts.
size() - 2].index(),
269 pts[pts.
size() - 1].index()
284 inline Foam::point Foam::conformalVoronoiMesh::perturbPoint
294 scalar pert = 1
e-12*defaultCellSize();
296 perturbedPt.
x() += pert*(rndGen_.
scalar01() - 0.5);
297 perturbedPt.
y() += pert*(rndGen_.
scalar01() - 0.5);
298 perturbedPt.
z() += pert*(rndGen_.
scalar01() - 0.5);
304 inline void Foam::conformalVoronoiMesh::createBafflePointPair
341 pts[pts.
size() - 2].index(),
342 pts[pts.
size() - 1].index()
348 inline bool Foam::conformalVoronoiMesh::internalPointIsInside
356 || !geometryToConformTo_.
inside(pt)
366 inline bool Foam::conformalVoronoiMesh::isBoundaryDualFace
368 const Delaunay::Finite_edges_iterator& eit
397 (vA->internalOrBoundaryPoint() && !vA->referred())
398 || (vB->internalOrBoundaryPoint() && !vB->referred())
401 !vA->internalOrBoundaryPoint()
402 || !vB->internalOrBoundaryPoint()
410 const Delaunay::Finite_edges_iterator& eit
413 Cell_circulator ccStart = incident_cells(*eit);
414 Cell_circulator cc1 = ccStart;
415 Cell_circulator cc2 = cc1;
425 label cc1I = cc1->cellIndex();
427 label cc2I = cc2->cellIndex();
431 if (cc1->boundaryDualVertex())
433 tmpFaceBoundaryPoints.
append(
true);
437 tmpFaceBoundaryPoints.
append(
false);
445 }
while (cc1 != ccStart);
447 return tmpFaceBoundaryPoints;
453 const Delaunay::Finite_facets_iterator& fit
459 const label oppositeVertex = fit->second;
468 if (
findIndex(procsAttached, c1Procs[aPI] == -1))
470 procsAttached.
append(c1Procs[aPI]);
473 if (
findIndex(procsAttached, c2Procs[aPI] == -1))
475 procsAttached.
append(c2Procs[aPI]);
483 inline bool Foam::conformalVoronoiMesh::isParallelDualEdge
485 const Delaunay::Finite_facets_iterator& fit
489 const label oppositeVertex = fit->second;
493 c1->vertex(vertex_triple_index(oppositeVertex, 0))->referred()
494 || c1->vertex(vertex_triple_index(oppositeVertex, 1))->referred()
495 || c1->vertex(vertex_triple_index(oppositeVertex, 2))->referred()
500 inline bool Foam::conformalVoronoiMesh::isProcBoundaryEdge
502 const Delaunay::Finite_edges_iterator& eit
505 bool isProcBoundaryEdge =
false;
514 (vA->referred() && !vB->referred())
515 || (vB->referred() && !vA->referred())
517 && vA->internalOrBoundaryPoint()
518 && vB->internalOrBoundaryPoint()
521 isProcBoundaryEdge =
true;
524 return isProcBoundaryEdge;
552 return geometryToConformTo_;
563 "inline const Foam::backgroundMeshDecomposition& " 564 "Foam::conformalVoronoiMesh::decomposition() const" 566 <<
"The backgroundMeshDecomposition cannot be asked for in serial." 570 return decomposition_();
577 return cellShapeControl_;
584 return foamyHexMeshControls_;
dimensionedScalar sqrt(const dimensionedScalar &ds)
static bool & parRun()
Is this a parallel run?
Simple random number generator.
scalar mixedFeaturePointPPDistanceCoeff() const
Return the mixedFeaturePointPPDistanceCoeff.
scalar featurePointExclusionDistanceSqr(const Foam::point &pt) const
Return the square of the local feature point exclusion distance.
scalar pointPairDistanceCoeff() const
Return the pointPairDistanceCoeff.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalar maxSurfaceProtrusion(const Foam::point &pt) const
Return the local maximum surface protrusion distance.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
scalar surfacePtExclusionDistanceSqr(const Foam::point &pt) const
Return the square of the local surface point exclusion distance.
Field< bool > inside(const pointField &samplePts) const
Check if points are inside surfaces to conform to.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar mixedFeaturePointDistance(const Foam::point &pt) const
Return the local mixed feature point placement distance.
bool addPointPair(const labelPair &vA, const labelPair &vB)
const searchableSurfaces & allGeometry() const
Return the allGeometry object.
label vertexCount() const
Return the vertex count (the next unique vertex index)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const double e
Elementary charge.
const cellShapeControl & cellShapeControls() const
Return the cellShapeControl object.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Random & rndGen() const
Return the random number generator.
scalar pointPairDistance(const Foam::point &pt) const
Return the local point pair separation at the given location.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
const cvControls & foamyHexMeshControls() const
Return the foamyHexMeshControls object.
scalar defaultCellSize() const
Return the defaultCellSize.
Delaunay::Cell_handle Cell_handle
scalar surfaceSearchDistanceSqr(const Foam::point &pt) const
Return the square of the local surface search distance.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Foam::FixedList< Foam::label, 4 > processorsAttached(const CellType &c)
const Time & time() const
Return the Time object.
const conformationSurfaces & geometryToConformTo() const
Return the conformationSurfaces object.
scalar maxSurfaceProtrusionCoeff() const
Return the maxSurfaceProtrusionCoeff.
const backgroundMeshDecomposition & decomposition() const
Return the backgroundMeshDecomposition.
scalar scalar01()
Scalar [0..1] (so including 0,1)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
pointFromPoint topoint(const Point &P)
Foam::scalar averageCellSize(const VertexType &vA, const VertexType &vB)
Return the target cell size from that stored on a pair of Delaunay vertices,.
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
scalar featureEdgeExclusionDistanceSqr(const Foam::point &pt) const
Return the square of the local feature edge exclusion distance.
const dimensionedScalar c
Speed of light in a vacuum.
Container for searchableSurfaces.
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
Controls for the conformalVoronoiMesh mesh generator.
Delaunay::Vertex_handle Vertex_handle
const treeBoundBox & globalBounds() const
Return the global bounds.
scalar cellSize(const point &pt) const
Return the cell size at the given location.