diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-04-01 17:35:34 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-04-01 17:35:34 -0500 |
commit | b512bea52fc9d5ee3b4eb87f85bb0a769b4c5ec4 (patch) | |
tree | 97e87951f52e3b81409d5df4d1c4463cf8fcd21a /Carpet/CarpetLib | |
parent | cc003c54a5beaa771061a777036d3a5b81cc573e (diff) |
CarpetLib: Improve error message when overly large bbox is created
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r-- | Carpet/CarpetLib/src/bbox.cc | 12 |
1 files changed, 11 insertions, 1 deletions
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 <cassert> #include <iostream> #include <limits> +#include <sstream> +#include <string> #include <typeinfo> #include "cctk.h" @@ -28,8 +30,16 @@ void bbox<T,D>::assert_bbox_limits () const any (_upper >= numeric_limits<T>::max() / 2) or any (_upper <= numeric_limits<T>::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()); } } |