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 #ifndef skewLinearEdgeInterpolation_H
00038 #define skewLinearEdgeInterpolation_H
00039
00040 #include "linearEdgeInterpolation.H"
00041 #include "gaussFaGrad.H"
00042
00043
00044
00045 namespace Foam
00046 {
00047
00048
00049
00050
00051
00052 template<class Type>
00053 class skewLinearEdgeInterpolation
00054 :
00055 public linearEdgeInterpolation<Type>
00056 {
00057
00058
00059
00060 skewLinearEdgeInterpolation(const skewLinearEdgeInterpolation&);
00061
00062
00063 void operator=(const skewLinearEdgeInterpolation&);
00064
00065
00066 public:
00067
00068
00069 TypeName("skewLinear");
00070
00071
00072
00073
00074
00075 skewLinearEdgeInterpolation(const faMesh& mesh)
00076 :
00077 edgeInterpolationScheme<Type>(mesh),
00078 linearEdgeInterpolation<Type>(mesh)
00079 {}
00080
00081
00082
00083 skewLinearEdgeInterpolation
00084 (
00085 const faMesh& mesh,
00086 Istream&
00087 )
00088 :
00089 edgeInterpolationScheme<Type>(mesh),
00090 linearEdgeInterpolation<Type>(mesh)
00091 {}
00092
00093
00094
00095 skewLinearEdgeInterpolation
00096 (
00097 const faMesh& mesh,
00098 const edgeScalarField&,
00099 Istream&
00100 )
00101 :
00102 edgeInterpolationScheme<Type>(mesh),
00103 linearEdgeInterpolation<Type>(mesh)
00104 {}
00105
00106
00107
00108
00109
00110 virtual bool corrected() const
00111 {
00112 return this->mesh().skew();
00113 }
00114
00115
00116 virtual tmp<GeometricField<Type, faPatchField, edgeMesh> >
00117 correction
00118 (
00119 const GeometricField<Type, faPatchField, areaMesh>& vf
00120 ) const
00121 {
00122 const faMesh& mesh = this->mesh();
00123
00124 tmp<GeometricField<Type, faPatchField, edgeMesh> > tsfCorr
00125 (
00126 new GeometricField<Type, faPatchField, edgeMesh>
00127 (
00128 IOobject
00129 (
00130 vf.name(),
00131 mesh.time().timeName(),
00132 mesh()
00133 ),
00134 mesh,
00135 dimensioned<Type>
00136 (
00137 vf.name(),
00138 vf.dimensions(),
00139 pTraits<Type>::zero
00140 )
00141 )
00142 );
00143
00144 for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
00145 {
00146 tsfCorr().replace
00147 (
00148 cmpt,
00149 mesh.skewCorrectionVectors()
00150 & linearEdgeInterpolation
00151 <
00152 typename outerProduct
00153 <
00154 vector,
00155 typename pTraits<Type>::cmptType
00156 >::type
00157 >
00158 (mesh).interpolate
00159 (
00160 fa::gaussGrad<typename pTraits<Type>::cmptType>
00161 (mesh).grad(vf.component(cmpt))
00162 )
00163 );
00164 }
00165
00166 return tsfCorr;
00167 }
00168 };
00169
00170
00171
00172
00173 }
00174
00175
00176
00177 #endif
00178
00179