BUGFIX: Illegal use of uninitialised value (backport)

This commit is contained in:
Henrik Rusche 2013-12-04 02:24:48 +01:00
parent 8e9482621b
commit d97c617e23

View file

@ -205,7 +205,7 @@ void Foam::FreeStream<CloudType>::inflow()
// geometrical properties multiple times.
labelList faceVertices = patch[f];
label nVertices = faceVertices.size();
label globalFaceIndex = f + patch.start();
@ -219,6 +219,8 @@ void Foam::FreeStream<CloudType>::inflow()
// Cumulative triangle area fractions
List<scalar> cTriAFracs(nVertices);
scalar previousCummulativeSum = 0.0;
for (label v = 0; v < nVertices - 1; v++)
{
const point& vA = mesh.points()[faceVertices[v]];
@ -227,7 +229,9 @@ void Foam::FreeStream<CloudType>::inflow()
cTriAFracs[v] =
0.5*mag((vA - fC)^(vB - fC))/fA
+ cTriAFracs[max((v - 1), 0)];
+ previousCummulativeSum;
previousCummulativeSum = cTriAFracs[v];
}
// Force the last area fraction value to 1.0 to avoid any