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

View File

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