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