fixed: warn and exit instead of segfault if model uses more materials than is in rock list

This commit is contained in:
Arne Morten Kvarving 2012-11-20 11:24:51 +01:00
parent 29ec9824e9
commit cd6c93a28b

View File

@ -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);
}