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