Commit 0b9b34c5 authored by Franjo's avatar Franjo
Browse files

More verbose output messages.

parent 3d932ffe
......@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("input surface file");
argList args(argc, argv);
fileName inFileName(args.args()[1]);
const fileName inFileName(args.args()[1]);
triSurf surf(inFileName);
......@@ -52,7 +52,13 @@ int main(int argc, char *argv[])
boundBox bb;
triSurfaceChecks::calculateBoundingBox(surf, bb);
Info << "Surface bounding box is " << bb << endl;
Info << "\nNumber of points " << surf.nPoints() << endl;
Info << "Number of triangles " << surf.size() << endl;
Info << "Number of patches " << surf.patches().size() << endl;
Info << "Number of feature edges " << surf.nFeatureEdges() << endl;
Info << "Bounding box " << bb << nl << nl << endl;
const scalar distTol = SMALL * bb.mag();
//- calculate manifolds
const label nManifolds = triSurfaceChecks::checkSurfaceManifolds(surf);
......@@ -60,14 +66,15 @@ int main(int argc, char *argv[])
{
++nFailed;
Info << "Surface mesh consists of " << nManifolds
<< " manifolds." << endl;
Warning << "You cannot mesh geometries consisting of more than"
<< " one domain, and it must not contain baffles." << endl;
Info << "\nSurface mesh consists of " << nManifolds
<< " manifolds!!" << endl;
Info << "You cannot mesh geometries consisting of more than"
<< " one domain, and it must not contain baffles"
<< " in the domain which shall be meshed." << endl;
}
else
{
Info << "Surface mesh consists of a single manifold." << endl;
Info << "\nSurface mesh consists of a single manifold." << endl;
}
//- find open boundary edges
......@@ -75,15 +82,16 @@ int main(int argc, char *argv[])
{
++nFailed;
Info << "Surface mesh has open boundaries!!" << endl;
Warning << "This indicates that there may be some holes in the surface"
<< " mesh. Holes in the mesh must be smaller than the specified"
<< " cell size at this location. In addition, please avoid"
<< " using automatic refinement (minCellSize)." << endl;
Info << "\nSurface mesh has open boundaries!!" << endl;
Info << "This indicates that there may be some holes in the surface"
<< " mesh. Holes in the mesh must be smaller than the specified"
<< " cell size at this location. In addition, please avoid"
<< " using the automatic refinement procedure."
<< " Please avoid using the minCellSize option." << endl;
}
else
{
Info << "No holes found in the surface mesh." << endl;
Info << "No open edges found in the surface mesh." << endl;
}
//- find non-manifold edges
......@@ -91,10 +99,10 @@ int main(int argc, char *argv[])
{
++nFailed;
Info << "Surface mesh has non-manifold edges!!" << endl;
Warning << "This indicates that the surface mesh consists of multiple"
<< " domains and/or baffles. Please make sure that they are not"
<< " in the domain which shall be meshed." << endl;
Info << "\nSurface mesh has non-manifold edges!!" << endl;
Info << "This indicates that the surface mesh consists of multiple"
<< " domains and/or baffles. Please make sure that they are not"
<< " in the domain which shall be meshed." << endl;
}
else
{
......@@ -106,10 +114,10 @@ int main(int argc, char *argv[])
{
++nFailed;
Info << "Surface mesh consists of disconnected parts." << endl;
Warning << "This is not a problem if there exists a region surrounding"
<< " the other ones! In other case, the mesher will generate"
<< " the mesh in the domains with most cells." << endl;
Info << "\nSurface mesh consists of disconnected parts!!" << endl;
Info << "This is not a problem if there exists a region surrounding"
<< " all other regions! In other case, the mesher will generate"
<< " the mesh in the domains with most cells." << endl;
}
else
{
......@@ -121,24 +129,93 @@ int main(int argc, char *argv[])
{
++nFailed;
Info << "Surface mesh has some bad-quality triangles." << endl;
Warning << "This may cause problems to the automatic refinement"
<< " procedure (minCellSize). " << endl;
Info << "\nSurface mesh has some bad-quality triangles with"
<< " angles smaller than 1.0 deg!!" << endl;
Info << "This may cause problems to the automatic refinement"
<< " procedure. Please avoid using the minCellSize option."
<< endl;
}
else
{
Info << "No sliver triangles found." << endl;
}
//- find self-intersections in the surface mesh
if
(
triSurfaceChecks::checkSelfIntersections
(
surf,
"selfIntersect",
distTol
)
)
{
++nFailed;
Info << "\nFound self-intersecting parts in the surface mesh!!" << endl;
Info << "This causes problems to the automatic refinement procedure"
<< " Please avoid using the minCellSize option."
<< " It can also cause problems to the boundary layer"
<< " generation procedure." << endl;
}
else
{
Info << "No self-intersections found." << endl;
}
//- find overlaps in the surface mesh
if
(
triSurfaceChecks::checkOverlaps
(
surf,
"overlaps",
distTol,
5.0
)
)
{
++nFailed;
Info << "\nFound overlapping parts in the surface mesh!!" << endl;
Info << "This causes problems to the automatic refinement procedure."
<< " Please avoid using the minCellSize option." << endl;
}
//- check for existence of collocated points
if
(
triSurfaceChecks::checkCollocatedPoints
(
surf,
"collocatedPoints",
distTol
)
)
{
++nFailed;
Info << "\nFound collocated points in the surface mesh!!" << endl;
Info << "This causes problems to the automatic refinement procedure."
<< " Please avoid using the minCellSize option." << endl;
}
Info << nl << endl;
if( nFailed )
{
Warning << "Found " << nFailed
Info << "\nFound " << nFailed
<< " checks indicating potential problems." << endl;
Warning << "This does not mean that you cannot generate"
<< " a valid mesh. " << endl;
Info << "However, it does not mean that you cannot generate"
<< " a valid mesh.\n" << endl;
surf.writeSurface(inFileName);
}
else
{
Info << "\nSurface passes all checks.\n" << endl;
}
Info << "End\n" << 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