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 #ifndef fvPatchField_H
00043 #define fvPatchField_H
00044
00045 #include "fvPatch.H"
00046 #include "DimensionedField.H"
00047
00048
00049
00050 namespace Foam
00051 {
00052
00053
00054
00055 class objectRegistry;
00056 class dictionary;
00057 class fvPatchFieldMapper;
00058 class volMesh;
00059
00060
00061
00062
00063 template<class Type>
00064 class fvPatchField;
00065
00066 template<class Type>
00067 Ostream& operator<<(Ostream&, const fvPatchField<Type>&);
00068
00069
00070
00071
00072
00073
00074 template<class Type>
00075 class fvPatchField
00076 :
00077 public Field<Type>
00078 {
00079
00080
00081
00082 const fvPatch& patch_;
00083
00084
00085 const DimensionedField<Type, volMesh>& internalField_;
00086
00087
00088
00089 bool updated_;
00090
00091
00092 public:
00093
00094 typedef fvPatch Patch;
00095
00096
00097
00098 TypeName("fvPatchField");
00099
00100
00101 static int disallowDefaultFvPatchField;
00102
00103
00104
00105
00106 declareRunTimeSelectionTable
00107 (
00108 tmp,
00109 fvPatchField,
00110 patch,
00111 (
00112 const fvPatch& p,
00113 const DimensionedField<Type, volMesh>& iF
00114 ),
00115 (p, iF)
00116 );
00117
00118 declareRunTimeSelectionTable
00119 (
00120 tmp,
00121 fvPatchField,
00122 patchMapper,
00123 (
00124 const fvPatchField<Type>& ptf,
00125 const fvPatch& p,
00126 const DimensionedField<Type, volMesh>& iF,
00127 const fvPatchFieldMapper& m
00128 ),
00129 (dynamic_cast<const fvPatchFieldType&>(ptf), p, iF, m)
00130 );
00131
00132 declareRunTimeSelectionTable
00133 (
00134 tmp,
00135 fvPatchField,
00136 dictionary,
00137 (
00138 const fvPatch& p,
00139 const DimensionedField<Type, volMesh>& iF,
00140 const dictionary& dict
00141 ),
00142 (p, iF, dict)
00143 );
00144
00145
00146
00147
00148
00149 fvPatchField
00150 (
00151 const fvPatch&,
00152 const DimensionedField<Type, volMesh>&
00153 );
00154
00155
00156 fvPatchField
00157 (
00158 const fvPatch&,
00159 const DimensionedField<Type, volMesh>&,
00160 const Field<Type>&
00161 );
00162
00163
00164 fvPatchField
00165 (
00166 const fvPatch&,
00167 const DimensionedField<Type, volMesh>&,
00168 const dictionary&
00169 );
00170
00171
00172 fvPatchField
00173 (
00174 const fvPatchField<Type>&,
00175 const fvPatch&,
00176 const DimensionedField<Type, volMesh>&,
00177 const fvPatchFieldMapper&
00178 );
00179
00180
00181 fvPatchField(const fvPatchField<Type>&);
00182
00183
00184 virtual tmp<fvPatchField<Type> > clone() const
00185 {
00186 return tmp<fvPatchField<Type> >(new fvPatchField<Type>(*this));
00187 }
00188
00189
00190 fvPatchField
00191 (
00192 const fvPatchField<Type>&,
00193 const DimensionedField<Type, volMesh>&
00194 );
00195
00196
00197 virtual tmp<fvPatchField<Type> > clone
00198 (
00199 const DimensionedField<Type, volMesh>& iF
00200 ) const
00201 {
00202 return tmp<fvPatchField<Type> >(new fvPatchField<Type>(*this, iF));
00203 }
00204
00205
00206
00207
00208
00209
00210
00211 static tmp<fvPatchField<Type> > New
00212 (
00213 const word&,
00214 const fvPatch&,
00215 const DimensionedField<Type, volMesh>&
00216 );
00217
00218
00219
00220 static tmp<fvPatchField<Type> > New
00221 (
00222 const fvPatchField<Type>&,
00223 const fvPatch&,
00224 const DimensionedField<Type, volMesh>&,
00225 const fvPatchFieldMapper&
00226 );
00227
00228
00229
00230 static tmp<fvPatchField<Type> > New
00231 (
00232 const fvPatch&,
00233 const DimensionedField<Type, volMesh>&,
00234 const dictionary&
00235 );
00236
00237
00238
00239 template<class Type2>
00240 static tmp<fvPatchField<Type> > NewCalculatedType
00241 (
00242 const fvPatchField<Type2>&
00243 );
00244
00245
00246
00247
00248 virtual ~fvPatchField<Type>()
00249 {}
00250
00251
00252
00253
00254
00255
00256
00257 const objectRegistry& db() const;
00258
00259
00260 const fvPatch& patch() const
00261 {
00262 return patch_;
00263 }
00264
00265
00266 const DimensionedField<Type, volMesh>&
00267 dimensionedInternalField() const
00268 {
00269 return internalField_;
00270 }
00271
00272
00273 const Field<Type>& internalField() const
00274 {
00275 return internalField_;
00276 }
00277
00278
00279 static const word& calculatedType();
00280
00281
00282
00283
00284 virtual bool fixesValue() const
00285 {
00286 return false;
00287 }
00288
00289
00290 virtual bool coupled() const
00291 {
00292 return false;
00293 }
00294
00295
00296 bool updated() const
00297 {
00298 return updated_;
00299 }
00300
00301
00302
00303
00304
00305 virtual void autoMap
00306 (
00307 const fvPatchFieldMapper&
00308 );
00309
00310
00311 virtual void rmap
00312 (
00313 const fvPatchField<Type>&,
00314 const labelList&
00315 );
00316
00317
00318
00319
00320
00321 virtual tmp<Field<Type> > snGrad() const;
00322
00323
00324
00325 virtual void updateCoeffs()
00326 {
00327 updated_ = true;
00328 }
00329
00330
00331 virtual tmp<Field<Type> > patchInternalField() const;
00332
00333
00334 virtual tmp<Field<Type> > patchNeighbourField() const
00335 {
00336 notImplemented(type() + "patchNeighbourField()");
00337 return *this;
00338 }
00339
00340
00341 virtual void initEvaluate(const bool=false)
00342 {}
00343
00344
00345 virtual void evaluate();
00346
00347
00348
00349
00350 virtual tmp<Field<Type> > valueInternalCoeffs
00351 (
00352 const tmp<Field<scalar> >&
00353 ) const
00354 {
00355 notImplemented
00356 (
00357 type()
00358 + "::valueInternalCoeffs(const tmp<Field<scalar> >&)"
00359 );
00360 return *this;
00361 }
00362
00363
00364
00365 virtual tmp<Field<Type> > valueBoundaryCoeffs
00366 (
00367 const tmp<Field<scalar> >&
00368 ) const
00369 {
00370 notImplemented
00371 (
00372 type()
00373 + "::valueBoundaryCoeffs(const tmp<Field<scalar> >&)"
00374 );
00375 return *this;
00376 }
00377
00378
00379
00380 virtual tmp<Field<Type> > gradientInternalCoeffs() const
00381 {
00382 notImplemented(type() + "::gradientInternalCoeffs()");
00383 return *this;
00384 }
00385
00386
00387
00388 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const
00389 {
00390 notImplemented(type() + "::gradientBoundaryCoeffs()");
00391 return *this;
00392 }
00393
00394
00395
00396 virtual void write(Ostream&) const;
00397
00398
00399
00400
00401
00402 void check(const fvPatchField<Type>&) const;
00403
00404
00405
00406
00407 virtual void operator=(const UList<Type>&);
00408
00409 virtual void operator=(const fvPatchField<Type>&);
00410 virtual void operator+=(const fvPatchField<Type>&);
00411 virtual void operator-=(const fvPatchField<Type>&);
00412 virtual void operator*=(const fvPatchField<scalar>&);
00413 virtual void operator/=(const fvPatchField<scalar>&);
00414
00415 virtual void operator+=(const Field<Type>&);
00416 virtual void operator-=(const Field<Type>&);
00417
00418 virtual void operator*=(const Field<scalar>&);
00419 virtual void operator/=(const Field<scalar>&);
00420
00421 virtual void operator=(const Type&);
00422 virtual void operator+=(const Type&);
00423 virtual void operator-=(const Type&);
00424 virtual void operator*=(const scalar);
00425 virtual void operator/=(const scalar);
00426
00427
00428
00429
00430 virtual void operator==(const fvPatchField<Type>&);
00431 virtual void operator==(const Field<Type>&);
00432 virtual void operator==(const Type&);
00433
00434
00435
00436
00437 friend Ostream& operator<< <Type>(Ostream&, const fvPatchField<Type>&);
00438 };
00439
00440
00441
00442
00443 }
00444
00445
00446
00447 #ifdef NoRepository
00448 # include "fvPatchField.C"
00449 # include "calculatedFvPatchField.H"
00450 #endif
00451
00452
00453 #define makePatchTypeFieldTypeName(type) \
00454 \
00455 defineNamedTemplateTypeNameAndDebug(type, 0);
00456
00457 #define makePatchFieldsTypeName(type) \
00458 \
00459 makePatchTypeFieldTypeName(type##FvPatchScalarField); \
00460 makePatchTypeFieldTypeName(type##FvPatchVectorField); \
00461 makePatchTypeFieldTypeName(type##FvPatchSphericalTensorField); \
00462 makePatchTypeFieldTypeName(type##FvPatchSymmTensorField); \
00463 makePatchTypeFieldTypeName(type##FvPatchTensorField);
00464
00465 #define makePatchTypeField(PatchTypeField, typePatchTypeField) \
00466 \
00467 defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
00468 \
00469 addToRunTimeSelectionTable \
00470 ( \
00471 PatchTypeField, typePatchTypeField, patch \
00472 ); \
00473 \
00474 addToRunTimeSelectionTable \
00475 ( \
00476 PatchTypeField, \
00477 typePatchTypeField, \
00478 patchMapper \
00479 ); \
00480 \
00481 addToRunTimeSelectionTable \
00482 ( \
00483 PatchTypeField, typePatchTypeField, dictionary \
00484 );
00485
00486
00487 #define makePatchFields(type) \
00488 \
00489 makePatchTypeField(fvPatchScalarField, type##FvPatchScalarField); \
00490 makePatchTypeField(fvPatchVectorField, type##FvPatchVectorField); \
00491 makePatchTypeField \
00492 ( \
00493 fvPatchSphericalTensorField, \
00494 type##FvPatchSphericalTensorField \
00495 ); \
00496 makePatchTypeField(fvPatchSymmTensorField, type##FvPatchSymmTensorField); \
00497 makePatchTypeField(fvPatchTensorField, type##FvPatchTensorField);
00498
00499
00500 #define makePatchTypeFieldTypedefs(type) \
00501 \
00502 typedef type##FvPatchField<scalar> type##FvPatchScalarField; \
00503 typedef type##FvPatchField<vector> type##FvPatchVectorField; \
00504 typedef type##FvPatchField<sphericalTensor> \
00505 type##FvPatchSphericalTensorField; \
00506 typedef type##FvPatchField<symmTensor> type##FvPatchSymmTensorField; \
00507 typedef type##FvPatchField<tensor> type##FvPatchTensorField;
00508
00509
00510
00511
00512 #endif
00513
00514
Copyright © 2000-2007 OpenCFD Ltd