mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: limit printing in dry-run. See #972.
This commit is contained in:
@ -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());
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -2095,6 +2095,11 @@ void Foam::snappySnapDriver::smoothDisplacement
|
||||
motionSmoother& meshMover
|
||||
) const
|
||||
{
|
||||
if (dryRun_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const fvMesh& mesh = meshRefiner_.mesh();
|
||||
const indirectPrimitivePatch& pp = meshMover.patch();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user