1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "topoSetSource.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 defineTypeNameAndDebug(topoSetSource, 0);
37 defineRunTimeSelectionTable(topoSetSource, word);
38 defineRunTimeSelectionTable(topoSetSource, istream);
40 // Construct named object from dictionary
41 autoPtr<topoSetSource> topoSetSource::New
43 const word& topoSetSourceType,
45 const dictionary& dict
48 wordConstructorTable::iterator cstrIter =
49 wordConstructorTablePtr_
50 ->find(topoSetSourceType);
52 if (cstrIter == wordConstructorTablePtr_->end())
56 "topoSetSource::New(const word&, "
57 "const polyMesh&, const dictionary&)"
58 ) << "Unknown topoSetSource type " << topoSetSourceType
60 << "Valid topoSetSource types : " << endl
61 << wordConstructorTablePtr_->toc()
65 return autoPtr<topoSetSource>(cstrIter()(mesh, dict));
69 // Construct named object from Istream
70 autoPtr<topoSetSource> topoSetSource::New
72 const word& topoSetSourceType,
77 istreamConstructorTable::iterator cstrIter =
78 istreamConstructorTablePtr_
79 ->find(topoSetSourceType);
81 if (cstrIter == istreamConstructorTablePtr_->end())
85 "topoSetSource::New(const word&, "
86 "const polyMesh&, Istream&)"
87 ) << "Unknown topoSetSource type " << topoSetSourceType
89 << "Valid topoSetSource types : " << endl
90 << istreamConstructorTablePtr_->toc()
94 return autoPtr<topoSetSource>(cstrIter()(mesh, is));
98 } // End namespace Foam
101 Foam::HashTable<Foam::string>* Foam::topoSetSource::usageTablePtr_ = NULL;
104 const char* Foam::NamedEnum<Foam::topoSetSource::setAction, 8>::names[] =
117 const Foam::NamedEnum<Foam::topoSetSource::setAction, 8>
118 Foam::topoSetSource::actionNames_;
121 const Foam::string Foam::topoSetSource::illegalSource_
123 "Illegal topoSetSource name"
127 Foam::Istream& Foam::topoSetSource::checkIs(Istream& is)
129 if (is.good() && !is.eof())
135 FatalErrorIn("cellToFace::cellToFace") << "Istream not good"
143 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
145 void Foam::topoSetSource::addOrDelete
163 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
165 // Construct from components
166 Foam::topoSetSource::topoSetSource(const polyMesh& mesh)
172 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
174 Foam::topoSetSource::~topoSetSource()
178 // ************************************************************************* //