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