From e7333cae3d038da237bac19ef65560d617fba58d Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Sun, 21 Jul 2024 17:57:38 -0700 Subject: [PATCH] Geometry: Fix operator>> (#4042) We cannot use Geometry::Domain in operator>> because it in turn calls Geometry::computeRoundoffDomain before prob_domain is set. --- Src/Base/AMReX_Geometry.H | 2 ++ Src/Base/AMReX_Geometry.cpp | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/Base/AMReX_Geometry.H b/Src/Base/AMReX_Geometry.H index 01759e1b502..729523330a4 100644 --- a/Src/Base/AMReX_Geometry.H +++ b/Src/Base/AMReX_Geometry.H @@ -440,6 +440,8 @@ private: // Box domain; + + friend std::istream& operator>> (std::istream&, Geometry&); }; diff --git a/Src/Base/AMReX_Geometry.cpp b/Src/Base/AMReX_Geometry.cpp index 2ec216ae109..4cc374d9c3d 100644 --- a/Src/Base/AMReX_Geometry.cpp +++ b/Src/Base/AMReX_Geometry.cpp @@ -26,11 +26,9 @@ std::istream& operator>> (std::istream& is, Geometry& g) { - Box bx; - RealBox rb; - is >> (CoordSys&) g >> rb >> bx; - g.Domain(bx); - g.ProbDomain(rb); + is >> (CoordSys&) g >> g.prob_domain >> g.domain; + + g.computeRoundoffDomain(); int ic = is.peek(); if (ic == static_cast('P')) {