diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-01-27 10:49:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-01-27 10:49:00 +0000 |
commit | 25772bb7f8ff6f58df4d950ae98de7cb63a6f34a (patch) | |
tree | 02c365190f0b3a12a9c7f50c5964d98690c2bc38 /Carpet | |
parent | 72e97f68a3897e40bd075577e0d4d36ab3f12cfa (diff) |
CarpetLib: Instantiate vect and bbox for CCTK_REAL instead of double
darcs-hash:20050127104948-891bb-214d1033924b4db7a215a624eb337f8a619ac82d.gz
Diffstat (limited to 'Carpet')
-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; } |