BUG: Prevent overflow on integer multiplication

This commit is contained in:
laurence
2013-04-11 20:07:26 +01:00
parent d8a91260c1
commit 21163c9591
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -92,7 +92,7 @@ List<Vb::Point> uniformGrid::initialPoints() const
scalar pert = randomPerturbationCoeff_*cmptMin(delta);
// Initialise points list
DynamicList<Vb::Point> initialPoints(ni*nj*nk/10);
DynamicList<Vb::Point> initialPoints(scalar(ni)*nj*nk/10);
for (label i = 0; i < ni; i++)
{

View File

@ -435,8 +435,10 @@ bool Foam::checkCoupledPoints
setPtr->insert(cpp.start()+i);
}
nErrorFaces++;
break;
}
avgMismatch += d;
nCoupledPoints++;