diff --git a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C index ccd85d8e5a..daece06c1d 100644 --- a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C +++ b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C @@ -271,13 +271,40 @@ int main(int argc, char *argv[]) args.caseName() ); + // start with "constant" + runTime.setTime(instant(0, runTime.constant()), 0); + + Info<< "runTime.instance() = " << runTime.instance() << endl; + Info<< "runTime.timeName() = " << runTime.timeName() << endl; + + + surfMesh surfIn + ( + IOobject + ( + "default", + runTime.timeName(), + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + + Info<< "surfIn = " << surfIn.nFaces() << endl; + + Info<< "runTime.instance() = " << runTime.instance() << endl; + surfMesh surfOut ( IOobject ( "mySurf", runTime.instance(), - runTime + runTime, + IOobject::NO_READ, + IOobject::NO_WRITE, + false ), surf.xfer() ); @@ -299,6 +326,25 @@ int main(int argc, char *argv[]) dimless ); + Info<<" surf name= " << surfOut.name() < + public MeshedSurface { //- Private typedefs for convenience - typedef BasicMeshedSurface MeshStorage; + typedef MeshedSurface MeshStorage; // Private data diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H index fbc0b56ebe..2890a7bd34 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H @@ -50,11 +50,11 @@ namespace Foam class sampledPatch : - public BasicMeshedSurface, + public MeshedSurface, public sampledSurface { //- Private typedefs for convenience - typedef BasicMeshedSurface MeshStorage; + typedef MeshedSurface MeshStorage; // Private data diff --git a/src/surfMesh/BasicMeshedSurface/BasicMeshedSurface.C b/src/surfMesh/BasicMeshedSurface/BasicMeshedSurface.C deleted file mode 100644 index 41295b44b6..0000000000 --- a/src/surfMesh/BasicMeshedSurface/BasicMeshedSurface.C +++ /dev/null @@ -1,572 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "BasicMeshedSurface.H" -#include "boundBox.H" -#include "mergePoints.H" - -// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // - -template -inline bool Foam::BasicMeshedSurface::isTri() -{ - return false; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::BasicMeshedSurface::BasicMeshedSurface() -: - ParentType(List(), pointField()) -{} - - -template -Foam::BasicMeshedSurface::BasicMeshedSurface -( - const Xfer< pointField >& pointLst, - const Xfer< List >& faceLst -) -: - ParentType(List(), pointField()) -{ - reset(pointLst, faceLst); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::BasicMeshedSurface::~BasicMeshedSurface() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void Foam::BasicMeshedSurface::clear() -{ - ParentType::clearOut(); - - storedPoints().clear(); - storedFaces().clear(); -} - - -template -void Foam::BasicMeshedSurface::movePoints(const pointField& newPoints) -{ - // Remove all geometry dependent data - ParentType::clearTopology(); - - // Adapt for new point position - ParentType::movePoints(newPoints); - - // Copy new points - storedPoints() = newPoints; -} - - -template -void Foam::BasicMeshedSurface::scalePoints(const scalar& scaleFactor) -{ - // avoid bad scaling - if (scaleFactor > 0 && scaleFactor != 1.0) - { - // Remove all geometry dependent data - ParentType::clearTopology(); - - // Adapt for new point position - ParentType::movePoints(pointField()); - - storedPoints() *= scaleFactor; - } -} - - -template -void Foam::BasicMeshedSurface::reset -( - const Xfer< pointField >& pointLst, - const Xfer< List >& faceLst -) -{ - ParentType::clearOut(); - - // Take over new primitive data. - // Optimized to avoid overwriting data at all - if (&pointLst) - { - storedPoints().transfer(pointLst()); - } - - if (&faceLst) - { - storedFaces().transfer(faceLst()); - } -} - - -template -void Foam::BasicMeshedSurface::reset -( - const Xfer< List >& pointLst, - const Xfer< List >& faceLst -) -{ - ParentType::clearOut(); - - // Take over new primitive data. - // Optimized to avoid overwriting data at all - if (&pointLst) - { - storedPoints().transfer(pointLst()); - } - - if (&faceLst) - { - storedFaces().transfer(faceLst()); - } -} - - -// Remove badly degenerate faces, double faces. -template -void Foam::BasicMeshedSurface::cleanup(const bool verbose) -{ - // merge points (already done for STL, TRI) - stitchFaces(SMALL, verbose); - - checkFaces(verbose); - this->checkTopology(verbose); -} - - -template -bool Foam::BasicMeshedSurface::stitchFaces -( - const scalar tol, - const bool verbose -) -{ - pointField& pointLst = this->storedPoints(); - - // Merge points - labelList pointMap(pointLst.size()); - pointField newPoints(pointLst.size()); - - bool hasMerged = mergePoints(pointLst, tol, verbose, pointMap, newPoints); - - if (!hasMerged) - { - return false; - } - - if (verbose) - { - Info<< "BasicMeshedSurface::stitchFaces : Renumbering all faces" - << endl; - } - - // Set the coordinates to the merged ones - pointLst.transfer(newPoints); - - List& faceLst = this->storedFaces(); - - List