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
00044
00045 #ifndef fvsPatchField_H
00046 #define fvsPatchField_H
00047
00048 #include "fvPatch.H"
00049 #include "DimensionedField.H"
00050
00051
00052
00053 namespace Foam
00054 {
00055
00056
00057
00058 class objectRegistry;
00059 class dictionary;
00060 class fvPatchFieldMapper;
00061 class surfaceMesh;
00062
00063
00064
00065
00066 template<class Type>
00067 class fvsPatchField;
00068
00069 template<class Type>
00070 Ostream& operator<<(Ostream&, const fvsPatchField<Type>&);
00071
00072
00073
00074
00075
00076
00077 template<class Type>
00078 class fvsPatchField
00079 :
00080 public Field<Type>
00081 {
00082
00083
00084
00085 const fvPatch& patch_;
00086
00087
00088 const DimensionedField<Type, surfaceMesh>& internalField_;
00089
00090
00091 public:
00092
00093 typedef fvPatch Patch;
00094
00095
00096
00097 TypeName("fvsPatchField");
00098
00099
00100 static int disallowDefaultFvsPatchField;
00101
00102
00103
00104
00105 declareRunTimeSelectionTable
00106 (
00107 tmp,
00108 fvsPatchField,
00109 patch,
00110 (
00111 const fvPatch& p,
00112 const DimensionedField<Type, surfaceMesh>& iF
00113 ),
00114 (p, iF)
00115 );
00116
00117 declareRunTimeSelectionTable
00118 (
00119 tmp,
00120 fvsPatchField,
00121 patchMapper,
00122 (
00123 const fvsPatchField<Type>& ptf,
00124 const fvPatch& p,
00125 const DimensionedField<Type, surfaceMesh>& iF,
00126 const fvPatchFieldMapper& m
00127 ),
00128 (dynamic_cast<const fvsPatchFieldType&>(ptf), p, iF, m)
00129 );
00130
00131 declareRunTimeSelectionTable
00132 (
00133 tmp,
00134 fvsPatchField,
00135 dictionary,
00136 (
00137 const fvPatch& p,
00138 const DimensionedField<Type, surfaceMesh>& iF,
00139 const dictionary& dict
00140 ),
00141 (p, iF, dict)
00142 );
00143
00144
00145
00146
00147
00148 fvsPatchField
00149 (
00150 const fvPatch&,
00151 const DimensionedField<Type, surfaceMesh>&
00152 );
00153
00154
00155 fvsPatchField
00156 (
00157 const fvPatch&,
00158 const DimensionedField<Type, surfaceMesh>&,
00159 const Field<Type>&
00160 );
00161
00162
00163 fvsPatchField
00164 (
00165 const fvPatch&,
00166 const DimensionedField<Type, surfaceMesh>&,
00167 const dictionary&
00168 );
00169
00170
00171 fvsPatchField
00172 (
00173 const fvsPatchField<Type>&,
00174 const fvPatch&,
00175 const DimensionedField<Type, surfaceMesh>&,
00176 const fvPatchFieldMapper&
00177 );
00178
00179
00180 fvsPatchField(const fvsPatchField<Type>&);
00181
00182
00183 virtual tmp<fvsPatchField<Type> > clone() const
00184 {
00185 return tmp<fvsPatchField<Type> >(new fvsPatchField<Type>(*this));
00186 }
00187
00188
00189 fvsPatchField
00190 (
00191 const fvsPatchField<Type>&,
00192 const DimensionedField<Type, surfaceMesh>&
00193 );
00194
00195
00196 virtual tmp<fvsPatchField<Type> > clone
00197 (
00198 const DimensionedField<Type, surfaceMesh>& iF
00199 ) const
00200 {
00201 return tmp<fvsPatchField<Type> >
00202 (
00203 new fvsPatchField<Type>(*this, iF)
00204 );
00205 }
00206
00207
00208
00209
00210
00211
00212
00213 static tmp<fvsPatchField<Type> > New
00214 (
00215 const word&,
00216 const fvPatch&,
00217 const DimensionedField<Type, surfaceMesh>&
00218 );
00219
00220
00221
00222 static tmp<fvsPatchField<Type> > New
00223 (
00224 const fvsPatchField<Type>&,
00225 const fvPatch&,
00226 const DimensionedField<Type, surfaceMesh>&,
00227 const fvPatchFieldMapper&
00228 );
00229
00230
00231
00232 static tmp<fvsPatchField<Type> > New
00233 (
00234 const fvPatch&,
00235 const DimensionedField<Type, surfaceMesh>&,
00236 const dictionary&
00237 );
00238
00239
00240
00241 template<class Type2>
00242 static tmp<fvsPatchField<Type> > NewCalculatedType
00243 (
00244 const fvsPatchField<Type2>&
00245 );
00246
00247
00248
00249
00250 virtual ~fvsPatchField<Type>()
00251 {}
00252
00253
00254
00255
00256
00257
00258
00259 const objectRegistry& db() const;
00260
00261
00262 const fvPatch& patch() const
00263 {
00264 return patch_;
00265 }
00266
00267
00268 const DimensionedField<Type, surfaceMesh>&
00269 dimensionedInternalField() const
00270 {
00271 return internalField_;
00272 }
00273
00274
00275 const Field<Type>& internalField() const
00276 {
00277 return internalField_;
00278 }
00279
00280
00281 static const word& calculatedType();
00282
00283
00284
00285
00286 virtual bool fixesValue() const
00287 {
00288 return false;
00289 }
00290
00291
00292 virtual bool coupled() const
00293 {
00294 return false;
00295 }
00296
00297
00298
00299
00300
00301 virtual void autoMap
00302 (
00303 const fvPatchFieldMapper&
00304 );
00305
00306
00307 virtual void rmap
00308 (
00309 const fvsPatchField<Type>&,
00310 const labelList&
00311 );
00312
00313
00314
00315 virtual void write(Ostream&) const;
00316
00317
00318
00319
00320
00321 void check(const fvsPatchField<Type>&) const;
00322
00323
00324
00325
00326 virtual void operator=(const UList<Type>&);
00327
00328 virtual void operator=(const fvsPatchField<Type>&);
00329 virtual void operator+=(const fvsPatchField<Type>&);
00330 virtual void operator-=(const fvsPatchField<Type>&);
00331 virtual void operator*=(const fvsPatchField<scalar>&);
00332 virtual void operator/=(const fvsPatchField<scalar>&);
00333
00334 virtual void operator+=(const Field<Type>&);
00335 virtual void operator-=(const Field<Type>&);
00336
00337 virtual void operator*=(const Field<scalar>&);
00338 virtual void operator/=(const Field<scalar>&);
00339
00340 virtual void operator=(const Type&);
00341 virtual void operator+=(const Type&);
00342 virtual void operator-=(const Type&);
00343 virtual void operator*=(const scalar);
00344 virtual void operator/=(const scalar);
00345
00346
00347
00348
00349 virtual void operator==(const fvsPatchField<Type>&);
00350 virtual void operator==(const Field<Type>&);
00351 virtual void operator==(const Type&);
00352
00353
00354
00355
00356 friend Ostream& operator<< <Type>(Ostream&, const fvsPatchField<Type>&);
00357 };
00358
00359
00360
00361
00362 }
00363
00364
00365
00366 #ifdef NoRepository
00367 # include "fvsPatchField.C"
00368 # include "calculatedFvsPatchField.H"
00369 #endif
00370
00371
00372 #define makeFvsPatchTypeFieldTypeName(type) \
00373 \
00374 defineNamedTemplateTypeNameAndDebug(type, 0);
00375
00376 #define makeFvsPatchFieldsTypeName(type) \
00377 \
00378 makeFvsPatchTypeFieldTypeName(type##FvsPatchScalarField); \
00379 makeFvsPatchTypeFieldTypeName(type##FvsPatchVectorField); \
00380 makeFvsPatchTypeFieldTypeName(type##FvsPatchSphericalTensorField); \
00381 makeFvsPatchTypeFieldTypeName(type##FvsPatchSymmTensorField); \
00382 makeFvsPatchTypeFieldTypeName(type##FvsPatchTensorField);
00383
00384 #define makeFvsPatchTypeField(PatchTypeField, typePatchTypeField) \
00385 \
00386 defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
00387 \
00388 addToRunTimeSelectionTable \
00389 ( \
00390 PatchTypeField, typePatchTypeField, patch \
00391 ); \
00392 \
00393 addToRunTimeSelectionTable \
00394 ( \
00395 PatchTypeField, \
00396 typePatchTypeField, \
00397 patchMapper \
00398 ); \
00399 \
00400 addToRunTimeSelectionTable \
00401 ( \
00402 PatchTypeField, typePatchTypeField, dictionary \
00403 );
00404
00405
00406 #define makeFvsPatchFields(type) \
00407 \
00408 makeFvsPatchTypeField(fvsPatchScalarField, type##FvsPatchScalarField); \
00409 makeFvsPatchTypeField(fvsPatchVectorField, type##FvsPatchVectorField); \
00410 makeFvsPatchTypeField \
00411 ( \
00412 fvsPatchSphericalTensorField, \
00413 type##FvsPatchSphericalTensorField \
00414 ); \
00415 makeFvsPatchTypeField(fvsPatchSymmTensorField, type##FvsPatchSymmTensorField); \
00416 makeFvsPatchTypeField(fvsPatchTensorField, type##FvsPatchTensorField);
00417
00418
00419 #define makeFvsPatchTypeFieldTypedefs(type) \
00420 \
00421 typedef type##FvsPatchField<scalar> type##FvsPatchScalarField; \
00422 typedef type##FvsPatchField<vector> type##FvsPatchVectorField; \
00423 typedef type##FvsPatchField<sphericalTensor> \
00424 type##FvsPatchSphericalTensorField; \
00425 typedef type##FvsPatchField<symmTensor> type##FvsPatchSymmTensorField; \
00426 typedef type##FvsPatchField<tensor> type##FvsPatchTensorField;
00427
00428
00429
00430
00431 #endif
00432
00433