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 #ifndef GeometricField_H
00041 #define GeometricField_H
00042
00043 #include "regIOobject.H"
00044 #include "dimensionedTypes.H"
00045 #include "DimensionedField.H"
00046 #include "FieldField.H"
00047 #include "lduInterfaceFieldPtrsList.H"
00048
00049
00050
00051 namespace Foam
00052 {
00053
00054 class dictionary;
00055
00056
00057
00058 template<class Type, template<class> class PatchField, class GeoMesh>
00059 class GeometricField;
00060
00061 template<class Type, template<class> class PatchField, class GeoMesh>
00062 Ostream& operator<<
00063 (
00064 Ostream&,
00065 const GeometricField<Type, PatchField, GeoMesh>&
00066 );
00067
00068 template<class Type, template<class> class PatchField, class GeoMesh>
00069 Ostream& operator<<
00070 (
00071 Ostream&,
00072 const tmp<GeometricField<Type, PatchField, GeoMesh> >&
00073 );
00074
00075
00076
00077
00078
00079
00080 template<class Type, template<class> class PatchField, class GeoMesh>
00081 class GeometricField
00082 :
00083 public DimensionedField<Type, GeoMesh>
00084 {
00085
00086
00087
00088 bool readIfPresent();
00089
00090
00091 bool readOldTimeIfPresent();
00092
00093
00094 public:
00095
00096
00097
00098 typedef typename GeoMesh::Mesh Mesh;
00099 typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
00100
00101 typedef DimensionedField<Type, GeoMesh> DimensionedInternalField;
00102 typedef Field<Type> InternalField;
00103 typedef PatchField<Type> PatchFieldType;
00104
00105
00106 class GeometricBoundaryField
00107 :
00108 public FieldField<PatchField, Type>
00109 {
00110
00111
00112
00113 const BoundaryMesh& bmesh_;
00114
00115
00116 public:
00117
00118
00119
00120
00121
00122
00123 GeometricBoundaryField
00124 (
00125 const BoundaryMesh&,
00126 const DimensionedInternalField&,
00127 const word&
00128 );
00129
00130
00131
00132
00133 GeometricBoundaryField
00134 (
00135 const BoundaryMesh&,
00136 const DimensionedInternalField&,
00137 const wordList&
00138 );
00139
00140
00141
00142
00143 GeometricBoundaryField
00144 (
00145 const BoundaryMesh&,
00146 const DimensionedInternalField&,
00147 const PtrList<PatchField<Type> >&
00148 );
00149
00150
00151 GeometricBoundaryField
00152 (
00153 const DimensionedInternalField&,
00154 const GeometricBoundaryField&
00155 );
00156
00157
00158
00159
00160
00161
00162 GeometricBoundaryField
00163 (
00164 const GeometricBoundaryField&
00165 );
00166
00167
00168 GeometricBoundaryField
00169 (
00170 const BoundaryMesh&,
00171 const DimensionedInternalField&,
00172 const dictionary&
00173 );
00174
00175
00176
00177
00178
00179 void updateCoeffs();
00180
00181
00182 void evaluate();
00183
00184
00185 wordList types() const;
00186
00187
00188
00189 GeometricBoundaryField boundaryInternalField() const;
00190
00191
00192
00193 lduInterfaceFieldPtrsList interfaces() const;
00194
00195
00196 void writeEntry(const word& keyword, Ostream& os) const;
00197
00198
00199
00200
00201
00202 void operator=(const GeometricBoundaryField&);
00203
00204
00205 void operator=(const FieldField<PatchField, Type>&);
00206
00207
00208 void operator=(const Type&);
00209
00210
00211
00212
00213 void operator==(const GeometricBoundaryField&);
00214
00215
00216 void operator==(const FieldField<PatchField, Type>&);
00217
00218
00219 void operator==(const Type&);
00220 };
00221
00222
00223 private:
00224
00225
00226
00227
00228
00229 mutable label timeIndex_;
00230
00231
00232 mutable GeometricField<Type, PatchField, GeoMesh>* field0Ptr_;
00233
00234
00235 mutable GeometricField<Type, PatchField, GeoMesh>* fieldPrevIterPtr_;
00236
00237
00238 GeometricBoundaryField boundaryField_;
00239
00240
00241
00242
00243
00244 tmp<GeometricBoundaryField> readField(Istream& is);
00245
00246
00247 public:
00248
00249
00250 TypeName("GeometricField");
00251
00252
00253
00254
00255 typedef typename Field<Type>::cmptType cmptType;
00256
00257
00258
00259
00260
00261
00262
00263 GeometricField
00264 (
00265 const IOobject&,
00266 const Mesh&,
00267 const dimensionSet&,
00268 const word& patchFieldType=PatchField<Type>::calculatedType()
00269 );
00270
00271
00272
00273
00274 GeometricField
00275 (
00276 const IOobject&,
00277 const Mesh&,
00278 const dimensionSet&,
00279 const wordList& patchFieldTypes
00280 );
00281
00282
00283 GeometricField
00284 (
00285 const IOobject&,
00286 const Mesh&,
00287 const dimensioned<Type>&,
00288 const word& patchFieldType=PatchField<Type>::calculatedType()
00289 );
00290
00291
00292 GeometricField
00293 (
00294 const IOobject&,
00295 const Mesh&,
00296 const dimensioned<Type>&,
00297 const wordList& patchFieldTypes
00298 );
00299
00300
00301 GeometricField
00302 (
00303 const IOobject&,
00304 const Mesh&,
00305 const dimensionSet&,
00306 const Field<Type>&,
00307 const PtrList<PatchField<Type> >&
00308 );
00309
00310
00311 GeometricField
00312 (
00313 const IOobject&,
00314 const Mesh&
00315 );
00316
00317
00318 GeometricField
00319 (
00320 const IOobject&,
00321 const Mesh&,
00322 Istream&
00323 );
00324
00325
00326 GeometricField
00327 (
00328 const GeometricField<Type, PatchField, GeoMesh>&
00329 );
00330
00331
00332 # ifdef ConstructFromTmp
00333 GeometricField
00334 (
00335 const tmp<GeometricField<Type, PatchField, GeoMesh> >&
00336 );
00337 # endif
00338
00339
00340 GeometricField
00341 (
00342 const IOobject&,
00343 const GeometricField<Type, PatchField, GeoMesh>&
00344 );
00345
00346
00347 GeometricField
00348 (
00349 const word& newName,
00350 const GeometricField<Type, PatchField, GeoMesh>&
00351 );
00352
00353
00354 # ifdef ConstructFromTmp
00355 GeometricField
00356 (
00357 const word& newName,
00358 const tmp<GeometricField<Type, PatchField, GeoMesh> >&
00359 );
00360 # endif
00361
00362
00363 GeometricField
00364 (
00365 const IOobject&,
00366 const GeometricField<Type, PatchField, GeoMesh>&,
00367 const word& patchFieldType
00368 );
00369
00370
00371 GeometricField
00372 (
00373 const IOobject&,
00374 const GeometricField<Type, PatchField, GeoMesh>&,
00375 const wordList& patchFieldTypes
00376 );
00377
00378
00379
00380
00381 virtual ~GeometricField();
00382
00383
00384
00385
00386
00387 DimensionedInternalField& dimensionedInternalField();
00388
00389
00390 inline const DimensionedInternalField& dimensionedInternalField() const;
00391
00392
00393 InternalField& internalField();
00394
00395
00396 inline const InternalField& internalField() const;
00397
00398
00399 GeometricBoundaryField& boundaryField();
00400
00401
00402 inline const GeometricBoundaryField& boundaryField() const;
00403
00404
00405 inline label timeIndex() const;
00406
00407
00408 inline label& timeIndex();
00409
00410
00411 void storeOldTimes() const;
00412
00413
00414 void storeOldTime() const;
00415
00416
00417 label nOldTimes() const;
00418
00419
00420 const GeometricField<Type, PatchField, GeoMesh>& oldTime() const;
00421
00422
00423
00424 GeometricField<Type, PatchField, GeoMesh>& oldTime();
00425
00426
00427 void storePrevIter() const;
00428
00429
00430 const GeometricField<Type, PatchField, GeoMesh>& prevIter() const;
00431
00432
00433 void correctBoundaryConditions();
00434
00435
00436 bool needReference() const;
00437
00438
00439 static GeometricField<Type, PatchField, GeoMesh>& null();
00440
00441
00442 tmp<GeometricField<cmptType, PatchField, GeoMesh> > component
00443 (
00444 const direction
00445 ) const;
00446
00447
00448 bool writeData(Ostream&) const;
00449
00450
00451 tmp<GeometricField<Type, PatchField, GeoMesh> > T() const;
00452
00453
00454
00455
00456
00457 void relax(const scalar alpha);
00458
00459
00460
00461 void relax();
00462
00463
00464
00465
00466 void negate();
00467
00468 void replace
00469 (
00470 const direction,
00471 const GeometricField<cmptType, PatchField, GeoMesh>&
00472 );
00473
00474 void replace
00475 (
00476 const direction,
00477 const dimensioned<cmptType>&
00478 );
00479
00480 void max(const dimensioned<Type>&);
00481 void min(const dimensioned<Type>&);
00482
00483 void max
00484 (
00485 const GeometricField<Type, PatchField, GeoMesh>&,
00486 const dimensioned<Type>&
00487 );
00488
00489 void min
00490 (
00491 const GeometricField<Type, PatchField, GeoMesh>&,
00492 const dimensioned<Type>&
00493 );
00494
00495 void scale
00496 (
00497 const GeometricField<Type, PatchField, GeoMesh>&,
00498 const GeometricField<Type, PatchField, GeoMesh>&
00499 );
00500
00501 void scale
00502 (
00503 const GeometricField<Type, PatchField, GeoMesh>&,
00504 const dimensioned<Type>&
00505 );
00506
00507
00508
00509
00510 void operator=(const GeometricField<Type, PatchField, GeoMesh>&);
00511 void operator=(const tmp<GeometricField<Type, PatchField, GeoMesh> >&);
00512 void operator=(const dimensioned<Type>&);
00513
00514 void operator==(const tmp<GeometricField<Type, PatchField, GeoMesh> >&);
00515 void operator==(const dimensioned<Type>&);
00516
00517 void operator+=(const GeometricField<Type, PatchField, GeoMesh>&);
00518 void operator+=(const tmp<GeometricField<Type, PatchField, GeoMesh> >&);
00519
00520 void operator-=(const GeometricField<Type, PatchField, GeoMesh>&);
00521 void operator-=(const tmp<GeometricField<Type, PatchField, GeoMesh> >&);
00522
00523 void operator*=(const GeometricField<scalar, PatchField, GeoMesh>&);
00524 void operator*=(const tmp<GeometricField<scalar,PatchField,GeoMesh> >&);
00525
00526 void operator/=(const GeometricField<scalar, PatchField, GeoMesh>&);
00527 void operator/=(const tmp<GeometricField<scalar,PatchField,GeoMesh> >&);
00528
00529 void operator+=(const dimensioned<Type>&);
00530 void operator-=(const dimensioned<Type>&);
00531
00532 void operator*=(const dimensioned<scalar>&);
00533 void operator/=(const dimensioned<scalar>&);
00534
00535
00536
00537
00538 friend Ostream& operator<< <Type, PatchField, GeoMesh>
00539 (
00540 Ostream&,
00541 const GeometricField<Type, PatchField, GeoMesh>&
00542 );
00543
00544 friend Ostream& operator<< <Type, PatchField, GeoMesh>
00545 (
00546 Ostream&,
00547 const tmp<GeometricField<Type, PatchField, GeoMesh> >&
00548 );
00549 };
00550
00551
00552 template<class Type, template<class> class PatchField, class GeoMesh>
00553 Ostream& operator<<
00554 (
00555 Ostream&,
00556 const typename GeometricField<Type, PatchField, GeoMesh>::
00557 GeometricBoundaryField&
00558 );
00559
00560
00561
00562
00563 }
00564
00565
00566
00567 #include "GeometricFieldI.H"
00568
00569 #ifdef NoRepository
00570 # include "GeometricField.C"
00571 #endif
00572
00573 #include "GeometricFieldFunctions.H"
00574
00575
00576
00577 #endif
00578
00579
Copyright © 2000-2007 OpenCFD Ltd