Skip to content
Snippets Groups Projects
Commit b1675611 authored by Henry Weller's avatar Henry Weller
Browse files

Remove/replace deprecated functions and classes

parent 71fdcab7
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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();
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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
/*---------------------------------------------------------------------------*\
========= |
\\ / 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;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
);
}
}
// ************************************************************************* //
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment