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