mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: user size limit. See #972.
This commit is contained in:
@ -858,6 +858,11 @@ int main(int argc, char *argv[])
|
|||||||
writer<scalar>::New(setFormat)
|
writer<scalar>::New(setFormat)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const scalar maxSizeRatio
|
||||||
|
(
|
||||||
|
meshDict.lookupOrDefault<scalar>("maxSizeRatio", 100.0)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Read decomposePar dictionary
|
// Read decomposePar dictionary
|
||||||
dictionary decomposeDict;
|
dictionary decomposeDict;
|
||||||
@ -1121,10 +1126,10 @@ int main(int argc, char *argv[])
|
|||||||
// Check geometry
|
// Check geometry
|
||||||
allGeometry.checkGeometry
|
allGeometry.checkGeometry
|
||||||
(
|
(
|
||||||
100.0, // max size ratio
|
maxSizeRatio, // max size ratio
|
||||||
1e-9, // intersection tolerance
|
1e-9, // intersection tolerance
|
||||||
setFormatter,
|
setFormatter,
|
||||||
0.01, // min triangle quality
|
0.01, // min triangle quality
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1146,12 +1151,12 @@ int main(int argc, char *argv[])
|
|||||||
const boundBox& bb = s.bounds();
|
const boundBox& bb = s.bounds();
|
||||||
|
|
||||||
scalar ratio = bb.mag() / meshBb.mag();
|
scalar ratio = bb.mag() / meshBb.mag();
|
||||||
if (ratio > 100.0 || ratio < 1.0/100.0)
|
if (ratio > maxSizeRatio || ratio < 1.0/maxSizeRatio)
|
||||||
{
|
{
|
||||||
Warning
|
Warning
|
||||||
<< " " << allGeometry.names()[geomi]
|
<< " " << allGeometry.names()[geomi]
|
||||||
<< " bounds differ from mesh"
|
<< " bounds differ from mesh"
|
||||||
<< " by more than a factor 100:" << nl
|
<< " by more than a factor " << maxSizeRatio << ":" << nl
|
||||||
<< " bounding box : " << bb << nl
|
<< " bounding box : " << bb << nl
|
||||||
<< " mesh bounding box : " << meshBb
|
<< " mesh bounding box : " << meshBb
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -1259,10 +1264,10 @@ int main(int argc, char *argv[])
|
|||||||
OStringStream os;
|
OStringStream os;
|
||||||
bool hasErrors = features.checkSizes
|
bool hasErrors = features.checkSizes
|
||||||
(
|
(
|
||||||
100.0, //const scalar maxRatio,
|
maxSizeRatio, //const scalar maxRatio,
|
||||||
mesh.bounds(),
|
mesh.bounds(),
|
||||||
true, //const bool report,
|
true, //const bool report,
|
||||||
os //FatalIOError
|
os //FatalIOError
|
||||||
);
|
);
|
||||||
if (hasErrors)
|
if (hasErrors)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -143,8 +143,9 @@ bool Foam::motionSmootherAlgo::checkMesh
|
|||||||
<< "Missing/incorrect required dictionary entries:" << nl
|
<< "Missing/incorrect required dictionary entries:" << nl
|
||||||
<< nl
|
<< nl
|
||||||
<< IOerrorMsg.c_str() << nl
|
<< IOerrorMsg.c_str() << nl
|
||||||
<< errorMsg.c_str() << nl << nl
|
<< errorMsg.c_str() << nl
|
||||||
<< "Exiting dry-run" << nl << endl;
|
//<< nl << "Exiting dry-run" << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
FatalError.clear();
|
FatalError.clear();
|
||||||
FatalIOError.clear();
|
FatalIOError.clear();
|
||||||
@ -576,17 +577,18 @@ bool Foam::motionSmootherAlgo::checkMesh
|
|||||||
|
|
||||||
if (errorMsg.size() || IOerrorMsg.size())
|
if (errorMsg.size() || IOerrorMsg.size())
|
||||||
{
|
{
|
||||||
errorMsg = "[dryRun] " + errorMsg;
|
//errorMsg = "[dryRun] " + errorMsg;
|
||||||
errorMsg.replaceAll("\n", "\n[dryRun] ");
|
//errorMsg.replaceAll("\n", "\n[dryRun] ");
|
||||||
IOerrorMsg = "[dryRun] " + IOerrorMsg;
|
//IOerrorMsg = "[dryRun] " + IOerrorMsg;
|
||||||
IOerrorMsg.replaceAll("\n", "\n[dryRun] ");
|
//IOerrorMsg.replaceAll("\n", "\n[dryRun] ");
|
||||||
|
|
||||||
Perr<< nl
|
Perr<< nl
|
||||||
<< "Missing/incorrect required dictionary entries:" << nl
|
<< "Missing/incorrect required dictionary entries:" << nl
|
||||||
<< nl
|
<< nl
|
||||||
<< IOerrorMsg.c_str() << nl
|
<< IOerrorMsg.c_str() << nl
|
||||||
<< errorMsg.c_str() << nl << nl
|
<< errorMsg.c_str() << nl
|
||||||
<< "Exiting dry-run" << nl << endl;
|
//<< nl << "Exiting dry-run" << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
FatalError.clear();
|
FatalError.clear();
|
||||||
FatalIOError.clear();
|
FatalIOError.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user