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
00038 #ifndef localMin_H
00039 #define localMin_H
00040
00041 #include "surfaceInterpolationScheme.H"
00042 #include "volFields.H"
00043 #include "surfaceFields.H"
00044
00045
00046
00047 namespace Foam
00048 {
00049
00050
00051
00052
00053
00054 template<class Type>
00055 class localMin
00056 :
00057 public surfaceInterpolationScheme<Type>
00058 {
00059
00060
00061
00062 void operator=(const localMin&);
00063
00064
00065 public:
00066
00067
00068 TypeName("localMin");
00069
00070
00071
00072
00073
00074 localMin(const fvMesh& mesh)
00075 :
00076 surfaceInterpolationScheme<Type>(mesh)
00077 {}
00078
00079
00080
00081
00082 localMin
00083 (
00084 const fvMesh& mesh,
00085 Istream& is
00086 )
00087 :
00088 surfaceInterpolationScheme<Type>(mesh)
00089 {}
00090
00091
00092 localMin
00093 (
00094 const fvMesh& mesh,
00095 const surfaceScalarField& faceFlux,
00096 Istream& is
00097 )
00098 :
00099 surfaceInterpolationScheme<Type>(mesh)
00100 {}
00101
00102
00103
00104
00105
00106 virtual tmp<surfaceScalarField> weights
00107 (
00108 const GeometricField<Type, fvPatchField, volMesh>&
00109 ) const
00110 {
00111 notImplemented
00112 (
00113 "localMin::weights"
00114 "(const GeometricField<Type, fvPatchField, volMesh>&)"
00115 );
00116
00117 return tmp<surfaceScalarField>(NULL);
00118 }
00119
00120
00121 virtual tmp<GeometricField<Type, fvPatchField, surfaceMesh> >
00122 interpolate
00123 (
00124 const GeometricField<Type, fvPatchField, volMesh>& vf
00125 ) const
00126 {
00127 const fvMesh& mesh = vf.mesh();
00128
00129 tmp<GeometricField<Type, fvPatchField, surfaceMesh> > tvff
00130 (
00131 new GeometricField<Type, fvPatchField, surfaceMesh>
00132 (
00133 IOobject
00134 (
00135 vf.name(),
00136 mesh.time().timeName(),
00137 mesh
00138 ),
00139 mesh,
00140 vf.dimensions()
00141 )
00142 );
00143 GeometricField<Type, fvPatchField, surfaceMesh>& vff = tvff();
00144 vff.boundaryField() = vf.boundaryField();
00145
00146 const unallocLabelList& own = mesh.owner();
00147 const unallocLabelList& nei = mesh.neighbour();
00148
00149 forAll(vff, facei)
00150 {
00151 vff[facei] = min(vf[own[facei]], vf[nei[facei]]);
00152 }
00153
00154 return tvff;
00155 }
00156 };
00157
00158
00159
00160
00161 }
00162
00163
00164
00165 #endif
00166
00167