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