ENH: surfaceClean: do a triangle cleanup unless suppressed

This commit is contained in:
mattijs
2011-03-29 12:27:25 +01:00
parent 41a638d6dd
commit 4fa972e4be

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,7 @@ Application
surfaceClean surfaceClean
Description Description
- removes baffles
- collapses small edges, removing triangles. - collapses small edges, removing triangles.
- converts sliver triangles into split edges by projecting point onto - converts sliver triangles into split edges by projecting point onto
base of triangle. base of triangle.
@ -50,6 +51,11 @@ int main(int argc, char *argv[])
argList::validArgs.append("surfaceFile"); argList::validArgs.append("surfaceFile");
argList::validArgs.append("min length"); argList::validArgs.append("min length");
argList::validArgs.append("output surfaceFile"); argList::validArgs.append("output surfaceFile");
argList::addBoolOption
(
"noClean",
"perform some surface checking/cleanup on the input surface"
);
argList args(argc, argv); argList args(argc, argv);
const fileName inFileName = args[1]; const fileName inFileName = args[1];
@ -65,6 +71,11 @@ int main(int argc, char *argv[])
triSurface surf(inFileName); triSurface surf(inFileName);
surf.writeStats(Info); surf.writeStats(Info);
if (!args.optionFound("noClean"))
{
Info<< "Removing duplicate and illegal triangles ..." << nl << endl;
surf.cleanup(true);
}
Info<< "Collapsing triangles to edges ..." << nl << endl; Info<< "Collapsing triangles to edges ..." << nl << endl;