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,tensor)
00173
00174
00175 #define makeLimitedVSurfaceInterpolationScheme(SS, LIMITER) \
00176 makeLimitedSurfaceInterpolationTypeScheme(SS##V,LIMITER,NVDVTVDV,null,vector)
00177
00178
00179 #define makeLLimitedSurfaceInterpolationTypeScheme(SS, LLIMITER, LIMITER, NVDTVD, LIMFUNC, TYPE) \
00180 \
00181 typedef LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> \
00182 LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
00183 defineTemplateTypeNameAndDebugWithName \
00184 (LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
00185 \
00186 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
00187 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00188 add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \
00189 \
00190 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
00191 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00192 add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \
00193 \
00194 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
00195 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00196 add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \
00197 \
00198 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
00199 <LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD> >, limitFuncs::LIMFUNC> > \
00200 add##SS##LIMFUNC##TYPE##MeshFluxConstructorToLimitedTable_;
00201
00202
00203
00204
00205 #ifdef NoRepository
00206 # include "LimitedScheme.C"
00207 #endif
00208
00209
00210
00211 #endif
00212
00213