Cloud.H
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
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef Cloud_H
00037 #define Cloud_H
00038
00039 #include "cloud.H"
00040 #include "IDLList.H"
00041 #include "IOField.H"
00042 #include "polyMesh.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049
00050 template<class ParticleType>
00051 class Cloud;
00052
00053 template<class ParticleType>
00054 class IOPosition;
00055
00056 template<class ParticleType>
00057 Ostream& operator<<
00058 (
00059 Ostream&,
00060 const Cloud<ParticleType>&
00061 );
00062
00063
00064
00065
00066
00067
00068 template<class ParticleType>
00069 class Cloud
00070 :
00071 public cloud,
00072 public IDLList<ParticleType>
00073 {
00074
00075
00076 const polyMesh& polyMesh_;
00077
00078
00079 mutable label particleCount_;
00080
00081
00082 mutable DynamicList<label> labels_;
00083
00084
00085
00086
00087
00088 void initCloud(const bool checkClass);
00089
00090
00091 public:
00092
00093 template<class ParticleT>
00094 friend class Particle;
00095 template<class ParticleT>
00096 friend class IOPosition;
00097
00098 typedef ParticleType particleType;
00099
00100 typedef typename IDLList<ParticleType>::iterator iterator;
00101 typedef typename IDLList<ParticleType>::const_iterator const_iterator;
00102
00103
00104 TypeName("Cloud");
00105
00106
00107
00108
00109
00110 Cloud
00111 (
00112 const polyMesh& mesh,
00113 const IDLList<ParticleType>& particles
00114 );
00115
00116
00117 Cloud
00118 (
00119 const polyMesh& mesh,
00120 const word& cloudName,
00121 const IDLList<ParticleType>& particles
00122 );
00123
00124
00125
00126 Cloud
00127 (
00128 const polyMesh& mesh,
00129 const bool checkClass = true
00130 );
00131
00132
00133
00134
00135 Cloud
00136 (
00137 const polyMesh& pMesh,
00138 const word& cloudName,
00139 const bool checkClass = true
00140 );
00141
00142
00143
00144
00145
00146
00147
00148 const polyMesh& pMesh() const
00149 {
00150 return polyMesh_;
00151 }
00152
00153
00154 bool internalFace(const label facei) const
00155 {
00156 return polyMesh_.isInternalFace(facei);
00157 }
00158
00159
00160 bool boundaryFace(const label facei) const
00161 {
00162 return !internalFace(facei);
00163 }
00164
00165
00166 label facePatch(const label facei) const
00167 {
00168 return polyMesh_.boundaryMesh().whichPatch(facei);
00169 }
00170
00171
00172 label patchFace(const label patchi, const label facei) const
00173 {
00174 return polyMesh_.boundaryMesh()[patchi].whichFace(facei);
00175 }
00176
00177 label size() const
00178 {
00179 return IDLList<ParticleType>::size();
00180 };
00181
00182
00183
00184
00185 const const_iterator begin() const
00186 {
00187 return IDLList<ParticleType>::begin();
00188 };
00189
00190 const const_iterator cbegin() const
00191 {
00192 return IDLList<ParticleType>::cbegin();
00193 };
00194
00195 const const_iterator end() const
00196 {
00197 return IDLList<ParticleType>::end();
00198 };
00199
00200 const const_iterator cend() const
00201 {
00202 return IDLList<ParticleType>::cend();
00203 };
00204
00205 iterator begin()
00206 {
00207 return IDLList<ParticleType>::begin();
00208 };
00209
00210 iterator end()
00211 {
00212 return IDLList<ParticleType>::end();
00213 };
00214
00215
00216
00217
00218 void clear()
00219 {
00220 return IDLList<ParticleType>::clear();
00221 };
00222
00223
00224 label getNewParticleID() const;
00225
00226
00227 void addParticle(ParticleType* pPtr);
00228
00229
00230 void deleteParticle(ParticleType&);
00231
00232
00233
00234 template<class TrackingData>
00235 void move(TrackingData& td);
00236
00237
00238
00239 virtual void autoMap(const mapPolyMesh&);
00240
00241
00242
00243
00244
00245 IOobject fieldIOobject
00246 (
00247 const word& fieldName,
00248 const IOobject::readOption r
00249 ) const;
00250
00251
00252 template<class DataType>
00253 void checkFieldIOobject
00254 (
00255 const Cloud<ParticleType>& c,
00256 const IOField<DataType>& data
00257 ) const;
00258
00259
00260
00261 virtual void readFields();
00262
00263
00264
00265
00266
00267
00268 virtual void writeFields() const;
00269
00270
00271
00272 virtual bool writeObject
00273 (
00274 IOstream::streamFormat fmt,
00275 IOstream::versionNumber ver,
00276 IOstream::compressionType cmp
00277 ) const;
00278
00279
00280 void writePositions() const;
00281
00282
00283
00284
00285 friend Ostream& operator<< <ParticleType>
00286 (
00287 Ostream&,
00288 const Cloud<ParticleType>&
00289 );
00290 };
00291
00292
00293
00294
00295 }
00296
00297
00298
00299 #ifdef NoRepository
00300 # include "Cloud.C"
00301 #endif
00302
00303
00304
00305 #endif
00306
00307
Copyright © 2000-2009 OpenCFD Ltd