diff --git a/dune/xt/functions/checkerboard.hh b/dune/xt/functions/checkerboard.hh index c0b9dd78f5ed9e377c6565a8d12832898ec345ef..b0d4adabc100cc2c62baed26c87baad1e202ee3e 100644 --- a/dune/xt/functions/checkerboard.hh +++ b/dune/xt/functions/checkerboard.hh @@ -425,7 +425,7 @@ public: } values.emplace_back(ExpressionFunctionType(variable, expression_vector)); } - } catch (const Common::Exceptions::conversion_error& e) { + } catch (const std::exception& e) { if (rangeDimCols == 1) { // get value as vector for (size_t ii = 0; ii < num_values; ++ii) { const auto values_vector = cfg.get<std::vector<std::string>>("values." + Common::to_string(ii), rangeDim); diff --git a/dune/xt/functions/expression.hh b/dune/xt/functions/expression.hh index e78d7b12bc109731028ecdeb75ff8ba093e0d065..205ed2a7723b43ed0e0c58642a38cc0064d80fab 100644 --- a/dune/xt/functions/expression.hh +++ b/dune/xt/functions/expression.hh @@ -90,7 +90,7 @@ public: // try to get expression as FieldVector (if dimRangeCols == 1) or as FieldMatrix (else) try { get_expression_helper(cfg, expression_as_vectors, internal::ChooseVariant<dimRangeCols>()); - } catch (Common::Exceptions::conversion_error) { + } catch (std::exception) { // if dimRangeCols == 1 and we could not get expression as FieldVector, get it as FieldMatrix with one col if (dimRangeCols == 1) { // the 2 in ChooseVariant is here on purpose, anything > 1 will suffice get_expression_helper(cfg, expression_as_vectors, internal::ChooseVariant<2>()); @@ -101,9 +101,7 @@ public: // get gradient GradientStringVectorType gradient_as_vectors; if (cfg.has_key("gradient")) { - if (cfg.has_key("gradient.0")) - assert((cfg.get<std::string>("gradient") == cfg.get<std::string>("gradient.0")) - && "gradient and gradient.0 differ but should be synonymous!"); + assert(dimRangeCols == 1 && "Use gradient.0, gradient.1, ... for the gradient of the first, second, ... row, respectively!"); get_gradient(cfg, gradient_as_vectors, "gradient"); } else if (cfg.has_key("gradient.0")) { get_gradient(cfg, gradient_as_vectors, "gradient.0"); @@ -486,7 +484,7 @@ public: // try to get expression as FieldVector (if dimRangeCols == 1) or as FieldMatrix (else) try { get_expression_helper(cfg, expression_as_vectors, internal::ChooseVariant<dimRangeCols>()); - } catch (Common::Exceptions::conversion_error) { + } catch (std::exception) { // if dimRangeCols == 1 and we could not get expression as FieldVector, get it as FieldMatrix with one col if (dimRangeCols == 1) { get_expression_helper(cfg, expression_as_vectors, internal::ChooseVariant<2>()); @@ -497,9 +495,7 @@ public: // get gradient GradientStringVectorType gradient_as_vectors; if (cfg.has_key("gradient")) { - if (cfg.has_key("gradient.0")) - assert((cfg.get<std::string>("gradient") == cfg.get<std::string>("gradient.0")) - && "gradient and gradient.0 differ but should be synonymous!"); + assert(dimRangeCols == 1 && "Use gradient.0, gradient.1, ... for the gradient of the first, second, ... row, respectively!"); get_gradient(cfg, gradient_as_vectors, "gradient"); } else if (cfg.has_key("gradient.0")) { get_gradient(cfg, gradient_as_vectors, "gradient.0");