1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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
27 \*---------------------------------------------------------------------------*/
29 #include "topoSetSource.H"
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 defineTypeNameAndDebug(topoSetSource, 0);
39 defineRunTimeSelectionTable(topoSetSource, word);
40 defineRunTimeSelectionTable(topoSetSource, istream);
42 // Construct named object from dictionary
43 autoPtr<topoSetSource> topoSetSource::New
45 const word& topoSetSourceType,
47 const dictionary& dict
50 wordConstructorTable::iterator cstrIter =
51 wordConstructorTablePtr_
52 ->find(topoSetSourceType);
54 if (cstrIter == wordConstructorTablePtr_->end())
58 "topoSetSource::New(const word&, "
59 "const polyMesh&, const dictionary&)"
60 ) << "Unknown topoSetSource type " << topoSetSourceType
62 << "Valid topoSetSource types : " << endl
63 << wordConstructorTablePtr_->toc()
67 return autoPtr<topoSetSource>(cstrIter()(mesh, dict));
71 // Construct named object from Istream
72 autoPtr<topoSetSource> topoSetSource::New
74 const word& topoSetSourceType,
79 istreamConstructorTable::iterator cstrIter =
80 istreamConstructorTablePtr_
81 ->find(topoSetSourceType);
83 if (cstrIter == istreamConstructorTablePtr_->end())
87 "topoSetSource::New(const word&, "
88 "const polyMesh&, Istream&)"
89 ) << "Unknown topoSetSource type " << topoSetSourceType
91 << "Valid topoSetSource types : " << endl
92 << istreamConstructorTablePtr_->toc()
96 return autoPtr<topoSetSource>(cstrIter()(mesh, is));
100 } // End namespace Foam
103 Foam::HashTable<Foam::string>* Foam::topoSetSource::usageTablePtr_ = NULL;
106 const char* Foam::NamedEnum<Foam::topoSetSource::setAction, 7>::names[] =
118 const Foam::NamedEnum<Foam::topoSetSource::setAction, 7>
119 Foam::topoSetSource::actionNames_;
122 const Foam::string Foam::topoSetSource::illegalSource_
124 "Illegal topoSetSource name"
128 Foam::Istream& Foam::topoSetSource::checkIs(Istream& is)
130 if (is.good() && !is.eof())
136 FatalErrorIn("cellToFace::cellToFace") << "Istream not good"
144 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
146 void Foam::topoSetSource::addOrDelete
164 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
166 // Construct from components
167 Foam::topoSetSource::topoSetSource(const polyMesh& mesh)
173 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
175 Foam::topoSetSource::~topoSetSource()
179 // ************************************************************************* //