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 #ifndef multivariateSurfaceInterpolationScheme_H
00036 #define multivariateSurfaceInterpolationScheme_H
00037 
00038 #include <finiteVolume/surfaceInterpolationScheme.H>
00039 #include <OpenFOAM/HashTable.H>
00040 
00041 
00042 
00043 namespace Foam
00044 {
00045 
00046 
00047 
00048 
00049 
00050 template<class Type>
00051 class multivariateSurfaceInterpolationScheme
00052 :
00053     public refCount
00054 {
00055 
00056 public:
00057 
00058     
00059     class fieldTable
00060     :
00061         public HashTable<const GeometricField<Type, fvPatchField, volMesh>*>
00062     {
00063     public:
00064 
00065         fieldTable()
00066         {}
00067 
00068         void add(const GeometricField<Type, fvPatchField, volMesh>& f)
00069         {
00070             this->insert(f.name(), &f);
00071         }
00072     };
00073 
00074 
00075 private:
00076 
00077     
00078 
00079         
00080         const fvMesh& mesh_;
00081 
00082         
00083         const fieldTable& fields_;
00084 
00085 
00086     
00087 
00088         
00089         multivariateSurfaceInterpolationScheme
00090         (
00091             const multivariateSurfaceInterpolationScheme&
00092         );
00093 
00094         
00095         void operator=(const multivariateSurfaceInterpolationScheme&);
00096 
00097 
00098 public:
00099 
00100     
00101     virtual const word& type() const = 0;
00102 
00103 
00104     
00105 
00106         declareRunTimeSelectionTable
00107         (
00108             tmp,
00109             multivariateSurfaceInterpolationScheme,
00110             Istream,
00111             (
00112                 const fvMesh& mesh,
00113                 const fieldTable& fields,
00114                 const surfaceScalarField& faceFlux,
00115                 Istream& is
00116             ),
00117             (mesh, fields, faceFlux, is)
00118         );
00119 
00120 
00121     
00122 
00123         
00124         multivariateSurfaceInterpolationScheme
00125         (
00126             const fvMesh& mesh,
00127             const fieldTable& fields,
00128             const surfaceScalarField& faceFlux,
00129             Istream& schemeData
00130         );
00131 
00132 
00133     
00134 
00135         
00136         static tmp<multivariateSurfaceInterpolationScheme<Type> > New
00137         (
00138             const fvMesh& mesh,
00139             const fieldTable& fields,
00140             const surfaceScalarField& faceFlux,
00141             Istream& schemeData
00142         );
00143 
00144 
00145     
00146 
00147         virtual ~multivariateSurfaceInterpolationScheme();
00148 
00149 
00150     
00151 
00152         
00153         const fvMesh& mesh() const
00154         {
00155             return mesh_;
00156         }
00157 
00158         
00159         const fieldTable& fields() const
00160         {
00161             return fields_;
00162         }
00163 
00164 
00165     
00166 
00167         
00168         
00169         class fieldScheme
00170         :
00171             public surfaceInterpolationScheme<Type>
00172         {
00173 
00174         public:
00175 
00176             
00177 
00178                 fieldScheme
00179                 (
00180                     const GeometricField<Type, fvPatchField, volMesh>& field
00181                 )
00182                 :
00183                     surfaceInterpolationScheme<Type>(field.mesh())
00184                 {}
00185 
00186 
00187             
00188 
00189                 
00190                 virtual tmp<surfaceScalarField> weights
00191                 (
00192                     const GeometricField<Type, fvPatchField, volMesh>& field
00193                 ) const = 0;
00194         };
00195 
00196         virtual tmp<surfaceInterpolationScheme<Type> > operator()
00197         (
00198             const GeometricField<Type, fvPatchField, volMesh>& field
00199         ) const = 0;
00200 };
00201 
00202 
00203 
00204 
00205 } 
00206 
00207 
00208 
00209 
00210 
00211 #define makeMultivariateSurfaceInterpolationTypeScheme(SS, Type)               \
00212                                                                                \
00213 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00214                                                                                \
00215 multivariateSurfaceInterpolationScheme<Type>::                                 \
00216 addIstreamConstructorToTable<SS<Type> >                                        \
00217     add##SS##Type##ConstructorToTable_;
00218 
00219 
00220 #define makeMultivariateSurfaceInterpolationScheme(SS)                         \
00221                                                                                \
00222 makeMultivariateSurfaceInterpolationTypeScheme(SS, scalar)                     \
00223 makeMultivariateSurfaceInterpolationTypeScheme(SS, vector)                     \
00224 makeMultivariateSurfaceInterpolationTypeScheme(SS, sphericalTensor)            \
00225 makeMultivariateSurfaceInterpolationTypeScheme(SS, symmTensor)                 \
00226 makeMultivariateSurfaceInterpolationTypeScheme(SS, tensor)
00227 
00228 
00229 
00230 
00231 #ifdef NoRepository
00232 #   include <finiteVolume/multivariateSurfaceInterpolationScheme.C>
00233 #endif
00234 
00235 
00236 
00237 #endif
00238 
00239