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 #ifndef limitWith_H
00037 #define limitWith_H
00038 
00039 #include <finiteVolume/surfaceInterpolationScheme.H>
00040 #include <finiteVolume/limitedSurfaceInterpolationScheme.H>
00041 
00042 
00043 
00044 namespace Foam
00045 {
00046 
00047 
00048 
00049 
00050 
00051 template<class Type>
00052 class limitWith
00053 :
00054     public surfaceInterpolationScheme<Type>
00055 {
00056     
00057 
00058         
00059         tmp<surfaceInterpolationScheme<Type> > tInterp_;
00060 
00061         
00062         tmp<limitedSurfaceInterpolationScheme<Type> > tLimiter_;
00063 
00064 
00065         
00066         limitWith(const limitWith&);
00067 
00068         
00069         void operator=(const limitWith&);
00070 
00071 
00072 public:
00073 
00074     
00075     TypeName("limitWith");
00076 
00077 
00078     
00079 
00080         
00081         
00082         
00083         limitWith
00084         (
00085             const fvMesh& mesh,
00086             Istream& is
00087         )
00088         :
00089             surfaceInterpolationScheme<Type>(mesh),
00090             tInterp_
00091             (
00092                 surfaceInterpolationScheme<Type>::New(mesh, is)
00093             ),
00094             tLimiter_
00095             (
00096                 limitedSurfaceInterpolationScheme<Type>::New(mesh, is)
00097             )
00098         {}
00099 
00100         
00101         limitWith
00102         (
00103             const fvMesh& mesh,
00104             const surfaceScalarField& faceFlux,
00105             Istream& is
00106         )
00107         :
00108             surfaceInterpolationScheme<Type>(mesh),
00109             tInterp_
00110             (
00111                 surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
00112             ),
00113             tLimiter_
00114             (
00115                 limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
00116             )
00117         {}
00118 
00119 
00120     
00121 
00122         
00123         virtual tmp<surfaceScalarField> weights
00124         (
00125             const GeometricField<Type, fvPatchField, volMesh>& vf
00126         ) const
00127         {
00128             return tLimiter_().weights
00129             (
00130                 vf,
00131                 tInterp_().weights(vf),
00132                 tLimiter_().limiter(vf)
00133             );
00134         }
00135 
00136         
00137         virtual bool corrected() const
00138         {
00139             return tInterp_().corrected();
00140         }
00141 
00142         
00143         
00144         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00145         correction(const GeometricField<Type, fvPatchField, volMesh>& vf) const
00146         {
00147             return tLimiter_().limiter(vf)*tInterp_().correction(vf);
00148         }
00149 };
00150 
00151 
00152 
00153 
00154 } 
00155 
00156 
00157 
00158 #endif
00159 
00160