diff --git a/applications/utilities/surface/surfaceCoordinateSystemTransform/surfaceCoordinateSystemTransform.C b/applications/utilities/surface/surfaceCoordinateSystemTransform/surfaceCoordinateSystemTransform.C index 8453d6f94a..a8b2f980ca 100644 --- a/applications/utilities/surface/surfaceCoordinateSystemTransform/surfaceCoordinateSystemTransform.C +++ b/applications/utilities/surface/surfaceCoordinateSystemTransform/surfaceCoordinateSystemTransform.C @@ -199,7 +199,6 @@ int main(int argc, char *argv[]) if (args.options().found("clean")) { surf.cleanup(true); - surf.checkOrientation(true); } if (fromCsys.valid()) diff --git a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C index a907c7208c..0f18b5ac86 100644 --- a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C +++ b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C @@ -104,13 +104,19 @@ int main(int argc, char *argv[]) { triSurface surf(importName); + Info<< "Read surface:" << endl; + surf.writeStats(Info); + Info<< endl; + if (args.options().found("clean")) { + Info<< "Cleaning up surface" << endl; surf.cleanup(true); - surf.checkOrientation(true); + surf.writeStats(Info); + Info<< endl; } - Info << "writing " << exportName; + Info<< "writing " << exportName; if (scaleFactor <= 0) { Info<< " without scaling" << endl; @@ -119,6 +125,8 @@ int main(int argc, char *argv[]) { Info<< " with scaling " << scaleFactor << endl; surf.scalePoints(scaleFactor); + surf.writeStats(Info); + Info<< endl; } // write sorted by region @@ -128,34 +136,16 @@ int main(int argc, char *argv[]) { UnsortedMeshedSurface surf(importName); - if (args.options().found("clean")) - { - surf.cleanup(true); - surf.checkOrientation(true); - } - - Info << "writing " << exportName; - if (scaleFactor <= 0) - { - Info<< " without scaling" << endl; - } - else - { - Info<< " with scaling " << scaleFactor << endl; - surf.scalePoints(scaleFactor); - } - - surf.write(exportName); - } -#if 1 - else if (args.options().found("triFace")) - { - MeshedSurface surf(importName); + Info<< "Read surface:" << endl; + surf.writeStats(Info); + Info<< endl; if (args.options().found("clean")) { + Info<< "Cleaning up surface" << endl; surf.cleanup(true); - surf.checkOrientation(true); + surf.writeStats(Info); + Info<< endl; } Info<< "writing " << exportName; @@ -167,6 +157,39 @@ int main(int argc, char *argv[]) { Info<< " with scaling " << scaleFactor << endl; surf.scalePoints(scaleFactor); + surf.writeStats(Info); + Info<< endl; + } + surf.write(exportName); + } +#if 1 + else if (args.options().found("triFace")) + { + MeshedSurface surf(importName); + + Info<< "Read surface:" << endl; + surf.writeStats(Info); + Info<< endl; + + if (args.options().found("clean")) + { + Info<< "Cleaning up surface" << endl; + surf.cleanup(true); + surf.writeStats(Info); + Info<< endl; + } + + Info<< "writing " << exportName; + if (scaleFactor <= 0) + { + Info<< " without scaling" << endl; + } + else + { + Info<< " with scaling " << scaleFactor << endl; + surf.scalePoints(scaleFactor); + surf.writeStats(Info); + Info<< endl; } surf.write(exportName); } @@ -175,10 +198,16 @@ int main(int argc, char *argv[]) { MeshedSurface surf(importName); + Info<< "Read surface:" << endl; + surf.writeStats(Info); + Info<< endl; + if (args.options().found("clean")) { + Info<< "Cleaning up surface" << endl; surf.cleanup(true); - surf.checkOrientation(true); + surf.writeStats(Info); + Info<< endl; } Info<< "writing " << exportName; @@ -190,6 +219,8 @@ int main(int argc, char *argv[]) { Info<< " with scaling " << scaleFactor << endl; surf.scalePoints(scaleFactor); + surf.writeStats(Info); + Info<< endl; } surf.write(exportName); } diff --git a/src/surfMesh/MeshedSurface/MeshedSurface.C b/src/surfMesh/MeshedSurface/MeshedSurface.C index bbf4237b9f..04a41a9ed3 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurface.C +++ b/src/surfMesh/MeshedSurface/MeshedSurface.C @@ -420,13 +420,26 @@ Foam::MeshedSurface::~MeshedSurface() // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::MeshedSurface::onePatch() +void Foam::MeshedSurface::onePatch(const word& name) { + word patchName(name); + if (!patchName.size()) + { + if (patches_.size() >= 1) + { + patchName = patches_[0].name(); + } + if (!patchName.size()) + { + patchName = "patch0"; + } + } + // set single default patch patches_.setSize(1); patches_[0] = surfGroup ( - "patch0", + patchName, size(), // patch size 0, // patch start 0 // patch index @@ -438,9 +451,12 @@ template void Foam::MeshedSurface::checkPatches() { // extra safety, ensure we have at some patches, - // and they cover all the faces - // fix start silently - if (patches_.size() > 1) + // and they cover all the faces - fix start silently + if (patches_.size() <= 1) + { + onePatch(); + } + else { label count = 0; forAll(patches_, patchI) @@ -455,8 +471,7 @@ void Foam::MeshedSurface::checkPatches() ( "MeshedSurface::checkPatches()\n" ) - << "more nFaces " << size() - << " than patches " << count + << "more face " << size() << " than patches " << count << " ... extending final patch" << endl; @@ -468,25 +483,10 @@ void Foam::MeshedSurface::checkPatches() ( "MeshedSurface::checkPatches()\n" ) - << "more patches " << count - << " than nFaces " << size() + << "more patches " << count << " than faces " << size() << exit(FatalError); } } - else if (patches_.size() == 1) - { - // like onePatch, but preserve the name - patches_[0].size() = size(); - patches_[0].start() = 0; - if (!patches_[0].name().size()) - { - patches_[0].name() = "patch0"; - } - } - else - { - onePatch(); - } } @@ -529,38 +529,52 @@ void Foam::MeshedSurface::sortFacesAndStore template -void Foam::MeshedSurface::remapRegions(List