From cd6c93a28b3d6d9e7c3bc0ed66998bda8a95d150 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 20 Nov 2012 11:24:51 +0100 Subject: [PATCH] fixed: warn and exit instead of segfault if model uses more materials than is in rock list --- dune/elasticity/elasticity_upscale_impl.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dune/elasticity/elasticity_upscale_impl.hpp b/dune/elasticity/elasticity_upscale_impl.hpp index 93e0ccc..2d96ebc 100644 --- a/dune/elasticity/elasticity_upscale_impl.hpp +++ b/dune/elasticity/elasticity_upscale_impl.hpp @@ -782,6 +782,10 @@ void ElasticityUpscale::loadMaterialsFromRocklist(const std::string& f std::vector cells = gv.globalCell(); for (size_t i=0;i= 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); }