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