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
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifndef TimeActivatedExplicitSource_H
00061 #define TimeActivatedExplicitSource_H
00062
00063 #include <OpenFOAM/Tuple2.H>
00064 #include <meshTools/cellSet.H>
00065 #include <finiteVolume/volFieldsFwd.H>
00066 #include <OpenFOAM/DimensionedField.H>
00067
00068
00069
00070 namespace Foam
00071 {
00072
00073
00074
00075 class fvMesh;
00076
00077 template<class Type>
00078 class TimeActivatedExplicitSource;
00079
00080
00081
00082 template<class Type>
00083 Ostream& operator<<
00084 (
00085 Ostream&,
00086 const TimeActivatedExplicitSource<Type>&
00087 );
00088
00089
00090
00091
00092
00093 template<class Type>
00094 class TimeActivatedExplicitSource
00095 {
00096 public:
00097
00098
00099
00100
00101 enum selectionModeType
00102 {
00103 smPoints,
00104 smCellSet,
00105 smCellZone,
00106 smAll
00107 };
00108
00109
00110 static const wordList selectionModeTypeNames_;
00111
00112
00113 enum volumeModeType
00114 {
00115 vmAbsolute,
00116 vmSpecific
00117 };
00118
00119
00120 static const wordList volumeModeTypeNames_;
00121
00122
00123 protected:
00124
00125
00126
00127 typedef Tuple2<word, Type> fieldNameValuePair;
00128
00129
00130 word name_;
00131
00132
00133 const fvMesh& mesh_;
00134
00135
00136 bool active_;
00137
00138
00139 scalar timeStart_;
00140
00141
00142 scalar duration_;
00143
00144
00145 volumeModeType volumeMode_;
00146
00147
00148 selectionModeType selectionMode_;
00149
00150
00151 List<point> points_;
00152
00153
00154 word cellSetName_;
00155
00156
00157 labelList cells_;
00158
00159
00160 scalar V_;
00161
00162
00163 List<fieldNameValuePair> fieldData_;
00164
00165
00166 labelList fieldIds_;
00167
00168
00169
00170
00171
00172 selectionModeType wordToSelectionModeType(const word& smtName) const;
00173
00174
00175 volumeModeType wordToVolumeModeType(const word& vtName) const;
00176
00177
00178 word selectionModeTypeToWord(const selectionModeType& smtType) const;
00179
00180
00181 word volumeModeTypeToWord(const volumeModeType& vtType) const;
00182
00183
00184 void setSelection(const dictionary& dict);
00185
00186
00187 void setFieldData(const dictionary& dict, const wordList& fieldNames);
00188
00189
00190 void setCellSet();
00191
00192
00193 public:
00194
00195
00196
00197
00198 TimeActivatedExplicitSource
00199 (
00200 const word& name,
00201 const dictionary& dict,
00202 const fvMesh& mesh,
00203 const wordList& fieldNames
00204 );
00205
00206
00207 autoPtr<TimeActivatedExplicitSource> clone() const
00208 {
00209 notImplemented
00210 (
00211 "autoPtr<TimeActivatedExplicitSource> clone() const"
00212 );
00213 return autoPtr<TimeActivatedExplicitSource>(NULL);
00214 }
00215
00216
00217
00218 class iNew
00219 {
00220
00221 const fvMesh& mesh_;
00222
00223
00224 const wordList& fieldNames_;
00225
00226
00227 public:
00228
00229 iNew
00230 (
00231 const fvMesh& mesh,
00232 const wordList& fieldNames
00233 )
00234 :
00235 mesh_(mesh),
00236 fieldNames_(fieldNames)
00237 {}
00238
00239 autoPtr<TimeActivatedExplicitSource> operator()(Istream& is) const
00240 {
00241 const word name(is);
00242 const dictionary dict(is);
00243
00244 return autoPtr<TimeActivatedExplicitSource>
00245 (
00246 new TimeActivatedExplicitSource
00247 (
00248 name,
00249 dict,
00250 mesh_,
00251 fieldNames_
00252 )
00253 );
00254 }
00255 };
00256
00257
00258
00259
00260
00261
00262
00263 inline const word& name() const;
00264
00265
00266 inline const fvMesh& mesh() const;
00267
00268
00269 inline bool active() const;
00270
00271
00272 inline scalar timeStart() const;
00273
00274
00275 inline scalar duration() const;
00276
00277
00278 inline scalar timeEnd() const;
00279
00280
00281 inline const volumeModeType& volumeMode() const;
00282
00283
00284 inline const selectionModeType& selectionMode() const;
00285
00286
00287
00288 inline const List<point>& points() const;
00289
00290
00291
00292 inline const word& cellSetName() const;
00293
00294
00295 inline scalar V() const;
00296
00297
00298 inline const labelList& cells() const;
00299
00300
00301 inline const List<fieldNameValuePair>& fieldData() const;
00302
00303
00304
00305 inline const labelList& fieldIds() const;
00306
00307
00308
00309
00310
00311 inline word& name();
00312
00313
00314 inline bool& active();
00315
00316
00317 inline scalar& timeStart();
00318
00319
00320 inline scalar& duration();
00321
00322
00323 inline volumeModeType& volumeMode();
00324
00325
00326 inline selectionModeType& selectionMode();
00327
00328
00329 inline List<point>& points();
00330
00331
00332
00333 inline word& cellSetName();
00334
00335
00336 inline scalar& V();
00337
00338
00339 inline labelList& cells();
00340
00341
00342 inline List<fieldNameValuePair>& fieldData();
00343
00344
00345
00346 inline labelList& fieldIds();
00347
00348
00349
00350
00351
00352 void addToField
00353 (
00354 DimensionedField<Type, volMesh>& Su,
00355 const label fieldI
00356 );
00357
00358
00359
00360
00361
00362 void writeData(Ostream&) const;
00363
00364
00365 friend Ostream& operator<< <Type>
00366 (
00367 Ostream& os,
00368 const TimeActivatedExplicitSource& source
00369 );
00370 };
00371
00372
00373
00374
00375 }
00376
00377
00378
00379 #ifdef NoRepository
00380 # include "TimeActivatedExplicitSource_.C"
00381 # include "TimeActivatedExplicitSourceIO.C"
00382 #endif
00383
00384
00385
00386 #include "TimeActivatedExplicitSourceI.H"
00387
00388
00389
00390 #endif
00391
00392