From b512bea52fc9d5ee3b4eb87f85bb0a769b4c5ec4 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 1 Apr 2008 17:35:34 -0500 Subject: CarpetLib: Improve error message when overly large bbox is created --- Carpet/CarpetLib/src/bbox.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetLib') diff --git a/Carpet/CarpetLib/src/bbox.cc b/Carpet/CarpetLib/src/bbox.cc index 214f26a66..6183f17e5 100644 --- a/Carpet/CarpetLib/src/bbox.cc +++ b/Carpet/CarpetLib/src/bbox.cc @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include #include "cctk.h" @@ -28,8 +30,16 @@ void bbox::assert_bbox_limits () const any (_upper >= numeric_limits::max() / 2) or any (_upper <= numeric_limits::min() / 2)) { + ostringstream lbuf, ubuf, sbuf; + lbuf << _lower; + ubuf << _upper; + sbuf << _stride; + string const lstr = lbuf.str(); + string const ustr = ubuf.str(); + string const sstr = sbuf.str(); CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, - "Tried to create a very large bbox of type %s -- it is likely that this would lead to an integer overflow", + "Tried to create a very large bbox [%s,%s,%s] of type %s -- it is likely that this would lead to an integer overflow", + lstr.c_str(), ustr.c_str(), sstr.c_str(), typeid(*this).name()); } } -- cgit v1.2.3