diff --git a/applications/utilities/mesh/generation/cvMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/Make/options index 3c44ec39f1..65996f338e 100644 --- a/applications/utilities/mesh/generation/cvMesh/Make/options +++ b/applications/utilities/mesh/generation/cvMesh/Make/options @@ -11,6 +11,7 @@ EXE_INC = \ -I$(LIB_SRC)/mesh/conformalVoronoiMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude @@ -19,6 +20,7 @@ EXE_LIBS = \ $(CGAL_LIBS) \ -lconformalVoronoiMesh \ -lmeshTools \ + -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lscotchDecomp \ -ledgeMesh \ -ltriSurface \ -ldynamicMesh diff --git a/src/mesh/conformalVoronoiMesh/Make/files b/src/mesh/conformalVoronoiMesh/Make/files index c013d4685b..9cc96fff20 100644 --- a/src/mesh/conformalVoronoiMesh/Make/files +++ b/src/mesh/conformalVoronoiMesh/Make/files @@ -27,6 +27,7 @@ initialPointsMethod/faceCentredCubic/faceCentredCubic.C initialPointsMethod/pointFile/pointFile.C initialPointsMethod/densityWeightedStochastic/densityWeightedStochastic.C initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.C +initialPointsMethod/parallelHierarchicalDensityWeightedStochastic/parallelHierarchicalDensityWeightedStochastic.C relaxationModel/relaxationModel/relaxationModel.C relaxationModel/adaptiveLinear/adaptiveLinear.C diff --git a/src/mesh/conformalVoronoiMesh/Make/options b/src/mesh/conformalVoronoiMesh/Make/options index 17517a7737..711e4ae773 100644 --- a/src/mesh/conformalVoronoiMesh/Make/options +++ b/src/mesh/conformalVoronoiMesh/Make/options @@ -11,12 +11,14 @@ EXE_INC = \ ${CGAL_INC} \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude EXE_LIBS = \ -lmeshTools \ + -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lscotchDecomp \ -ledgeMesh \ -ltriSurface \ -ldynamicMesh diff --git a/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C b/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C index 5fb168d388..c23f28d2b6 100644 --- a/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C +++ b/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C @@ -419,6 +419,33 @@ bool Foam::conformationSurfaces::positionOnThisProc(const point& pt) const } +Foam::label Foam::conformationSurfaces::positionProc(const point& pt) const +{ + // This is likely to give problems when a point is on the boundary between + // two processors. + + if (Pstream::parRun()) + { + forAll(processorDomains_, procI) + { + const treeBoundBoxList& procBbs = processorDomains_[procI]; + + forAll(procBbs, pBI) + { + const treeBoundBox& procBb = procBbs[pBI]; + + if (procBb.contains(pt)) + { + return procI; + } + } + } + } + + return -1; +} + + Foam::Field Foam::conformationSurfaces::inside ( const pointField& samplePts diff --git a/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H b/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H index 4bf89a81e1..95d16b3527 100644 --- a/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H +++ b/src/mesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H @@ -189,6 +189,9 @@ public: //- Check if the point is in the domain handled by this processor bool positionOnThisProc(const point& pt) const; + //- Which processor's domain handles this point + label positionProc(const point& pt) const; + //- Check if points are inside surfaces to conform to Field inside(const pointField& samplePts) const; diff --git a/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.C b/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.C index 5fcbb2ee28..c37161f675 100644 --- a/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.C +++ b/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.C @@ -212,7 +212,7 @@ bool Foam::hierarchicalDensityWeightedStochastic::fillBox hitSurface ); - if (surfHit.hit()) + if (!surfHit.hit()) { // Pout<< "box wellInside, no need to sample surface." << endl; @@ -723,7 +723,7 @@ hierarchicalDensityWeightedStochastic::hierarchicalDensityWeightedStochastic ( detailsDict().lookupOrDefault("minCellSizeLimit", 0.0) ), - maxLevels_(readLabel(detailsDict().lookup("maxLevels"))), + minLevels_(readLabel(detailsDict().lookup("minLevels"))), maxSizeRatio_(readScalar(detailsDict().lookup("maxSizeRatio"))), volRes_(readLabel(detailsDict().lookup("sampleResolution"))), surfRes_ @@ -773,7 +773,7 @@ hierarchicalDensityWeightedStochastic::initialPoints() const ( initialPoints, hierBB, - maxLevels_ - 1, + minLevels_ - 1, "recursionBox" ); diff --git a/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.H b/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.H index 0ad53d4407..81c497ef6e 100644 --- a/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.H +++ b/src/mesh/conformalVoronoiMesh/initialPointsMethod/hierarchicalDensityWeightedStochastic/hierarchicalDensityWeightedStochastic.H @@ -66,7 +66,7 @@ private: //- Maximum normal level of recursion, can be more if a high density // ratio is detected - label maxLevels_; + label minLevels_; //- Maximum allowed ratio of cell size in a box scalar maxSizeRatio_;