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()));
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_;
562 <<
"The backgroundMeshDecomposition cannot be asked for in serial." 566 return decomposition_();
573 return cellShapeControl_;
580 return foamyHexMeshControls_;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
pointFromPoint topoint(const Point &P)
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar pointPairDistanceCoeff() const
Return the pointPairDistanceCoeff.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
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.
bool addPointPair(const labelPair &vA, const labelPair &vB)
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...
scalar maxSurfaceProtrusionCoeff() const
Return the maxSurfaceProtrusionCoeff.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Foam::FixedList< Foam::label, 4 > processorsAttached(const CellType &c)
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Container for searchableSurfaces.
Controls for the conformalVoronoiMesh mesh generator.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
static bool & parRun()
Is this a parallel run?
label vertexCount() const
Return the vertex count (the next unique vertex index)
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...
const doubleScalar e
Elementary charge.
scalar scalar01()
Advance the state and return a scalar sample from a uniform.
scalar mixedFeaturePointPPDistanceCoeff() const
Return the mixedFeaturePointPPDistanceCoeff.
scalar cellSize(const point &pt) const
Return the cell size at the given location.