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