diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index f99aaab8577e9f9c9fef2a0cc2029dff92045f8d..430304b4dab5fa87ffac9b5d4ff58d14cc264f71 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -1362,13 +1362,16 @@ int main(int argc, char *argv[]) globalToMasterPatch.setSize(surfaces.nRegions(), -1); globalToSlavePatch.setSize(surfaces.nRegions(), -1); - Info<< setf(ios_base::left) - << setw(6) << "Patch" - << setw(20) << "Type" - << setw(30) << "Region" << nl - << setw(6) << "-----" - << setw(20) << "----" - << setw(30) << "------" << endl; + if (!dryRun) + { + Info<< setf(ios_base::left) + << setw(6) << "Patch" + << setw(20) << "Type" + << setw(30) << "Region" << nl + << setw(6) << "-----" + << setw(20) << "----" + << setw(30) << "------" << endl; + } const labelList& surfaceGeometry = surfaces.surfaces(); const PtrList<dictionary>& surfacePatchInfo = surfaces.patchInfo(); @@ -1380,7 +1383,10 @@ int main(int argc, char *argv[]) const wordList& regNames = allGeometry.regionNames()[geomi]; - Info<< surfaces.names()[surfi] << ':' << nl << nl; + if (!dryRun) + { + Info<< surfaces.names()[surfi] << ':' << nl << nl; + } const word& fzName = surfaces.surfZones()[surfi].faceZoneName(); @@ -1413,10 +1419,13 @@ int main(int argc, char *argv[]) ); } - Info<< setf(ios_base::left) - << setw(6) << patchi - << setw(20) << pbm[patchi].type() - << setw(30) << regNames[i] << nl; + if (!dryRun) + { + Info<< setf(ios_base::left) + << setw(6) << patchi + << setw(20) << pbm[patchi].type() + << setw(30) << regNames[i] << nl; + } globalToMasterPatch[globalRegioni] = patchi; globalToSlavePatch[globalRegioni] = patchi; @@ -1453,10 +1462,13 @@ int main(int argc, char *argv[]) ); } - Info<< setf(ios_base::left) - << setw(6) << patchi - << setw(20) << pbm[patchi].type() - << setw(30) << regNames[i] << nl; + if (!dryRun) + { + Info<< setf(ios_base::left) + << setw(6) << patchi + << setw(20) << pbm[patchi].type() + << setw(30) << regNames[i] << nl; + } globalToMasterPatch[globalRegioni] = patchi; } @@ -1485,10 +1497,13 @@ int main(int argc, char *argv[]) ); } - Info<< setf(ios_base::left) - << setw(6) << patchi - << setw(20) << pbm[patchi].type() - << setw(30) << slaveName << nl; + if (!dryRun) + { + Info<< setf(ios_base::left) + << setw(6) << patchi + << setw(20) << pbm[patchi].type() + << setw(30) << slaveName << nl; + } globalToSlavePatch[globalRegioni] = patchi; } @@ -1510,7 +1525,10 @@ int main(int argc, char *argv[]) } } - Info<< nl; + if (!dryRun) + { + Info<< nl; + } } Info<< "Added patches in = " << mesh.time().cpuTimeIncrement() << " s" << nl << endl; diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C index effc9cb93549a91adb994715934f542757eed157..960b7020e53dce386434a3247da8e6cead122481 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C @@ -285,10 +285,13 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces) } reduce(nChangedFaces, sumOp<label>()); - Info<< "Edge intersection testing:" << nl - << " Number of edges : " << nMasterFaces << nl - << " Number of edges to retest : " << nChangedFaces - << endl; + if (!dryRun_) + { + Info<< "Edge intersection testing:" << nl + << " Number of edges : " << nMasterFaces << nl + << " Number of edges to retest : " << nChangedFaces + << endl; + } } @@ -342,7 +345,11 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces) label nHits = countHits(); label nTotHits = returnReduce(nHits, sumOp<label>()); - Info<< " Number of intersected edges : " << nTotHits << endl; + + if (!dryRun_) + { + Info<< " Number of intersected edges : " << nTotHits << endl; + } // Set files to same time as mesh setInstance(mesh_.facesInstance()); diff --git a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C index d16b9eb0df3f3a9881a5b541dc71b9adc49fcecb..1a1718521cafb07aabb4c645afb1464b0186e6be 100644 --- a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C +++ b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C @@ -77,10 +77,13 @@ void Foam::refinementFeatures::read fName ); - Info<< "Read extendedFeatureEdgeMesh " << extFeatObj.name() - << nl << incrIndent; - eMeshPtr().writeStats(Info); - Info<< decrIndent << endl; + if (!dryRun_) + { + Info<< "Read extendedFeatureEdgeMesh " << extFeatObj.name() + << nl << incrIndent; + eMeshPtr().writeStats(Info); + Info<< decrIndent << endl; + } set(featI, new extendedFeatureEdgeMesh(extFeatObj, eMeshPtr())); } @@ -108,16 +111,17 @@ void Foam::refinementFeatures::read << exit(FatalIOError); } - // Read as edgeMesh autoPtr<edgeMesh> eMeshPtr = edgeMesh::New(fName); const edgeMesh& eMesh = eMeshPtr(); - Info<< "Read edgeMesh " << featObj.name() << nl - << incrIndent; - eMesh.writeStats(Info); - Info<< decrIndent << endl; - + if (!dryRun_) + { + Info<< "Read edgeMesh " << featObj.name() << nl + << incrIndent; + eMesh.writeStats(Info); + Info<< decrIndent << endl; + } // Analyse for feature points. These are all classified as mixed // points for lack of anything better @@ -260,14 +264,17 @@ void Foam::refinementFeatures::read distances_[featI] = scalarField(1, Zero); } - Info<< "Refinement level according to distance to " - << featFileName << " (" << eMesh.points().size() << " points, " - << eMesh.edges().size() << " edges)." << endl; - forAll(levels_[featI], j) + if (!dryRun_) { - Info<< " level " << levels_[featI][j] - << " for all cells within " << distances_[featI][j] - << " metre." << endl; + Info<< "Refinement level according to distance to " + << featFileName << " (" << eMesh.points().size() << " points, " + << eMesh.edges().size() << " edges)." << endl; + forAll(levels_[featI], j) + { + Info<< " level " << levels_[featI][j] + << " for all cells within " << distances_[featI][j] + << " metre." << endl; + } } } } diff --git a/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C index 61d5c9607cd6808e9d6ccc5a0c26f5839b828707..e922b949a7dad04654f8745a0e234b5a0974141a 100644 --- a/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C +++ b/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C @@ -703,10 +703,14 @@ void Foam::refinementSurfaces::setMinLevelFields(const shellSurfaces& shells) } } - Info<< "For geometry " << geom.name() - << " detected " << returnReduce(nUncached, sumOp<label>()) - << " uncached triangles out of " << geom.globalSize() - << endl; + if (!dryRun_) + { + Info<< "For geometry " << geom.name() + << " detected " + << returnReduce(nUncached, sumOp<label>()) + << " uncached triangles out of " << geom.globalSize() + << endl; + } } diff --git a/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C b/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C index 35c83377c512f81114fdc131c5be39cedb9cf58b..4264176e63248766f3f4a317098400aad24224bd 100644 --- a/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C +++ b/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C @@ -109,13 +109,16 @@ void Foam::shellSurfaces::setAndCheckLevels if (modes_[shellI] == DISTANCE) { - Info<< "Refinement level according to distance to " - << shell.name() << endl; - forAll(levels_[shellI], j) + if (!dryRun_) { - Info<< " level " << levels_[shellI][j] - << " for all cells within " << distances_[shellI][j] - << " metre." << endl; + Info<< "Refinement level according to distance to " + << shell.name() << endl; + forAll(levels_[shellI], j) + { + Info<< " level " << levels_[shellI][j] + << " for all cells within " << distances_[shellI][j] + << " metre." << endl; + } } } else @@ -130,15 +133,18 @@ void Foam::shellSurfaces::setAndCheckLevels << exit(FatalError); } - if (modes_[shellI] == INSIDE) + if (!dryRun_) { - Info<< "Refinement level " << levels_[shellI][0] - << " for all cells inside " << shell.name() << endl; - } - else - { - Info<< "Refinement level " << levels_[shellI][0] - << " for all cells outside " << shell.name() << endl; + if (modes_[shellI] == INSIDE) + { + Info<< "Refinement level " << levels_[shellI][0] + << " for all cells inside " << shell.name() << endl; + } + else + { + Info<< "Refinement level " << levels_[shellI][0] + << " for all cells outside " << shell.name() << endl; + } } } } @@ -233,7 +239,7 @@ void Foam::shellSurfaces::orient() true ); - if (anyFlipped) + if (anyFlipped && !dryRun_) { // orientedSurface will have done a clearOut of the surface. // we could do a clearout of the triSurfaceMeshes::trees() @@ -654,13 +660,19 @@ Foam::shellSurfaces::shellSurfaces if (modes_[shellI] == INSIDE) { - Info<< "Additional directional refinement level" - << " for all cells inside " << geomName << endl; + if (!dryRun_) + { + Info<< "Additional directional refinement level" + << " for all cells inside " << geomName << endl; + } } else if (modes_[shellI] == OUTSIDE) { - Info<< "Additional directional refinement level" - << " for all cells outside " << geomName << endl; + if (!dryRun_) + { + Info<< "Additional directional refinement level" + << " for all cells outside " << geomName << endl; + } } else { diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C index c7a7f043b93261551e8e6f5b6bc67b98e72a4b80..a92160a4abaf866599a402fd8f80c251705fe40d 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C @@ -2095,6 +2095,11 @@ void Foam::snappySnapDriver::smoothDisplacement motionSmoother& meshMover ) const { + if (dryRun_) + { + return; + } + const fvMesh& mesh = meshRefiner_.mesh(); const indirectPrimitivePatch& pp = meshMover.patch(); diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C index 9ceedc618791f31b387604a887d3742a00a20f8d..f3f362b035a486bcdde1cc53357a8a10499f9e74 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C @@ -3854,6 +3854,12 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurfaceFeature ) const { + if (dryRun_) + { + return nearestDisp; + } + + const Switch implicitFeatureAttraction = snapParams.implicitFeatureSnap(); const Switch explicitFeatureAttraction = snapParams.explicitFeatureSnap(); const Switch multiRegionFeatureSnap = snapParams.multiRegionFeatureSnap(); @@ -3864,7 +3870,6 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurfaceFeature << " multi-patch features : " << multiRegionFeatureSnap << nl << endl; - const indirectPrimitivePatch& pp = meshMover.patch(); const pointField& localPoints = pp.localPoints(); const fvMesh& mesh = meshRefiner_.mesh();