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