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 "pointMesh.H"
00041 #include "IDLList.H"
00042 #include "IOField.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049 template<class particleType>
00050 class Cloud;
00051
00052 template<class particleType>
00053 Ostream& operator<<
00054 (
00055 Ostream&,
00056 const Cloud<particleType>&
00057 );
00058
00059
00060
00061
00062
00063
00064 template<class particleType>
00065 class Cloud
00066 :
00067 public cloud,
00068 public IDLList<particleType>
00069 {
00070
00071
00072 const polyMesh& polyMesh_;
00073
00074 const faceList& allFaces_;
00075 const vectorField& points_;
00076 const cellList& cellFaces_;
00077 const vectorField& allFaceCentres_;
00078 const unallocLabelList& owner_;
00079 const unallocLabelList& neighbour_;
00080
00081
00082 public:
00083
00084 template<class particleT>
00085 friend class particle;
00086
00087 typedef typename IDLList<particleType>::iterator iterator;
00088 typedef typename IDLList<particleType>::const_iterator const_iterator;
00089
00090
00091
00092
00093
00094 Cloud
00095 (
00096 const polyMesh& mesh,
00097 const IDLList<particleType>& particles
00098 );
00099
00100
00101 Cloud
00102 (
00103 const polyMesh& mesh
00104 );
00105
00106
00107
00108
00109
00110
00111
00112 const polyMesh& pMesh() const
00113 {
00114 return polyMesh_;
00115 }
00116
00117
00118 bool internalFace(const label facei) const
00119 {
00120 return polyMesh_.isInternalFace(facei);
00121 }
00122
00123
00124 bool boundaryFace(const label facei) const
00125 {
00126 return !internalFace(facei);
00127 }
00128
00129
00130 label facePatch(const label facei) const
00131 {
00132 return polyMesh_.boundaryMesh().whichPatch(facei);
00133 }
00134
00135
00136 label patchFace(const label patchi, const label facei) const
00137 {
00138 return polyMesh_.boundaryMesh()[patchi].whichFace(facei);
00139 }
00140
00141
00142
00143
00144
00145 void addParticle(particleType* pPtr);
00146
00147
00148 void deleteParticle(particleType&);
00149
00150
00151 template<class TrackingData>
00152 void track(TrackingData& td);
00153
00154
00155
00156 virtual void autoMap(const mapPolyMesh&);
00157
00158
00159
00160
00161
00162 IOobject fieldIOobject(const word& fieldName) const;
00163
00164
00165 template<class Type>
00166 tmp<IOField<Type> > readField(const word& fieldName) const;
00167
00168
00169 void readFields();
00170
00171
00172
00173
00174 virtual bool writeData(Ostream&) const;
00175
00176
00177 virtual void writeFields() const;
00178
00179
00180
00181
00182 friend Ostream& operator<< <particleType>
00183 (
00184 Ostream&,
00185 const Cloud<particleType>&
00186 );
00187 };
00188
00189
00190
00191
00192 }
00193
00194
00195
00196 #ifdef NoRepository
00197 # include "Cloud.C"
00198 #endif
00199
00200
00201
00202 #endif
00203
00204