Catch errors in material lookup according to entity index
Description
MaterialCollection::get_material()
searches for the material with the same mapping index as the current physical entity. The lookup currently does not consider that the index might not be found due to inconsistencies in the inserted grid and the user input. Such an error, however, leads to a segmentation fault rather than an error message.
Proposal
Add a try-catch
block to MaterialCollection::get_material()
and throw an error with informative error message if the material definition cannot be found.