Initialize size of wellperf_gpot_ properly.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-05-21 13:13:13 +02:00
parent 9296e3056e
commit 83856a47ef

View File

@ -181,11 +181,12 @@ namespace Opm
const int nperf = wells_->well_connpos[nw];
const int dim = grid_.dimensions;
const double grav = gravity_ ? gravity_[dim - 1] : 0.0;
wellperf_gpot_.clear();
wellperf_gpot_.resize(np*nperf, 0.0);
if (grav == 0.0) {
wellperf_gpot_.clear();
wellperf_gpot_.resize(np*nperf, 0.0);
return;
}
// Temporary storage for perforation A matrices and densities.
std::vector<double> A(np*np, 0.0);
std::vector<double> rho(np, 0.0);