Improve out-of-range check for extra components.

This commit is contained in:
Atgeirr Flø Rasmussen 2019-08-07 12:03:43 +02:00
parent dfae9d1b32
commit 12032203b3

View File

@ -1146,7 +1146,7 @@ public:
Scalar getSolventSaturation(unsigned elemIdx) const
{
if (sSol_.size() > 0)
if (sSol_.size() > elemIdx)
return sSol_[elemIdx];
return 0;
@ -1154,7 +1154,7 @@ public:
Scalar getPolymerConcentration(unsigned elemIdx) const
{
if (cPolymer_.size() > 0)
if (cPolymer_.size() > elemIdx)
return cPolymer_[elemIdx];
return 0;
@ -1162,7 +1162,7 @@ public:
Scalar getFoamConcentration(unsigned elemIdx) const
{
if (cFoam_.size() > 0)
if (cFoam_.size() > elemIdx)
return cFoam_[elemIdx];
return 0;