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 blendedEdgeInterpolation_H
00037 #define blendedEdgeInterpolation_H
00038
00039 #include "linearEdgeInterpolation.H"
00040 #include "upwindEdgeInterpolation.H"
00041 #include "areaFields.H"
00042
00043
00044
00045 namespace Foam
00046 {
00047
00048
00049
00050
00051
00052 template<class Type>
00053 class blendedEdgeInterpolation
00054 :
00055 public linearEdgeInterpolation<Type>,
00056 public upwindEdgeInterpolation<Type>
00057 {
00058
00059
00060 const scalar blendingFactor_;
00061
00062
00063
00064
00065
00066 blendedEdgeInterpolation(const blendedEdgeInterpolation&);
00067
00068
00069 void operator=(const blendedEdgeInterpolation&);
00070
00071
00072 public:
00073
00074
00075 TypeName("blended");
00076
00077
00078
00079
00080
00081 blendedEdgeInterpolation
00082 (
00083 const faMesh& mesh,
00084 const edgeScalarField& faceFlux,
00085 const scalar blendingFactor
00086 )
00087 :
00088 edgeInterpolationScheme<Type>(mesh),
00089 linearEdgeInterpolation<Type>(mesh),
00090 upwindEdgeInterpolation<Type>(mesh, faceFlux),
00091 blendingFactor_(blendingFactor)
00092 {}
00093
00094
00095
00096
00097 blendedEdgeInterpolation
00098 (
00099 const faMesh& mesh,
00100 Istream& is
00101 )
00102 :
00103 edgeInterpolationScheme<Type>(mesh),
00104 linearEdgeInterpolation<Type>(mesh),
00105 upwindEdgeInterpolation<Type>
00106 (
00107 mesh,
00108 mesh.db().objectRegistry::lookupObject<edgeScalarField>
00109 (
00110 word(is)
00111 )
00112 ),
00113 blendingFactor_(readScalar(is))
00114 {}
00115
00116
00117 blendedEdgeInterpolation
00118 (
00119 const faMesh& mesh,
00120 const edgeScalarField& faceFlux,
00121 Istream& is
00122 )
00123 :
00124 edgeInterpolationScheme<Type>(mesh),
00125 linearEdgeInterpolation<Type>(mesh),
00126 upwindEdgeInterpolation<Type>(mesh, faceFlux),
00127 blendingFactor_(readScalar(is))
00128 {}
00129
00130
00131
00132
00133
00134 virtual tmp<edgeScalarField> weights
00135 (
00136 const GeometricField<Type, faPatchField, areaMesh>& vf
00137 ) const
00138 {
00139 return
00140 blendingFactor_*linearEdgeInterpolation<Type>::weights(vf)
00141 + (1 - blendingFactor_)*upwindEdgeInterpolation<Type>::weights(vf);
00142 }
00143 };
00144
00145
00146
00147
00148 }
00149
00150
00151
00152 #endif
00153
00154