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 #include "fvcGrad.H"
00027 #include "fvcSurfaceIntegrate.H"
00028 #include <finiteVolume/fvMesh.H>
00029 #include <finiteVolume/gaussGrad.H>
00030 
00031 
00032 
00033 namespace Foam
00034 {
00035 
00036 
00037 
00038 namespace fvc
00039 {
00040 
00041 
00042 
00043 template<class Type>
00044 tmp
00045 <
00046     GeometricField
00047     <
00048         typename outerProduct<vector, Type>::type, fvPatchField, volMesh
00049     >
00050 >
00051 grad
00052 (
00053     const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf
00054 )
00055 {
00056     return fv::gaussGrad<Type>::grad(ssf);
00057 }
00058 
00059 
00060 template<class Type>
00061 tmp
00062 <
00063     GeometricField
00064     <
00065         typename outerProduct<vector,Type>::type, fvPatchField, volMesh
00066     >
00067 >
00068 grad
00069 (
00070     const tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >& tssf
00071 )
00072 {
00073     typedef typename outerProduct<vector, Type>::type GradType;
00074     tmp<GeometricField<GradType, fvPatchField, volMesh> > Grad
00075     (
00076         fvc::grad(tssf())
00077     );
00078     tssf.clear();
00079     return Grad;
00080 }
00081 
00082 
00083 template<class Type>
00084 tmp
00085 <
00086     GeometricField
00087     <
00088         typename outerProduct<vector,Type>::type, fvPatchField, volMesh
00089     >
00090 >
00091 grad
00092 (
00093     const GeometricField<Type, fvPatchField, volMesh>& vf,
00094     const word& name
00095 )
00096 {
00097     return fv::gradScheme<Type>::New
00098     (
00099         vf.mesh(),
00100         vf.mesh().gradScheme(name)
00101     )().grad(vf);
00102 }
00103 
00104 
00105 template<class Type>
00106 tmp
00107 <
00108     GeometricField
00109     <
00110         typename outerProduct<vector,Type>::type, fvPatchField, volMesh
00111     >
00112 >
00113 grad
00114 (
00115     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00116     const word& name
00117 )
00118 {
00119     tmp
00120     <
00121         GeometricField
00122         <
00123             typename outerProduct<vector, Type>::type, fvPatchField, volMesh
00124         >
00125     > tGrad
00126     (
00127         fvc::grad(tvf(), name)
00128     );
00129     tvf.clear();
00130     return tGrad;
00131 }
00132 
00133 
00134 template<class Type>
00135 tmp
00136 <
00137     GeometricField
00138     <
00139         typename outerProduct<vector,Type>::type, fvPatchField, volMesh
00140     >
00141 >
00142 grad
00143 (
00144     const GeometricField<Type, fvPatchField, volMesh>& vf
00145 )
00146 {
00147     return fvc::grad(vf, "grad(" + vf.name() + ')');
00148 }
00149 
00150 
00151 template<class Type>
00152 tmp
00153 <
00154     GeometricField
00155     <
00156         typename outerProduct<vector,Type>::type, fvPatchField, volMesh
00157     >
00158 >
00159 grad
00160 (
00161     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00162 )
00163 {
00164     typedef typename outerProduct<vector, Type>::type GradType;
00165     tmp<GeometricField<GradType, fvPatchField, volMesh> > Grad
00166     (
00167         fvc::grad(tvf())
00168     );
00169     tvf.clear();
00170     return Grad;
00171 }
00172 
00173 
00174 
00175 
00176 } 
00177 
00178 
00179 
00180 } 
00181 
00182