sampledSurface.H
Go to the documentation of this file.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
00046
00047
00048
00049
00050 #ifndef sampledSurface_H
00051 #define sampledSurface_H
00052
00053 #include "pointField.H"
00054 #include "word.H"
00055 #include "labelList.H"
00056 #include "faceList.H"
00057 #include "typeInfo.H"
00058 #include "runTimeSelectionTables.H"
00059 #include "autoPtr.H"
00060 #include "volFieldsFwd.H"
00061 #include "polyMesh.H"
00062 #include "coordinateSystems.H"
00063 #include "interpolation.H"
00064
00065
00066
00067 namespace Foam
00068 {
00069
00070
00071
00072
00073
00074 class sampledSurface
00075 {
00076
00077
00078
00079 word name_;
00080
00081
00082 const polyMesh& mesh_;
00083
00084
00085 bool interpolate_;
00086
00087
00088
00089
00090
00091 mutable vectorField* SfPtr_;
00092
00093
00094 mutable scalarField* magSfPtr_;
00095
00096
00097 mutable vectorField* CfPtr_;
00098
00099
00100 mutable scalar area_;
00101
00102
00103
00104
00105 void makeSf() const;
00106
00107
00108 void makeMagSf() const;
00109
00110
00111 void makeCf() const;
00112
00113
00114
00115
00116 template<class Type>
00117 bool checkFieldSize(const Field<Type>&) const;
00118
00119
00120 template<class ReturnType, class Type>
00121 void project
00122 (
00123 Field<ReturnType>&,
00124 const Field<Type>&
00125 ) const;
00126
00127
00128 template<class ReturnType, class Type>
00129 void project
00130 (
00131 Field<ReturnType>&,
00132 const tmp<Field<Type> >&
00133 ) const;
00134
00135
00136 template<class ReturnType, class Type>
00137 tmp<Field<ReturnType> > project(const tmp<Field<Type> >&) const;
00138
00139 protected:
00140
00141
00142
00143 virtual void clearGeom() const;
00144
00145 public:
00146
00147
00148 TypeName("sampledSurface");
00149
00150
00151
00152
00153 declareRunTimeSelectionTable
00154 (
00155 autoPtr,
00156 sampledSurface,
00157 word,
00158 (
00159 const word& name,
00160 const polyMesh& mesh,
00161 const dictionary& dict
00162 ),
00163 (name, mesh, dict)
00164 );
00165
00166
00167
00168 class iNew
00169 {
00170
00171 const polyMesh& mesh_;
00172
00173 public:
00174
00175 iNew(const polyMesh& mesh)
00176 :
00177 mesh_(mesh)
00178 {}
00179
00180 autoPtr<sampledSurface> operator()(Istream& is) const
00181 {
00182 word name(is);
00183 dictionary dict(is);
00184
00185 return sampledSurface::New(name, mesh_, dict);
00186 }
00187 };
00188
00189
00190
00191
00192
00193 sampledSurface
00194 (
00195 const word& name,
00196 const polyMesh&
00197 );
00198
00199
00200 sampledSurface
00201 (
00202 const word& name,
00203 const polyMesh&,
00204 const dictionary&
00205 );
00206
00207
00208 autoPtr<sampledSurface> clone() const
00209 {
00210 notImplemented("autoPtr<sampledSurface> clone() const");
00211 return autoPtr<sampledSurface>(NULL);
00212 }
00213
00214
00215
00216
00217
00218 static autoPtr<sampledSurface> New
00219 (
00220 const word& name,
00221 const polyMesh&,
00222 const dictionary&
00223 );
00224
00225
00226
00227
00228 virtual ~sampledSurface();
00229
00230
00231
00232
00233
00234
00235
00236 const polyMesh& mesh() const
00237 {
00238 return mesh_;
00239 }
00240
00241
00242 const word& name() const
00243 {
00244 return name_;
00245 }
00246
00247
00248 bool interpolate() const
00249 {
00250 return interpolate_;
00251 }
00252
00253
00254 virtual bool needsUpdate() const = 0;
00255
00256
00257
00258
00259 virtual bool expire() = 0;
00260
00261
00262
00263 virtual bool update() = 0;
00264
00265
00266
00267 virtual const pointField& points() const = 0;
00268
00269
00270 virtual const faceList& faces() const = 0;
00271
00272
00273 virtual const vectorField& Sf() const;
00274
00275
00276 virtual const scalarField& magSf() const;
00277
00278
00279 virtual const vectorField& Cf() const;
00280
00281
00282 scalar area() const;
00283
00284
00285 template<class Type>
00286 Type integrate(const Field<Type>&) const;
00287
00288
00289 template<class Type>
00290 Type integrate(const tmp<Field<Type> >&) const;
00291
00292
00293 template<class Type>
00294 Type average(const Field<Type>&) const;
00295
00296
00297 template<class Type>
00298 Type average(const tmp<Field<Type> >&) const;
00299
00300
00301 tmp<Field<scalar> > project(const Field<scalar>&) const;
00302
00303
00304 tmp<Field<scalar> > project(const Field<vector>&) const;
00305
00306
00307 tmp<Field<vector> > project(const Field<sphericalTensor>&) const;
00308
00309
00310 tmp<Field<vector> > project(const Field<symmTensor>&) const;
00311
00312
00313 tmp<Field<vector> > project(const Field<tensor>&) const;
00314
00315
00316 virtual tmp<scalarField> sample
00317 (
00318 const volScalarField&
00319 ) const = 0;
00320
00321
00322 virtual tmp<vectorField> sample
00323 (
00324 const volVectorField&
00325 ) const = 0;
00326
00327
00328 virtual tmp<sphericalTensorField> sample
00329 (
00330 const volSphericalTensorField&
00331 ) const = 0;
00332
00333
00334 virtual tmp<symmTensorField> sample
00335 (
00336 const volSymmTensorField&
00337 ) const = 0;
00338
00339
00340 virtual tmp<tensorField> sample
00341 (
00342 const volTensorField&
00343 ) const = 0;
00344
00345
00346
00347 virtual tmp<scalarField> interpolate
00348 (
00349 const interpolation<scalar>&
00350 ) const = 0;
00351
00352
00353
00354 virtual tmp<vectorField> interpolate
00355 (
00356 const interpolation<vector>&
00357 ) const = 0;
00358
00359
00360 virtual tmp<sphericalTensorField> interpolate
00361 (
00362 const interpolation<sphericalTensor>&
00363 ) const = 0;
00364
00365
00366 virtual tmp<symmTensorField> interpolate
00367 (
00368 const interpolation<symmTensor>&
00369 ) const = 0;
00370
00371
00372 virtual tmp<tensorField> interpolate
00373 (
00374 const interpolation<tensor>&
00375 ) const = 0;
00376
00377
00378
00379
00380
00381 virtual void rename(const word& newName)
00382 {
00383 name_ = newName;
00384 }
00385
00386
00387
00388
00389
00390 virtual void print(Ostream&) const;
00391
00392
00393
00394
00395 friend Ostream& operator<<(Ostream&, const sampledSurface&);
00396 };
00397
00398
00399
00400
00401 }
00402
00403
00404
00405 #ifdef NoRepository
00406 # include "sampledSurfaceTemplates.C"
00407 #endif
00408
00409
00410
00411 #endif
00412
00413
Copyright © 2000-2009 OpenCFD Ltd