mirror of
https://github.com/OPM/opm-upscaling.git
synced 2025-02-25 18:45:23 -06:00
fixed: warn and exit instead of segfault if model uses more materials than is in rock list
This commit is contained in:
parent
29ec9824e9
commit
cd6c93a28b
@ -782,6 +782,10 @@ void ElasticityUpscale<GridType>::loadMaterialsFromRocklist(const std::string& f
|
||||
std::vector<int> cells = gv.globalCell();
|
||||
for (size_t i=0;i<cells.size();++i) {
|
||||
int k = cells[i];
|
||||
if (satnum[k]-1 >= cache.size()) {
|
||||
std::cerr << "Material " << satnum[k] << " referenced but not available. Check your rocklist." << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
materials.push_back(cache[satnum[k]-1]);
|
||||
volume[satnum[k]-1] += gv.cellVolume(i);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user