Commit 9412fc62 authored by Alen Cukrov's avatar Alen Cukrov
Browse files

Five new mesh quality settings added.

parent 366d854f
...@@ -764,6 +764,54 @@ void checkMeshDict::checkRenameBoundary() const ...@@ -764,6 +764,54 @@ void checkMeshDict::checkRenameBoundary() const
} }
} }
//Mesh quality criteria specified by the user
void checkMeshDict::checkQualitySettings() const
{
if( meshDict_.found("meshQualitySettings") )
{
const dictionary& qualityDict = meshDict_.subDict("meshQualitySettings");
//- read maximum non-orthogonality defined by the user
if( qualityDict.found("maxNonOrthogonality") )
{
readScalar(qualityDict.lookup("maxNonOrthogonality"));
}
//- read maximum skewness defined by the user
if( qualityDict.found("maxSkewness") )
{
readScalar(qualityDict.lookup("maxSkewness"));
}
//- read minimum volume of the face pyramid defined by the user
if( qualityDict.found("minPyramidVolume") )
{
readScalar(qualityDict.lookup("minPyramidVolume"));
}
//- read face flatness defined by the user
if( qualityDict.found("faceFlatness") )
{
readScalar(qualityDict.lookup("faceFlatness"));
}
//- read minimum tetrahedral part of a cell defined by the user
if( qualityDict.found("minCellPartTetrahedra") )
{
readScalar(qualityDict.lookup("minCellPartTetrahedra"));
}
//- read minimum area of a face defined by the user
if( qualityDict.found("minimumFaceArea") )
{
readScalar(qualityDict.lookup("minimumFaceArea"));
}
}
}
void checkMeshDict::checkEntries() const void checkMeshDict::checkEntries() const
{ {
checkBasicSettings(); checkBasicSettings();
...@@ -785,6 +833,8 @@ void checkMeshDict::checkEntries() const ...@@ -785,6 +833,8 @@ void checkMeshDict::checkEntries() const
checkBoundaryLayers(); checkBoundaryLayers();
checkRenameBoundary(); checkRenameBoundary();
checkQualitySettings();
} }
void checkMeshDict::updatePatchCellSize void checkMeshDict::updatePatchCellSize
......
...@@ -92,6 +92,9 @@ class checkMeshDict ...@@ -92,6 +92,9 @@ class checkMeshDict
//- check renameBoundary entry //- check renameBoundary entry
void checkRenameBoundary() const; void checkRenameBoundary() const;
//- check entry for mesh quality
void checkQualitySettings() const;
//- perform all checks //- perform all checks
void checkEntries() const; void checkEntries() const;
......
...@@ -2044,11 +2044,108 @@ label findBadFaces ...@@ -2044,11 +2044,108 @@ label findBadFaces
{ {
badFaces.clear(); badFaces.clear();
//Default minimum volume of the face pyramid
scalar minPyramidVolume = VSMALL;
//Default face flatness
scalar faceFlatness = 0.8;
//Default minimum tetrahedral part of a cell
scalar minCellPartTetrahedra = VSMALL;
//Default minimum area of a face
scalar minimumFaceArea = VSMALL;
//Check whether quality criteria is specified by user
if( mesh.returnTime().foundObject<IOdictionary>("meshDict") )
{
const dictionary& meshDict =
mesh.returnTime().lookupObject<IOdictionary>("meshDict");
Info << "Reading meshDict" << endl;
if( meshDict.found("meshQualitySettings") )
{
const dictionary& qualityDict =
meshDict.subDict("meshQualitySettings");
Info << "Reading meshQualitySettings" << endl;
//Reading minimum volume of the face pyramid defined by the user
if( qualityDict.found("minPyramidVolume") )
{
minPyramidVolume =
readScalar
(
qualityDict.lookup("minPyramidVolume")
);
Info << "Reading minPyramidVolume" << endl;
Info << "minPyramidVolume is " << minPyramidVolume << endl;
}
//Reading face flatness defined by the user
if( qualityDict.found("faceFlatness") )
{
faceFlatness =
readScalar
(
qualityDict.lookup("faceFlatness")
);
Info << "Reading faceFlatness" << endl;
Info << "faceFlatness is " << faceFlatness << endl;
}
//Reading minimum tetrahedral part of a cell defined by the user
if( qualityDict.found("minCellPartTetrahedra") )
{
minCellPartTetrahedra =
readScalar
(
qualityDict.lookup("minCellPartTetrahedra")
);
Info << "Reading minCellPartTetrahedra" << endl;
Info << "minCellPartTetrahedra is " << minCellPartTetrahedra << endl;
}
//Reading minimum area of a face defined by the user
if( qualityDict.found("minimumFaceArea") )
{
minimumFaceArea =
readScalar
(
qualityDict.lookup("minimumFaceArea")
);
Info << "Reading minimumFaceArea" << endl;
Info << "minimumFaceArea is " << minimumFaceArea << endl;
}
}
}
polyMeshGenChecks::checkFacePyramids polyMeshGenChecks::checkFacePyramids
( (
mesh, mesh,
report, report,
VSMALL, minPyramidVolume,
&badFaces, &badFaces,
activeFacePtr activeFacePtr
); );
...@@ -2057,7 +2154,7 @@ label findBadFaces ...@@ -2057,7 +2154,7 @@ label findBadFaces
( (
mesh, mesh,
report, report,
0.8, faceFlatness,
&badFaces, &badFaces,
activeFacePtr activeFacePtr
); );
...@@ -2066,7 +2163,7 @@ label findBadFaces ...@@ -2066,7 +2163,7 @@ label findBadFaces
( (
mesh, mesh,
report, report,
VSMALL, minCellPartTetrahedra,
&badFaces, &badFaces,
activeFacePtr activeFacePtr
); );
...@@ -2075,7 +2172,7 @@ label findBadFaces ...@@ -2075,7 +2172,7 @@ label findBadFaces
( (
mesh, mesh,
report, report,
VSMALL, minimumFaceArea,
&badFaces, &badFaces,
activeFacePtr activeFacePtr
); );
...@@ -2095,11 +2192,77 @@ label findLowQualityFaces ...@@ -2095,11 +2192,77 @@ label findLowQualityFaces
{ {
badFaces.clear(); badFaces.clear();
//Default maximum non-orthogonality
scalar maxNonOrtho = 65.0;
//Default maximum skewness
scalar maxSkewness = 2.0;
Info << "maxNonOrtho" << maxNonOrtho << endl;
//Check whether quality criteria is specified by user
//if( mesh_.returnTime().foundObject<IOdictionary>("meshDict") )
if( mesh.returnTime().foundObject<IOdictionary>("meshDict") )
{
const dictionary& meshDict =
//mesh_.returnTime().lookupObject<IOdictionary>("meshDict");
mesh.returnTime().lookupObject<IOdictionary>("meshDict");
Info << "Reading meshDict" << endl;
if( meshDict.found("meshQualitySettings") )
{
const dictionary& qualityDict =
meshDict.subDict("meshQualitySettings");
Info << "Reading meshQualitySettings" << endl;
//Reading maximum non-orthogonality defined by the user
if( qualityDict.found("maxNonOrthogonality") )
{
maxNonOrtho =
readScalar
(
qualityDict.lookup("maxNonOrthogonality")
);
Info << "Reading maxNonOrtho" << endl;
Info << "maxNonOrtho is " << maxNonOrtho << endl;
}
//Reading maximum skewness defined by the user
if( qualityDict.found("maxSkewness") )
{
maxSkewness =
readScalar
(
qualityDict.lookup("maxSkewness")
);
Info << "Reading maxSkewness" << endl;
Info << "maxSkewness is " << maxSkewness << endl;
}
}
}
polyMeshGenChecks::checkFaceDotProduct polyMeshGenChecks::checkFaceDotProduct
( (
mesh, mesh,
report, report,
65.0, maxNonOrtho,
&badFaces, &badFaces,
activeFacePtr activeFacePtr
); );
...@@ -2108,7 +2271,7 @@ label findLowQualityFaces ...@@ -2108,7 +2271,7 @@ label findLowQualityFaces
( (
mesh, mesh,
report, report,
2.0, maxSkewness,
&badFaces, &badFaces,
activeFacePtr activeFacePtr
); );
......
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