sampledSurfaces.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 sampledSurfaces_H
00039 #define sampledSurfaces_H
00040
00041 #include "sampledSurface.H"
00042 #include "surfaceWriter.H"
00043 #include "volFieldsFwd.H"
00044
00045
00046
00047 namespace Foam
00048 {
00049
00050 class fvMesh;
00051 class dictionary;
00052
00053
00054
00055
00056
00057 class sampledSurfaces
00058 :
00059 public PtrList<sampledSurface>
00060 {
00061
00062
00063
00064 template<class Type>
00065 class fieldGroup
00066 :
00067 public DynamicList<word>
00068 {
00069 public:
00070
00071
00072 autoPtr< surfaceWriter<Type> > formatter;
00073
00074
00075 fieldGroup()
00076 :
00077 DynamicList<word>(0),
00078 formatter(NULL)
00079 {}
00080
00081
00082 fieldGroup(const word& writeFormat)
00083 :
00084 DynamicList<word>(0),
00085 formatter(surfaceWriter<Type>::New(writeFormat))
00086 {}
00087
00088
00089
00090 fieldGroup
00091 (
00092 const word& writeFormat,
00093 const wordList& fieldNames
00094 )
00095 :
00096 DynamicList<word>(fieldNames),
00097 formatter(surfaceWriter<Type>::New(writeFormat))
00098 {}
00099
00100 void reset(const label nElem)
00101 {
00102 formatter.clear();
00103 DynamicList<word>::setCapacity(nElem);
00104 DynamicList<word>::clear();
00105 }
00106
00107 void operator=(const word& writeFormat)
00108 {
00109 formatter = surfaceWriter<Type>::New(writeFormat);
00110 }
00111
00112 void operator=(const wordList& fieldNames)
00113 {
00114 DynamicList<word>::operator=(fieldNames);
00115 }
00116 };
00117
00118
00119
00120 class mergeInfo
00121 {
00122 public:
00123 pointField points;
00124 faceList faces;
00125 labelList pointsMap;
00126
00127
00128 void clear()
00129 {
00130 points.clear();
00131 faces.clear();
00132 pointsMap.clear();
00133 }
00134 };
00135
00136
00137
00138
00139
00140 static bool verbose_;
00141
00142
00143 static scalar mergeTol_;
00144
00145
00146
00147
00148
00149 const word name_;
00150
00151
00152 const fvMesh& mesh_;
00153
00154
00155 const bool loadFromFiles_;
00156
00157
00158 fileName outputPath_;
00159
00160
00161
00162
00163
00164 wordList fieldNames_;
00165
00166
00167 word interpolationScheme_;
00168
00169
00170 word writeFormat_;
00171
00172
00173
00174
00175
00176 List<mergeInfo> mergeList_;
00177
00178
00179
00180
00181
00182 autoPtr< surfaceWriter<bool> > genericFormatter_;
00183
00184
00185 fieldGroup<scalar> scalarFields_;
00186 fieldGroup<vector> vectorFields_;
00187 fieldGroup<sphericalTensor> sphericalTensorFields_;
00188 fieldGroup<symmTensor> symmTensorFields_;
00189 fieldGroup<tensor> tensorFields_;
00190
00191
00192
00193
00194
00195 label classifyFieldTypes();
00196
00197
00198 void writeGeometry() const;
00199
00200
00201 template<class Type>
00202 void sampleAndWrite
00203 (
00204 const GeometricField<Type, fvPatchField, volMesh>&,
00205 const surfaceWriter<Type>& formatter
00206 );
00207
00208
00209 template <class Type>
00210 void sampleAndWrite(fieldGroup<Type>&);
00211
00212
00213 sampledSurfaces(const sampledSurfaces&);
00214 void operator=(const sampledSurfaces&);
00215
00216
00217 public:
00218
00219
00220 TypeName("surfaces");
00221
00222
00223
00224
00225
00226
00227 sampledSurfaces
00228 (
00229 const word& name,
00230 const objectRegistry&,
00231 const dictionary&,
00232 const bool loadFromFiles = false
00233 );
00234
00235
00236
00237
00238 virtual ~sampledSurfaces();
00239
00240
00241
00242
00243
00244 virtual bool needsUpdate() const;
00245
00246
00247
00248
00249 virtual bool expire();
00250
00251
00252
00253 virtual bool update();
00254
00255
00256
00257 virtual const word& name() const
00258 {
00259 return name_;
00260 }
00261
00262
00263 void verbose(const bool verbosity = true);
00264
00265
00266 virtual void execute();
00267
00268
00269 virtual void end();
00270
00271
00272 virtual void write();
00273
00274
00275 virtual void read(const dictionary&);
00276
00277
00278 virtual void updateMesh(const mapPolyMesh&);
00279
00280
00281 virtual void movePoints(const pointField&);
00282
00283
00284 virtual void readUpdate(const polyMesh::readUpdateState state);
00285
00286 };
00287
00288
00289
00290
00291 }
00292
00293
00294
00295 #ifdef NoRepository
00296 # include "sampledSurfacesTemplates.C"
00297 #endif
00298
00299
00300
00301 #endif
00302
00303
Copyright © 2000-2009 OpenCFD Ltd