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