mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Add usage information for snappyHexMesh -overwrite option.
Make debug optional. - minor wording changes in the messages
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,11 +56,6 @@ scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol)
|
||||
{
|
||||
const boundBox& meshBb = mesh.bounds();
|
||||
scalar mergeDist = mergeTol * meshBb.mag();
|
||||
scalar writeTol = std::pow
|
||||
(
|
||||
scalar(10.0),
|
||||
-scalar(IOstream::defaultPrecision())
|
||||
);
|
||||
|
||||
Info<< nl
|
||||
<< "Overall mesh bounding box : " << meshBb << nl
|
||||
@ -68,17 +63,27 @@ scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol)
|
||||
<< "Absolute matching distance : " << mergeDist << nl
|
||||
<< endl;
|
||||
|
||||
if (mesh.time().writeFormat() == IOstream::ASCII && mergeTol < writeTol)
|
||||
// check writing tolerance
|
||||
if (mesh.time().writeFormat() == IOstream::ASCII)
|
||||
{
|
||||
FatalErrorIn("getMergeDistance(const polyMesh&, const scalar)")
|
||||
<< "Your current settings specify ASCII writing with "
|
||||
<< IOstream::defaultPrecision() << " digits precision." << endl
|
||||
<< "Your merging tolerance (" << mergeTol << ") is finer than this."
|
||||
<< endl
|
||||
<< "Please change your writeFormat to binary"
|
||||
<< " or increase the writePrecision" << endl
|
||||
<< "or adjust the merge tolerance (-mergeTol)."
|
||||
<< exit(FatalError);
|
||||
const scalar writeTol = std::pow
|
||||
(
|
||||
scalar(10.0),
|
||||
-scalar(IOstream::defaultPrecision())
|
||||
);
|
||||
|
||||
if (mergeTol < writeTol)
|
||||
{
|
||||
FatalErrorIn("getMergeDistance(const polyMesh&, const dictionary&)")
|
||||
<< "Your current settings specify ASCII writing with "
|
||||
<< IOstream::defaultPrecision() << " digits precision." << nl
|
||||
<< "Your merging tolerance (" << mergeTol
|
||||
<< ") is finer than this." << nl
|
||||
<< "Change to binary writeFormat, "
|
||||
<< "or increase the writePrecision" << endl
|
||||
<< "or adjust the merge tolerance (mergeTol)."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return mergeDist;
|
||||
@ -107,7 +112,7 @@ void writeMesh
|
||||
mesh.time().path()/meshRefiner.timeName()
|
||||
);
|
||||
}
|
||||
Info<< "Written mesh in = "
|
||||
Info<< "Wrote mesh in = "
|
||||
<< mesh.time().cpuTimeIncrement() << " s." << endl;
|
||||
}
|
||||
|
||||
@ -115,7 +120,11 @@ void writeMesh
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addBoolOption("overwrite");
|
||||
argList::addBoolOption
|
||||
(
|
||||
"overwrite",
|
||||
"overwrite existing mesh files"
|
||||
);
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
@ -126,7 +135,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
|
||||
// Check patches and faceZones are synchronised
|
||||
mesh.boundaryMesh().checkParallelSync(true);
|
||||
meshRefinement::checkCoupledFaceZones(mesh);
|
||||
@ -173,7 +181,7 @@ int main(int argc, char *argv[])
|
||||
// layer addition parameters
|
||||
const dictionary& layerDict = meshDict.subDict("addLayersControls");
|
||||
|
||||
|
||||
// absolute merge distance
|
||||
const scalar mergeDist = getMergeDistance
|
||||
(
|
||||
mesh,
|
||||
@ -181,17 +189,16 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Debug
|
||||
// ~~~~~
|
||||
|
||||
const label debug(readLabel(meshDict.lookup("debug")));
|
||||
const label debug = meshDict.lookupOrDefault<label>("debug", 0);
|
||||
if (debug > 0)
|
||||
{
|
||||
meshRefinement::debug = debug;
|
||||
meshRefinement::debug = debug;
|
||||
autoRefineDriver::debug = debug;
|
||||
autoSnapDriver::debug = debug;
|
||||
autoLayerDriver::debug = debug;
|
||||
autoSnapDriver::debug = debug;
|
||||
autoLayerDriver::debug = debug;
|
||||
}
|
||||
|
||||
|
||||
@ -272,7 +279,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
meshRefiner.write
|
||||
(
|
||||
debug&meshRefinement::OBJINTERSECTIONS,
|
||||
debug & meshRefinement::OBJINTERSECTIONS,
|
||||
mesh.time().path()/meshRefiner.timeName()
|
||||
);
|
||||
|
||||
@ -357,9 +364,9 @@ int main(int argc, char *argv[])
|
||||
// Now do the real work -refinement -snapping -layers
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Switch wantRefine(meshDict.lookup("castellatedMesh"));
|
||||
Switch wantSnap(meshDict.lookup("snap"));
|
||||
Switch wantLayers(meshDict.lookup("addLayers"));
|
||||
const Switch wantRefine(meshDict.lookup("castellatedMesh"));
|
||||
const Switch wantSnap(meshDict.lookup("snap"));
|
||||
const Switch wantLayers(meshDict.lookup("addLayers"));
|
||||
|
||||
if (wantRefine)
|
||||
{
|
||||
@ -465,7 +472,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user