From 8b35425bbebb9bc9936c644762449770fa9e8702 Mon Sep 17 00:00:00 2001 From: anne-glerum Date: Mon, 18 Mar 2024 19:55:27 +0100 Subject: [PATCH] Fix check FastScape fields --- source/mesh_deformation/fastscape.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/mesh_deformation/fastscape.cc b/source/mesh_deformation/fastscape.cc index fe814541769..9f683db70bc 100644 --- a/source/mesh_deformation/fastscape.cc +++ b/source/mesh_deformation/fastscape.cc @@ -228,15 +228,18 @@ namespace aspect const std::vector chemical_field_names = this->introspection().chemical_composition_field_names(); if (this->introspection().compositional_name_exists("sediment_age")) { - AssertThrow(chemical_field_names.find("sediment_age") == std::string::npos, - ExcMessage("There is a field sediment_age that is of type chemical composition. " - "Please change it to type generic so that it does not affect material properties.")); + const std::vector::const_iterator + it = std::find(chemical_field_names.begin(), chemical_field_names.end(), "sediment_age"); + AssertThrow (it == chemical_field_names.end(), + ExcMessage("There is a field sediment_age that is of type chemical composition. " + "Please change it to type generic so that it does not affect material properties.")); } if (this->introspection().compositional_name_exists("deposition_depth")) - { - AssertThrow(chemical_field_names.find("deposition_depth") != std::string::npos, - ExcMessage("There is a field deposition_depth that is of type chemical composition. " - "Please change it to type generic so that it does not affect material properties.")); + { const std::vector::const_iterator + it = std::find(chemical_field_names.begin(), chemical_field_names.end(), "deposition_depth"); + AssertThrow (it == chemical_field_names.end(), + ExcMessage("There is a field deposition_depth that is of type chemical composition. " + "Please change it to type generic so that it does not affect material properties.")); } // Initialize parameters for restarting FastScape