diff options
-rw-r--r-- | Carpet/CarpetLib/src/bbox.cc | 4 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/vect.cc | 6 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/vect.hh | 10 |
3 files changed, 13 insertions, 7 deletions
diff --git a/Carpet/CarpetLib/src/bbox.cc b/Carpet/CarpetLib/src/bbox.cc index 4062674b6..26a203d9b 100644 --- a/Carpet/CarpetLib/src/bbox.cc +++ b/Carpet/CarpetLib/src/bbox.cc @@ -2,6 +2,8 @@ #include <iostream> #include <limits> +#include "cctk.h" + #include "defs.hh" #include "vect.hh" @@ -264,4 +266,4 @@ template class bbox<int,0>; template class bbox<int,1>; template class bbox<int,2>; template class bbox<int,3>; -template class bbox<double,3>; +template class bbox<CCTK_REAL,3>; diff --git a/Carpet/CarpetLib/src/vect.cc b/Carpet/CarpetLib/src/vect.cc index 3f3457f2b..4fe956172 100644 --- a/Carpet/CarpetLib/src/vect.cc +++ b/Carpet/CarpetLib/src/vect.cc @@ -1,6 +1,8 @@ #include <cassert> #include <iostream> +#include "cctk.h" + #include "defs.hh" #include "vect.hh" @@ -46,11 +48,11 @@ template class vect<int,1>; template class vect<int,2>; template class vect<int,3>; -template void vect<double,3>::input (istream& is); +template void vect<CCTK_REAL,3>::input (istream& is); template void vect<vect<bool,2>,3>::input (istream& is); template void vect<bool,2>::output (ostream& os) const; template void vect<bool,3>::output (ostream& os) const; -template void vect<double,3>::output (ostream& os) const; +template void vect<CCTK_REAL,3>::output (ostream& os) const; template void vect<vect<bool,2>,3>::output (ostream& os) const; template void vect<vect<int,2>,3>::output (ostream& os) const; diff --git a/Carpet/CarpetLib/src/vect.hh b/Carpet/CarpetLib/src/vect.hh index 761a8e9a9..c9209de9c 100644 --- a/Carpet/CarpetLib/src/vect.hh +++ b/Carpet/CarpetLib/src/vect.hh @@ -6,6 +6,8 @@ #include <cmath> #include <iostream> +#include "cctk.h" + using namespace std; @@ -786,14 +788,14 @@ vect (const T x, const T y, const T z, const T t) { -// Specialise for double +// Specialise for CCTK_REAL template<> -inline vect<double,3>& vect<double,3>::operator%=(const vect<double,3>& a) { +inline vect<CCTK_REAL,3>& vect<CCTK_REAL,3>::operator%=(const vect<CCTK_REAL,3>& a) { for (int d=0; d<3; ++d) { elt[d]=fmod(elt[d],a[d]); - if (elt[d]>a[d]*double(1.0-1.0e-10)) elt[d]=double(0); - if (elt[d]<a[d]*double( 1.0e-10)) elt[d]=double(0); + if (elt[d]>a[d]*(CCTK_REAL)(1.0-1.0e-10)) elt[d]=(CCTK_REAL)0; + if (elt[d]<a[d]*(CCTK_REAL)( 1.0e-10)) elt[d]=(CCTK_REAL)0; } return *this; } |