reverseLinear.H
Go to the documentation of this file.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 reverseLinear_H
00039 #define reverseLinear_H
00040
00041 #include "surfaceInterpolationScheme.H"
00042 #include "volFields.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049
00050
00051
00052
00053 template<class Type>
00054 class reverseLinear
00055 :
00056 public surfaceInterpolationScheme<Type>
00057 {
00058
00059
00060
00061 void operator=(const reverseLinear&);
00062
00063
00064 public:
00065
00066
00067 TypeName("reverseLinear");
00068
00069
00070
00071
00072
00073 reverseLinear(const fvMesh& mesh)
00074 :
00075 surfaceInterpolationScheme<Type>(mesh)
00076 {}
00077
00078
00079 reverseLinear(const fvMesh& mesh, Istream&)
00080 :
00081 surfaceInterpolationScheme<Type>(mesh)
00082 {}
00083
00084
00085 reverseLinear
00086 (
00087 const fvMesh& mesh,
00088 const surfaceScalarField&,
00089 Istream&
00090 )
00091 :
00092 surfaceInterpolationScheme<Type>(mesh)
00093 {}
00094
00095
00096
00097
00098
00099 tmp<surfaceScalarField> weights
00100 (
00101 const GeometricField<Type, fvPatchField, volMesh>&
00102 ) const
00103 {
00104 const fvMesh& mesh = this->mesh();
00105
00106 tmp<surfaceScalarField> tcdWeights
00107 (
00108 mesh.surfaceInterpolation::weights()
00109 );
00110 const surfaceScalarField& cdWeights = tcdWeights();
00111
00112 tmp<surfaceScalarField> treverseLinearWeights
00113 (
00114 new surfaceScalarField
00115 (
00116 IOobject
00117 (
00118 "reverseLinearWeights",
00119 mesh.time().timeName(),
00120 mesh
00121 ),
00122 mesh,
00123 dimless
00124 )
00125 );
00126 surfaceScalarField& reverseLinearWeights = treverseLinearWeights();
00127
00128 reverseLinearWeights.internalField() =
00129 1.0 - cdWeights.internalField();
00130
00131 forAll (mesh.boundary(), patchI)
00132 {
00133 if (mesh.boundary()[patchI].coupled())
00134 {
00135 reverseLinearWeights.boundaryField()[patchI] =
00136 1.0 - cdWeights.boundaryField()[patchI];
00137 }
00138 else
00139 {
00140 reverseLinearWeights.boundaryField()[patchI] =
00141 cdWeights.boundaryField()[patchI];
00142 }
00143 }
00144
00145 return treverseLinearWeights;
00146 }
00147 };
00148
00149
00150
00151
00152 }
00153
00154
00155
00156 #endif
00157
00158
Copyright © 2000-2009 OpenCFD Ltd