mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use compressedToCartesian() to avoid possible null reference.
This commit is contained in:
parent
827da9baa3
commit
99d3ca24bb
@ -2,6 +2,7 @@
|
|||||||
#include <opm/core/grid/GridHelpers.hpp>
|
#include <opm/core/grid/GridHelpers.hpp>
|
||||||
|
|
||||||
#include <opm/core/utility/ErrorMacros.hpp>
|
#include <opm/core/utility/ErrorMacros.hpp>
|
||||||
|
#include <opm/core/utility/compressedToCartesian.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
@ -380,8 +381,11 @@ WellsManager::init(const Opm::EclipseStateConstPtr eclipseState,
|
|||||||
// use cell thickness (dz) from eclGrid
|
// use cell thickness (dz) from eclGrid
|
||||||
// dz overwrites values calculated by WellDetails::getCubeDim
|
// dz overwrites values calculated by WellDetails::getCubeDim
|
||||||
std::vector<double> dz(number_of_cells);
|
std::vector<double> dz(number_of_cells);
|
||||||
for (int cell = 0; cell < number_of_cells; ++cell) {
|
{
|
||||||
dz[cell] = eclGrid->getCellThicknes(global_cell[cell]);
|
std::vector<int> gc = compressedToCartesian(number_of_cells, global_cell);
|
||||||
|
for (int cell = 0; cell < number_of_cells; ++cell) {
|
||||||
|
dz[cell] = eclGrid->getCellThicknes(gc[cell]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createWellsFromSpecs(wells, timeStep, cell_to_faces,
|
createWellsFromSpecs(wells, timeStep, cell_to_faces,
|
||||||
|
Loading…
Reference in New Issue
Block a user