1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "topoSetSource.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 defineTypeNameAndDebug(topoSetSource, 0);
35 defineRunTimeSelectionTable(topoSetSource, word);
36 defineRunTimeSelectionTable(topoSetSource, istream);
39 const char* Foam::NamedEnum
41 Foam::topoSetSource::setAction,
57 Foam::HashTable<Foam::string>* Foam::topoSetSource::usageTablePtr_ = NULL;
60 const Foam::NamedEnum<Foam::topoSetSource::setAction, 8>
61 Foam::topoSetSource::actionNames_;
64 const Foam::string Foam::topoSetSource::illegalSource_
66 "Illegal topoSetSource name"
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New
75 const word& topoSetSourceType,
77 const dictionary& dict
80 wordConstructorTable::iterator cstrIter =
81 wordConstructorTablePtr_->find(topoSetSourceType);
83 if (cstrIter == wordConstructorTablePtr_->end())
87 "topoSetSource::New(const word&, "
88 "const polyMesh&, const dictionary&)"
89 ) << "Unknown topoSetSource type " << topoSetSourceType
91 << "Valid topoSetSource types : " << endl
92 << wordConstructorTablePtr_->sortedToc()
96 return autoPtr<topoSetSource>(cstrIter()(mesh, dict));
100 Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New
102 const word& topoSetSourceType,
103 const polyMesh& mesh,
107 istreamConstructorTable::iterator cstrIter =
108 istreamConstructorTablePtr_->find(topoSetSourceType);
110 if (cstrIter == istreamConstructorTablePtr_->end())
114 "topoSetSource::New(const word&, "
115 "const polyMesh&, Istream&)"
116 ) << "Unknown topoSetSource type " << topoSetSourceType
118 << "Valid topoSetSource types : " << endl
119 << istreamConstructorTablePtr_->sortedToc()
123 return autoPtr<topoSetSource>(cstrIter()(mesh, is));
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 Foam::topoSetSource::topoSetSource(const polyMesh& mesh)
171 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
173 Foam::topoSetSource::~topoSetSource()
177 // ************************************************************************* //