ensightPart.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
00037
00038 #ifndef ensightPart_H
00039 #define ensightPart_H
00040
00041 #include "ensightFile.H"
00042 #include "ensightGeoFile.H"
00043 #include "typeInfo.H"
00044 #include "labelList.H"
00045 #include "polyMesh.H"
00046 #include "Field.H"
00047 #include "IOPtrList.H"
00048 #include "IOstream.H"
00049
00050
00051
00052 namespace Foam
00053 {
00054
00055
00056
00057
00058
00059 class ensightPart
00060 {
00061
00062
00063
00064 static List<word> elemTypes_;
00065
00066
00067 protected:
00068
00069
00070
00071
00072 label number_;
00073
00074
00075 string name_;
00076
00077
00078 labelListList elemLists_;
00079
00080
00081 label offset_;
00082
00083
00084 label size_;
00085
00086
00087 bool isCellData_;
00088
00089
00090 label matId_;
00091
00092
00093 const polyMesh* meshPtr_;
00094
00095
00096
00097
00098
00099 class localPoints
00100 {
00101 public:
00102
00103 label nPoints;
00104
00105
00106 labelList list;
00107
00108
00109 localPoints()
00110 :
00111 nPoints(0),
00112 list(0)
00113 {}
00114
00115
00116 localPoints(const polyMesh& pMesh)
00117 :
00118 nPoints(0),
00119 list(pMesh.points().size(), -1)
00120 {}
00121 };
00122
00123
00124
00125
00126
00127 void reconstruct(Istream&);
00128
00129
00130 bool isFieldDefined(const List<scalar>&) const;
00131
00132
00133 void writeHeader(ensightFile&, bool withDescription=false) const;
00134
00135
00136 void writeFieldList
00137 (
00138 ensightFile& os,
00139 const List<scalar>& field,
00140 const List<label>& idList
00141 ) const;
00142
00143
00144 virtual localPoints calcLocalPoints() const
00145 {
00146 return localPoints();
00147 }
00148
00149
00150 virtual void writeConnectivity
00151 (
00152 ensightGeoFile& os,
00153 const string& key,
00154 const labelList& idList,
00155 const labelList& pointMap
00156 ) const
00157 {}
00158
00159
00160 public:
00161
00162
00163 TypeName("ensightPart");
00164
00165
00166
00167
00168
00169 ensightPart();
00170
00171
00172 ensightPart(label partNumber, const string& partDescription);
00173
00174
00175 ensightPart
00176 (
00177 label partNumber,
00178 const string& partDescription,
00179 const polyMesh& pMesh
00180 );
00181
00182
00183 ensightPart(const ensightPart&);
00184
00185
00186
00187
00188
00189 declareRunTimeSelectionTable
00190 (
00191 autoPtr,
00192 ensightPart,
00193 istream,
00194 (
00195 Istream& is
00196 ),
00197 (is)
00198 );
00199
00200
00201 autoPtr<ensightPart> clone() const
00202 {
00203 return autoPtr<ensightPart>(new ensightPart(*this));
00204 };
00205
00206
00207 static autoPtr<ensightPart> New(Istream& is);
00208
00209
00210
00211 virtual ~ensightPart();
00212
00213
00214
00215
00216 virtual List<word> const& elementTypes() const
00217 {
00218 return elemTypes_;
00219 }
00220
00221
00222
00223
00224
00225 label size() const
00226 {
00227 return size_;
00228 }
00229
00230
00231 bool isCellData() const
00232 {
00233 return isCellData_;
00234 }
00235
00236
00237 bool isFaceData() const
00238 {
00239 return !isCellData_;
00240 }
00241
00242
00243 label number() const
00244 {
00245 return number_;
00246 }
00247
00248
00249 const string& name() const
00250 {
00251 return name_;
00252 }
00253
00254
00255 label materialId() const
00256 {
00257 return matId_;
00258 }
00259
00260
00261 void name(const string& value)
00262 {
00263 name_ = value;
00264 }
00265
00266 void materialId(const label value)
00267 {
00268 matId_ = value;
00269 }
00270
00271
00272 label offset() const
00273 {
00274 return offset_;
00275 }
00276
00277
00278
00279
00280
00281 void renumber(labelList const&);
00282
00283
00284 bool writeSummary(Ostream&) const;
00285
00286
00287 bool writeData(Ostream&) const;
00288
00289
00290 void writeGeometry(ensightGeoFile&) const;
00291
00292
00293 void writeScalarField
00294 (
00295 ensightFile&,
00296 const List<scalar>& field
00297 ) const;
00298
00299
00300 void writeVectorField
00301 (
00302 ensightFile&,
00303 const List<scalar>& field0,
00304 const List<scalar>& field1,
00305 const List<scalar>& field2
00306 ) const;
00307
00308
00309
00310 template <class Type>
00311 void writeField
00312 (
00313 ensightFile&,
00314 const Field<Type>&
00315 ) const;
00316
00317
00318
00319
00320
00321 void operator=(const ensightPart&)
00322 {
00323 notImplemented("ensightPart::operator=(const ensightPart&)");
00324 }
00325
00326
00327
00328
00329
00330 friend Ostream& operator<<(Ostream&, const ensightPart&);
00331
00332
00333 friend ensightGeoFile& operator<<
00334 (
00335 ensightGeoFile&,
00336 const ensightPart&
00337 );
00338 };
00339
00340
00341
00342
00343 }
00344
00345
00346
00347 #ifdef NoRepository
00348 # include "ensightPartI.H"
00349 #endif
00350
00351
00352
00353 #endif
00354
00355
Copyright © 2000-2009 OpenCFD Ltd