mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-25 10:40:21 -06:00
Assert non-empty state quantities.
This avoids generating a null-pointer dereference for &s[0] in case of s.empty().
This commit is contained in:
parent
3ff5347ac9
commit
ea1cdcd478
@ -75,6 +75,8 @@ namespace Opm {
|
||||
{
|
||||
const std::vector<double>& s = state.saturation();
|
||||
|
||||
assert (s.size() == std::vector<double>::size_type(nc_ * np_));
|
||||
|
||||
double* dkrds = 0; // Ignore rel-perm derivatives
|
||||
fluid_.relperm(nc_, & s[0], & cells_[0],
|
||||
kr_.data(), dkrds);
|
||||
@ -86,6 +88,9 @@ namespace Opm {
|
||||
const std::vector<double>& p = state.pressure();
|
||||
const std::vector<double>& z = state.surfacevol();
|
||||
|
||||
assert (p.size() == std::vector<double>::size_type(nc_ * 1 ));
|
||||
assert (z.size() == std::vector<double>::size_type(nc_ * np_));
|
||||
|
||||
fluid_.matrix (nc_, & p[0], & z[0], & cells_[0],
|
||||
A_ .data(), dA_ .data());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user