Commit 30eb40b4 authored by mark's avatar mark
Browse files

DEFEATURE: remove unused surfacePatchIOList class (issue #294)

parent 60e0b4c8
......@@ -794,7 +794,6 @@ DebugSwitches
surfaceIntersection 0;
surfaceNormalFixedValue 0;
surfacePatch 0;
surfacePatchIOList 0;
surfaceScalarField 0;
surfaceScalarField::Internal 0;
surfaceSlipDisplacement 0;
......
......@@ -27,7 +27,6 @@ $(interfaces)/NAS/readNAS.C
triSurface/geometricSurfacePatch/geometricSurfacePatch.C
triSurface/surfacePatch/surfacePatch.C
triSurface/surfacePatch/surfacePatchIOList.C
triSurfaceFields/triSurfaceFields.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "surfacePatchIOList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(surfacePatchIOList, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from IOObject
Foam::surfacePatchIOList::surfacePatchIOList
(
const IOobject& io
)
:
surfacePatchList(),
regIOobject(io)
{
Foam::string functionName =
"surfacePatchIOList::surfacePatchIOList"
"(const IOobject& io)";
if
(
readOpt() == IOobject::MUST_READ
|| readOpt() == IOobject::MUST_READ_IF_MODIFIED
)
{
// Warn for MUST_READ_IF_MODIFIED
warnNoRereading<surfacePatchIOList>();
surfacePatchList& patches = *this;
// read polyPatchList
Istream& is = readStream(typeName);
PtrList<entry> patchEntries(is);
patches.setSize(patchEntries.size());
label facei = 0;
forAll(patches, patchi)
{
const dictionary& dict = patchEntries[patchi].dict();
label patchSize = readLabel(dict.lookup("nFaces"));
label startFacei = readLabel(dict.lookup("startFace"));
patches[patchi] =
surfacePatch
(
word(dict.lookup("geometricType")),
patchEntries[patchi].keyword(),
patchSize,
startFacei,
patchi
);
if (startFacei != facei)
{
FatalErrorInFunction
<< "Patches are not ordered. Start of patch " << patchi
<< " does not correspond to sum of preceding patches."
<< endl
<< "while reading " << io.objectPath()
<< exit(FatalError);
}
facei += patchSize;
}
// Check state of IOstream
is.check(functionName.c_str());
close();
}
}
// Construct from IOObject
Foam::surfacePatchIOList::surfacePatchIOList
(
const IOobject& io,
const surfacePatchList& patches
)
:
surfacePatchList(patches),
regIOobject(io)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfacePatchIOList::~surfacePatchIOList()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// writeData member function required by regIOobject
bool Foam::surfacePatchIOList::writeData(Ostream& os) const
{
os << *this;
return os.good();
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const surfacePatchIOList& patches)
{
os << patches.size() << nl << token::BEGIN_LIST;
forAll(patches, patchi)
{
patches[patchi].writeDict(os);
}
os << token::END_LIST;
return os;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::surfacePatchIOList
Description
IOobject for a surfacePatchList
SourceFiles
surfacePatchIOList.C
\*---------------------------------------------------------------------------*/
#ifndef surfacePatchIOList_H
#define surfacePatchIOList_H
#include "surfacePatchList.H"
#include "regIOobject.H"
#include "faceList.H"
#include "className.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
class surfacePatchIOList;
Ostream& operator<<(Ostream&, const surfacePatchIOList&);
/*---------------------------------------------------------------------------*\
Class surfacePatchIOList Declaration
\*---------------------------------------------------------------------------*/
class surfacePatchIOList
:
public surfacePatchList,
public regIOobject
{
// Private data
// Private Member Functions
//- Disallow default bitwise copy construct
surfacePatchIOList(const surfacePatchIOList&);
//- Disallow default bitwise assignment
void operator=(const surfacePatchIOList&);
public:
//- Runtime type information
TypeName("surfacePatchIOList");
// Static data members
//- Static data someStaticData
// Constructors
//- Construct from IOobject
explicit surfacePatchIOList(const IOobject& io);
//- Construct from IOobject
surfacePatchIOList(const IOobject& io, const surfacePatchList&);
//- Destructor
~surfacePatchIOList();
// Member Functions
//- writeData member function required by regIOobject
bool writeData(Ostream&) const;
//- Is object global
virtual bool global() const
{
return true;
}
//- Return complete path + object name if the file exists
// either in the case/processor or case otherwise null
virtual fileName filePath() const
{
return globalFilePath();
}
// IOstream Operators
friend Ostream& operator<<(Ostream&, const surfacePatchIOList&);
};
//- Template function for obtaining global status
template<>
inline bool typeGlobal<surfacePatchIOList>()
{
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment