Commit e7a548d8 authored by mattijs's avatar mattijs
Browse files

ENH: snappyHexMesh: split debug

parent e4f7c306
......@@ -372,7 +372,7 @@ void Foam::autoLayerDriver::handleFeatureAngle
label vertI = 0;
autoPtr<OFstream> str;
if (debug)
if (debug&meshRefinement::MESH)
{
str.reset
(
......@@ -2427,8 +2427,7 @@ void Foam::autoLayerDriver::addLayers
List<labelPair> baffles;
meshRefiner_.createZoneBaffles(globalToPatch_, baffles);
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh.time())++;
Info<< "Writing baffled mesh to " << meshRefiner_.timeName() << endl;
......@@ -2926,7 +2925,7 @@ void Foam::autoLayerDriver::addLayers
// Dump to .obj file for debugging.
if (debug)
if (debug&meshRefinement::MESH || debug&meshRefinement::LAYERINFO)
{
dumpDisplacement
(
......@@ -3078,7 +3077,7 @@ void Foam::autoLayerDriver::addLayers
);
if (debug)
if (debug&meshRefinement::MESH)
{
Info<< "Writing layer mesh to " << meshRefiner_.timeName() << endl;
newMesh.write();
......
......@@ -1122,7 +1122,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
}
}
if (debug)
if (debug&meshRefinement::MESH || debug&meshRefinement::LAYERINFO)
{
Info<< "medialAxisSmoothingInfo :"
<< " Writing:" << nl
......@@ -1409,7 +1409,7 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
*dispVec[pointI];
}
if (debug)
if (debug&meshRefinement::MESH || debug&meshRefinement::LAYERINFO)
{
const_cast<Time&>(mesh.time())++;
Info<< "Writing wanted-displacement mesh (possibly illegal) to "
......@@ -1439,6 +1439,9 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
debug,
mesh.time().path()/meshRefiner_.timeName()
);
dispVec.write();
medialDist.write();
medialRatio.write();
meshMover.movePoints(oldPoints);
}
......
......@@ -315,7 +315,7 @@ void Foam::autoRefineDriver::removeInsideCells
refineParams.keepPoints()[0]
);
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing subsetted mesh to time "
<< meshRefiner_.timeName() << '.' << endl;
......@@ -376,7 +376,7 @@ Foam::label Foam::autoRefineDriver::shellRefine
)
);
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Dumping " << candidateCells.size()
<< " cells to cellSet candidateCellsFromShells." << endl;
......@@ -555,7 +555,7 @@ void Foam::autoRefineDriver::zonify
refineParams.allowFreeStandingZoneFaces()
);
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing zoned mesh to time "
<< meshRefiner_.timeName() << '.' << endl;
......@@ -648,7 +648,7 @@ void Foam::autoRefineDriver::splitAndMergeBaffles
<< mesh.time().cpuTimeIncrement() << " s." << endl;
}
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing handleProblemCells mesh to time "
<< meshRefiner_.timeName() << '.' << endl;
......
......@@ -718,7 +718,7 @@ void Foam::autoSnapDriver::preSmoothPatch
// The current mesh is the starting mesh to smooth from.
meshMover.correct();
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh.time())++;
Info<< "Writing patch smoothed mesh to time "
......@@ -995,7 +995,7 @@ void Foam::autoSnapDriver::smoothDisplacement
Info<< "Displacement smoothed in = "
<< mesh.time().cpuTimeIncrement() << " s\n" << nl << endl;
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh.time())++;
Info<< "Writing smoothed mesh to time " << meshRefiner_.timeName()
......@@ -1064,7 +1064,7 @@ bool Foam::autoSnapDriver::scaleMesh
Info<< "Successfully moved mesh" << endl;
break;
}
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh.time())++;
Info<< "Writing scaled mesh to time " << meshRefiner_.timeName()
......@@ -1517,7 +1517,7 @@ void Foam::autoSnapDriver::doSnap
break;
}
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh.time())++;
Info<< "Writing scaled mesh to time "
......@@ -1560,7 +1560,7 @@ void Foam::autoSnapDriver::doSnap
motionDict
);
if (nChanged > 0 && debug)
if (nChanged > 0 && debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh.time())++;
Info<< "Writing patchFace merged mesh to time "
......
......@@ -88,7 +88,9 @@ public:
{
MESH = 1,
SCALARLEVELS = 2,
OBJINTERSECTIONS = 4
OBJINTERSECTIONS = 4,
FEATURESEEDS = 8,
LAYERINFO = 16
};
......
......@@ -677,7 +677,7 @@ Foam::List<Foam::labelPair> Foam::meshRefinement::getDuplicateFaces
<< " pairs of duplicate faces." << nl << endl;
if (debug)
if (debug&meshRefinement::MESH)
{
faceSet duplicateFaceSet(mesh_, "duplicateFaces", 2*dupI);
......@@ -765,7 +765,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
<< abort(FatalError);
}
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh_.time())++;
Pout<< "Writing zone-baffled mesh to time " << timeName()
......@@ -1870,7 +1870,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
printMeshInfo(debug, "After introducing baffles");
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing baffled mesh to time " << timeName()
<< endl;
......@@ -1906,7 +1906,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
Info<< "Analyzed problem cells in = "
<< runTime.cpuTimeIncrement() << " s\n" << nl << endl;
if (debug)
if (debug&meshRefinement::MESH)
{
faceSet problemTopo(mesh_, "problemFacesTopo", 100);
......@@ -1953,7 +1953,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
printMeshInfo(debug, "After introducing baffles");
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing extra baffled mesh to time "
<< timeName() << endl;
......@@ -1989,7 +1989,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
printMeshInfo(debug, "After subsetting");
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing subsetted mesh to time " << timeName()
<< endl;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -298,7 +298,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
if (nFaceSets > 0)
{
if (debug)
if (debug&meshRefinement::MESH)
{
faceSet allSets(mesh_, "allFaceSets", allFaceSets.size());
forAll(allFaceSets, setI)
......@@ -365,7 +365,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
}
updateMesh(map, growFaceCellFace(retestFaces));
if (debug)
if (debug&meshRefinement::MESH)
{
// Check sync
Pout<< "Checking sync after initial merging " << nFaceSets
......@@ -432,7 +432,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
}
if (debug)
if (debug&meshRefinement::MESH)
{
errorFaces.instance() = timeName();
Pout<< "Writing all faces in error to faceSet "
......@@ -477,7 +477,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
Info<< "Masters that need to be restored:"
<< nRestore << endl;
if (debug)
if (debug&meshRefinement::MESH)
{
faceSet restoreSet(mesh_, "mastersToRestore", mastersToRestore);
restoreSet.instance() = timeName();
......@@ -569,7 +569,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
restoredCells
);
if (debug)
if (debug&meshRefinement::MESH)
{
// Check sync
Pout<< "Checking sync after restoring " << retestFaces.size()
......@@ -878,7 +878,7 @@ Foam::label Foam::meshRefinement::mergeEdgesUndo
break;
}
if (debug)
if (debug&meshRefinement::MESH)
{
errorFaces.instance() = timeName();
Pout<< "**Writing all faces in error to faceSet "
......@@ -929,7 +929,7 @@ Foam::label Foam::meshRefinement::mergeEdgesUndo
doRestorePoints(pointRemover, masterErrorFaces);
}
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh_.time())++;
Pout<< "Writing merged-edges mesh to time "
......
......@@ -198,7 +198,7 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells
<< " faces on edge-connected cells of differing level."
<< endl;
if (debug)
if (debug&meshRefinement::MESH)
{
faceSet fSet(mesh_, "edgeConnectedFaces", candidateFaces);
fSet.instance() = timeName();
......@@ -262,7 +262,7 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells
}
}
if (debug)
if (debug&meshRefinement::MESH)
{
perpFaces.instance() = timeName();
Pout<< "Writing " << perpFaces.size()
......@@ -484,7 +484,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
<< returnReduce(problemCells.size(), sumOp<label>())
<< " cells edge-connected to lower level cells." << endl;
if (debug)
if (debug&meshRefinement::MESH)
{
cellSet problemCellSet(mesh_, "problemCells", problemCells.toc());
problemCellSet.instance() = timeName();
......@@ -582,7 +582,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
}
}
if (debug)
if (debug&meshRefinement::MESH)
{
const_cast<Time&>(mesh_.time())++;
pointField oldPoints(mesh_.points());
......
......@@ -203,7 +203,7 @@ Foam::labelList Foam::meshRefinement::getChangedFaces
}
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "getChangedFaces : Detected "
<< " local:" << changedFaces.size()
......@@ -308,7 +308,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement
{
if (pointEdges[pointI].size() != 2)
{
if (debug)
if (debug&meshRefinement::FEATURESEEDS)
{
Pout<< "Adding particle from point:" << pointI
<< " coord:" << featureMesh.points()[pointI]
......@@ -353,7 +353,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement
{
const edge& e = featureMesh.edges()[edgeI];
label pointI = e.start();
if (debug)
if (debug&meshRefinement::FEATURESEEDS)
{
Pout<< "Adding particle from point:" << pointI
<< " coord:" << featureMesh.points()[pointI]
......@@ -1330,7 +1330,7 @@ Foam::meshRefinement::refineAndBalance
// Do all refinement
refine(cellsToRefine);
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing refined but unbalanced " << msg
<< " mesh to time " << timeName() << endl;
......@@ -1394,7 +1394,7 @@ Foam::meshRefinement::refineAndBalance
printMeshInfo(debug, "After balancing " + msg);
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing balanced " << msg
<< " mesh to time " << timeName() << endl;
......@@ -1516,7 +1516,7 @@ Foam::meshRefinement::balanceAndRefine
printMeshInfo(debug, "After balancing " + msg);
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing balanced " << msg
<< " mesh to time " << timeName() << endl;
......@@ -1539,7 +1539,7 @@ Foam::meshRefinement::balanceAndRefine
refine(cellsToRefine);
if (debug)
if (debug&meshRefinement::MESH)
{
Pout<< "Writing refined " << msg
<< " mesh to time " << timeName() << endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment