From 3137dc804cfbdd1b929e411deabd8014a6c27079 Mon Sep 17 00:00:00 2001 From: David Bold Date: Wed, 8 Jul 2026 13:31:41 +0200 Subject: [PATCH] Add non const g_22_ylow/yhigh --- include/bout/coordinates.hxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/bout/coordinates.hxx b/include/bout/coordinates.hxx index 2c33701762..8f0e9347de 100644 --- a/include/bout/coordinates.hxx +++ b/include/bout/coordinates.hxx @@ -106,8 +106,16 @@ public: /// get g_22 at the cell faces; const FieldMetric& g_22_ylow() const; const FieldMetric& g_22_yhigh() const; - FieldMetric& g_22_ylow(); - FieldMetric& g_22_yhigh(); + FieldMetric& g_22_ylow() { + const_cast(this)->g_22_ylow(); + ASSERT2(_g_22_ylow.has_value()); + return *_g_22_ylow; + } + FieldMetric& g_22_yhigh() { + const_cast(this)->g_22_yhigh(); + ASSERT2(_g_22_yhigh.has_value()); + return *_g_22_yhigh; + } // Cell Areas const FieldMetric& cell_area_xlow() const { if (_cell_area_xlow.has_value()) {