coordinateSystems.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "coordinateSystems.H"
00028 #include "IOPtrList.H"
00029 #include "Time.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035 defineTypeNameAndDebug(coordinateSystems, 0);
00036 defineTemplateTypeNameAndDebug(IOPtrList<coordinateSystem>, 0);
00037 }
00038
00039
00040
00041 Foam::coordinateSystems::coordinateSystems(const IOobject& io)
00042 :
00043 IOPtrList<coordinateSystem>(io)
00044 {}
00045
00046
00047 Foam::coordinateSystems::coordinateSystems
00048 (
00049 const IOobject& io,
00050 const PtrList<coordinateSystem>& lst
00051 )
00052 :
00053 IOPtrList<coordinateSystem>(io, lst)
00054 {}
00055
00056
00057 Foam::coordinateSystems::coordinateSystems
00058 (
00059 const IOobject& io,
00060 const Xfer<PtrList<coordinateSystem> >& lst
00061 )
00062 :
00063 IOPtrList<coordinateSystem>(io, lst)
00064 {}
00065
00066
00067
00068
00069
00070 const Foam::coordinateSystems& Foam::coordinateSystems::New
00071 (
00072 const objectRegistry& obr
00073 )
00074 {
00075 if (obr.foundObject<coordinateSystems>(typeName))
00076 {
00077 return obr.lookupObject<coordinateSystems>(typeName);
00078 }
00079 else
00080 {
00081 return obr.store
00082 (
00083 new coordinateSystems
00084 (
00085 IOobject
00086 (
00087 typeName,
00088 "constant",
00089 obr,
00090 IOobject::READ_IF_PRESENT,
00091 IOobject::NO_WRITE
00092 )
00093 )
00094 );
00095 }
00096 }
00097
00098
00099
00100
00101 Foam::label Foam::coordinateSystems::find(const word& keyword) const
00102 {
00103 forAll(*this, i)
00104 {
00105 if (keyword == operator[](i).name())
00106 {
00107 return i;
00108 }
00109 }
00110
00111 return -1;
00112 }
00113
00114
00115 bool Foam::coordinateSystems::found(const word& keyword) const
00116 {
00117 return find(keyword) >= 0;
00118 }
00119
00120
00121 Foam::wordList Foam::coordinateSystems::toc() const
00122 {
00123 wordList keywords(size());
00124
00125 forAll(*this, i)
00126 {
00127 keywords[i] = operator[](i).name();
00128 }
00129
00130 return keywords;
00131 }
00132
00133
00134 bool Foam::coordinateSystems::writeData(Ostream& os, bool subDict) const
00135 {
00136 os << nl << size() << nl << token::BEGIN_LIST;
00137
00138 forAll(*this, i)
00139 {
00140 os << nl;
00141 operator[](i).writeDict(os, subDict);
00142 }
00143
00144 os << token::END_LIST << nl;
00145
00146 return os.good();
00147 }
00148
00149
00150
Copyright © 2000-2009 OpenCFD Ltd