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 #ifndef LimitedScheme_H
00048 #define LimitedScheme_H
00049
00050 #include "limitedSurfaceInterpolationScheme.H"
00051 #include "LimitFuncs.H"
00052 #include "NVDTVD.H"
00053 #include "NVDVTVDV.H"
00054
00055
00056
00057 namespace Foam
00058 {
00059
00060
00061
00062
00063
00064 template<class Type, class Limiter, template<class> class LimitFunc>
00065 class LimitedScheme
00066 :
00067 public limitedSurfaceInterpolationScheme<Type>,
00068 public Limiter
00069 {
00070
00071
00072
00073 LimitedScheme(const LimitedScheme&);
00074
00075
00076 void operator=(const LimitedScheme&);
00077
00078
00079 public:
00080
00081
00082 TypeName("LimitedScheme");
00083
00084 typedef Limiter LimiterType;
00085
00086
00087
00088
00089 LimitedScheme
00090 (
00091 const fvMesh& mesh,
00092 const surfaceScalarField& faceFlux,
00093 const Limiter& weight
00094 )
00095 :
00096 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
00097 Limiter(weight)
00098 {}
00099
00100
00101
00102
00103 LimitedScheme
00104 (
00105 const fvMesh& mesh,
00106 Istream& is
00107 )
00108 :
00109 limitedSurfaceInterpolationScheme<Type>(mesh, is),
00110 Limiter(is)
00111 {}
00112
00113
00114 LimitedScheme
00115 (
00116 const fvMesh& mesh,
00117 const surfaceScalarField& faceFlux,
00118 Istream& is
00119 )
00120 :
00121 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
00122 Limiter(is)
00123 {}
00124
00125
00126
00127
00128
00129 virtual tmp<surfaceScalarField> limiter
00130 (
00131 const GeometricField<Type, fvPatchField, volMesh>&
00132 ) const;
00133 };
00134
00135
00136
00137
00138 }
00139
00140
00141
00142
00143
00144 #define makeLimitedSurfaceInterpolationTypeScheme(SS, LIMITER, NVDTVD, LIMFUNC, TYPE) \
00145 \
00146 typedef LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC> \
00147 LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_; \
00148 defineTemplateTypeNameAndDebugWithName \
00149 (LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
00150 \
00151 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
00152 <LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC> > \
00153 add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \
00154 \
00155 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
00156 <LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC> > \
00157 add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \
00158 \
00159 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
00160 <LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC> > \
00161 add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \
00162 \
00163 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
00164 <LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC> > \
00165 add##SS##LIMFUNC##TYPE##MeshFluxConstructorToLimitedTable_;
00166
00167
00168 #define makeLimitedSurfaceInterpolationScheme(SS, LIMITER) \
00169 \
00170 makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,scalar) \
00171 makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,vector) \
00172 makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,sphericalTensor) \
00173 makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,symmTensor)\
00174 makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,tensor)
00175
00176
00177 #define makeLimitedVSurfaceInterpolationScheme(SS, LIMITER) \
00178 makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDVTVDV,null,vector)
00179
00180
00181 #define makeLLimitedSurfaceInterpolationTypeScheme(SS, LLIMITER, LIMITER, NVDTVD, LIMFUNC, TYPE) \
00182 \
00183 typedef LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> \
00184 LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
00185 defineTemplateTypeNameAndDebugWithName \
00186 (LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
00187 \
00188 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
00189 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00190 add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \
00191 \
00192 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
00193 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00194 add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \
00195 \
00196 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
00197 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00198 add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \
00199 \
00200 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
00201 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00202 add##SS##LIMFUNC##TYPE##MeshFluxConstructorToLimitedTable_;
00203
00204
00205
00206
00207 #ifdef NoRepository
00208 # include "LimitedScheme.C"
00209 #endif
00210
00211
00212
00213 #endif
00214
00215