From 017903cb8586fbb0f72156e16a959e935c8be816 Mon Sep 17 00:00:00 2001 From: Henry Weller <http://cfd.direct> Date: Mon, 20 Jun 2016 09:39:02 +0100 Subject: [PATCH] Remove/replace deprecated functions and classes --- .../mesh/conversion/ansysToFoam/ansysToFoam.L | 2 +- .../surfaceSplitByTopology.C | 4 +- src/OpenFOAM/global/argList/argList.H | 8 - .../coordinateSystems/coordinateSystems.C | 6 - .../coordinateSystems/coordinateSystems.H | 4 - .../triSurfaceSearch/triSurfaceRegionSearch.H | 7 +- src/surfMesh/Make/files | 2 - .../surfaceFormats/ftr/FTRsurfaceFormat.C | 99 ------------ .../surfaceFormats/ftr/FTRsurfaceFormat.H | 144 ------------------ .../ftr/FTRsurfaceFormatRunTime.C | 59 ------- 10 files changed, 6 insertions(+), 329 deletions(-) delete mode 100644 src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C delete mode 100644 src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.H delete mode 100644 src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormatRunTime.C diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index 4b33ed3a9f..ec3581553b 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -315,7 +315,7 @@ int main(int argc, char *argv[]) #include "createTime.H" - fileName ansysFile(args.additionalArgs()[0]); + fileName ansysFile(args[1]); ifstream ansysStream(ansysFile.c_str()); if (!ansysStream) diff --git a/applications/utilities/surface/surfaceSplitByTopology/surfaceSplitByTopology.C b/applications/utilities/surface/surfaceSplitByTopology/surfaceSplitByTopology.C index 9ab191ae21..fa4efb0a0d 100644 --- a/applications/utilities/surface/surfaceSplitByTopology/surfaceSplitByTopology.C +++ b/applications/utilities/surface/surfaceSplitByTopology/surfaceSplitByTopology.C @@ -44,10 +44,10 @@ int main(int argc, char *argv[]) argList::validArgs.append("output surface file"); argList args(argc, argv); - fileName surfFileName(args.additionalArgs()[0]); + fileName surfFileName(args[1]); Info<< "Reading surface from " << surfFileName << endl; - fileName outFileName(args.additionalArgs()[1]); + fileName outFileName(args[2]); fileName outFileBaseName = outFileName.lessExt(); word outExtension = outFileName.ext(); diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index a3df89afd4..cdbf34bf30 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -262,14 +262,6 @@ public: template<class T> inline T argRead(const label index) const; - //- Return arguments that are additional to the executable - // \deprecated use operator[] directly (deprecated Feb 2010) - stringList::subList additionalArgs() const - { - return stringList::subList(args_, args_.size()-1, 1); - } - - //- Return options inline const Foam::HashTable<string>& options() const; diff --git a/src/meshTools/coordinateSystems/coordinateSystems.C b/src/meshTools/coordinateSystems/coordinateSystems.C index f49a25835c..d744baa804 100644 --- a/src/meshTools/coordinateSystems/coordinateSystems.C +++ b/src/meshTools/coordinateSystems/coordinateSystems.C @@ -98,12 +98,6 @@ const Foam::coordinateSystems& Foam::coordinateSystems::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::label Foam::coordinateSystems::find(const keyType& key) const -{ - return findIndex(key); -} - - Foam::labelList Foam::coordinateSystems::findIndices(const keyType& key) const { labelList indices; diff --git a/src/meshTools/coordinateSystems/coordinateSystems.H b/src/meshTools/coordinateSystems/coordinateSystems.H index d59b47bfc9..9c33082eff 100644 --- a/src/meshTools/coordinateSystems/coordinateSystems.H +++ b/src/meshTools/coordinateSystems/coordinateSystems.H @@ -122,10 +122,6 @@ public: //- Find and return index for the first match, return -1 if not found label findIndex(const keyType& key) const; - //- Find and return index for the first match, returns -1 if not found - // \deprecated use findIndex() instead (deprecated Jul 2010) - label find(const keyType& key) const; - //- Search for given key bool found(const keyType& key) const; diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceRegionSearch.H b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceRegionSearch.H index c8c421b900..1390bfa98f 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceRegionSearch.H +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceRegionSearch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,11 +113,10 @@ public: // Access //- Demand driven construction of octree for each region. - // @todo Currently creates a tree for each region; could optimise - // by only constructing trees when they are in regionIndices + // Currently creates a tree for each region; could optimise + // by only constructing trees when they are in regionIndices const PtrList<treeType>& treeByRegion() const; - // Query //- Find the nearest point on the surface out of the regions diff --git a/src/surfMesh/Make/files b/src/surfMesh/Make/files index 3b63a621ae..f860243104 100644 --- a/src/surfMesh/Make/files +++ b/src/surfMesh/Make/files @@ -22,7 +22,6 @@ $(surfaceFormats)/surfaceFormatsCore.C $(surfaceFormats)/ac3d/AC3DsurfaceFormatCore.C $(surfaceFormats)/ac3d/AC3DsurfaceFormatRunTime.C -$(surfaceFormats)/ftr/FTRsurfaceFormatRunTime.C $(surfaceFormats)/gts/GTSsurfaceFormatRunTime.C $(surfaceFormats)/nas/NASsurfaceFormatRunTime.C $(surfaceFormats)/obj/OBJsurfaceFormatRunTime.C @@ -46,4 +45,3 @@ $(surfaceFormats)/x3d/X3DsurfaceFormatCore.C $(surfaceFormats)/x3d/X3DsurfaceFormatRunTime.C LIB = $(FOAM_LIBBIN)/libsurfMesh - diff --git a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C b/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C deleted file mode 100644 index e991c89beb..0000000000 --- a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C +++ /dev/null @@ -1,99 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "FTRsurfaceFormat.H" -#include "Keyed.H" -#include "IFstream.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Face> -Foam::fileFormats::FTRsurfaceFormat<Face>::FTRsurfaceFormat -( - const fileName& filename -) -{ - read(filename); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Face> -bool Foam::fileFormats::FTRsurfaceFormat<Face>::read -( - const fileName& filename -) -{ - this->clear(); - - IFstream is(filename); - if (!is.good()) - { - FatalErrorInFunction - << "Cannot read file " << filename - << exit(FatalError); - } - - List<ftrPatch> ftrPatches(is); - - // points read directly - is >> this->storedPoints(); - - // triFaces read with attached keys - List<Keyed<triFace>> facesRead(is); - - List<Face> faceLst(facesRead.size()); - List<label> zoneIds(facesRead.size()); - - // disentangle faces/keys - already triangulated - forAll(facesRead, facei) - { - // unfortunately cannot transfer to save memory - faceLst[facei] = facesRead[facei]; - zoneIds[facei] = facesRead[facei].key(); - } - - this->storedFaces().transfer(faceLst); - this->storedZoneIds().transfer(zoneIds); - facesRead.clear(); - - // change ftrPatch into surfZoneIdentifier - List<surfZoneIdentifier> newZones(ftrPatches.size()); - forAll(newZones, zoneI) - { - newZones[zoneI] = surfZoneIdentifier - ( - ftrPatches[zoneI].name(), - zoneI - ); - } - - this->storedZoneToc().transfer(newZones); - return true; -} - - -// ************************************************************************* // diff --git a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.H b/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.H deleted file mode 100644 index 790fd8c51f..0000000000 --- a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.H +++ /dev/null @@ -1,144 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -Class - Foam::fileFormats::FTRsurfaceFormat - -Description - Reading of the (now deprecated and infrequently used) - Foam Trisurface Format. - -Deprecated - Other formats are better. (deprecated Mar 2009) - -SourceFiles - FTRsurfaceFormat.C - -\*---------------------------------------------------------------------------*/ - -#ifndef FTRsurfaceFormat_H -#define FTRsurfaceFormat_H - -#include "IFstream.H" -#include "MeshedSurface.H" -#include "UnsortedMeshedSurface.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fileFormats -{ - -/*---------------------------------------------------------------------------*\ - Class FTRsurfaceFormat Declaration -\*---------------------------------------------------------------------------*/ - -template<class Face> -class FTRsurfaceFormat -: - public UnsortedMeshedSurface<Face> -{ - // Private classes - - //- Read compatibility for ftr patch definitions - class ftrPatch - { - //- Name of patch - word name_; - - //- Type of patch (ignored since it is usually "empty") - word type_; - - public: - - const word& name() const - { - return name_; - } - - friend Istream& operator>>(Istream& is, ftrPatch& p) - { - is >> p.name_ >> p.type_; - return is; - } - }; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - FTRsurfaceFormat(const FTRsurfaceFormat<Face>&); - - //- Disallow default bitwise assignment - void operator=(const FTRsurfaceFormat<Face>&); - - -public: - - // Constructors - - //- Construct from file name - FTRsurfaceFormat(const fileName&); - - - // Selectors - - //- Read file and return surface - static autoPtr<UnsortedMeshedSurface<Face>> New(const fileName& name) - { - return autoPtr<UnsortedMeshedSurface<Face>> - ( - new FTRsurfaceFormat<Face>(name) - ); - } - - - //- Destructor - virtual ~FTRsurfaceFormat() - {} - - - // Member Functions - - //- Read from file - virtual bool read(const fileName&); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace fileFormats -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "FTRsurfaceFormat.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormatRunTime.C b/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormatRunTime.C deleted file mode 100644 index 179c88018e..0000000000 --- a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormatRunTime.C +++ /dev/null @@ -1,59 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "FTRsurfaceFormat.H" - -#include "addToRunTimeSelectionTable.H" -#include "addToMemberFunctionSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fileFormats -{ - -// read UnsortedMeshedSurface -addNamedTemplatedToRunTimeSelectionTable -( - UnsortedMeshedSurface, - FTRsurfaceFormat, - face, - fileExtension, - ftr -); -addNamedTemplatedToRunTimeSelectionTable -( - UnsortedMeshedSurface, - FTRsurfaceFormat, - triFace, - fileExtension, - ftr -); - -} -} - -// ************************************************************************* // -- GitLab