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