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
25 \*---------------------------------------------------------------------------*/
27 #include "coordinateSystems.H"
28 #include "IOPtrList.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 defineTypeNameAndDebug(coordinateSystems, 0);
36 defineTemplateTypeNameAndDebug(IOPtrList<coordinateSystem>, 0);
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 Foam::coordinateSystems::coordinateSystems(const IOobject& io)
43 IOPtrList<coordinateSystem>(io)
47 Foam::coordinateSystems::coordinateSystems
50 const PtrList<coordinateSystem>& lst
53 IOPtrList<coordinateSystem>(io, lst)
57 Foam::coordinateSystems::coordinateSystems
60 const Xfer<PtrList<coordinateSystem> >& lst
63 IOPtrList<coordinateSystem>(io, lst)
67 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
69 // Read construct from registry, or return previously registered
70 const Foam::coordinateSystems& Foam::coordinateSystems::New
72 const objectRegistry& obr
75 if (obr.foundObject<coordinateSystems>(typeName))
77 return obr.lookupObject<coordinateSystems>(typeName);
90 IOobject::READ_IF_PRESENT,
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 Foam::label Foam::coordinateSystems::find(const word& keyword) const
105 if (keyword == operator[](i).name())
115 bool Foam::coordinateSystems::found(const word& keyword) const
117 return find(keyword) >= 0;
121 Foam::wordList Foam::coordinateSystems::toc() const
123 wordList keywords(size());
127 keywords[i] = operator[](i).name();
134 bool Foam::coordinateSystems::writeData(Ostream& os, bool subDict) const
136 os << nl << size() << nl << token::BEGIN_LIST;
141 operator[](i).writeDict(os, subDict);
144 os << token::END_LIST << nl;
150 // ************************************************************************* //