aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp2
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2008-08-03 22:05:31 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2008-08-03 22:11:36 -0500
commit377a3ccb4bb67137aea853801f4a881607577784 (patch)
treeb7c7f0684a8ad4bda66a1716123d7d7577ff4c64 /Carpet/CarpetInterp2
parentd2efacf027332e0fbb29c0dd556c838bded13245 (diff)
CarpetInterp2: Make code compile with PGI compilers
Rewrite the code slightly so that it compilers with the PGI C++ compiler.
Diffstat (limited to 'Carpet/CarpetInterp2')
-rw-r--r--Carpet/CarpetInterp2/src/fasterp.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/Carpet/CarpetInterp2/src/fasterp.cc b/Carpet/CarpetInterp2/src/fasterp.cc
index 86734c3a5..66c9e9fd1 100644
--- a/Carpet/CarpetInterp2/src/fasterp.cc
+++ b/Carpet/CarpetInterp2/src/fasterp.cc
@@ -39,17 +39,18 @@ namespace CarpetInterp2 {
template<> int get_poison () { return ipoison; }
template<> CCTK_REAL get_poison () { return poison; }
- template <typename T>
- void fill (vector<T> & v, T const & val)
- {
- fill (v.begin(), v.end(), val);
- }
+ // template <typename T>
+ // void fill (vector<T> & v, T const & val)
+ // {
+ // fill (v.begin(), v.end(), val);
+ // }
template <typename T>
void fill_with_poison (vector<T> & v)
{
#ifndef NDEBUG
- fill (v, get_poison<T>());
+ // fill (v, get_poison<T>());
+ fill (v.begin(), v.end(), get_poison<T>());
#endif
}
@@ -197,10 +198,13 @@ namespace CarpetInterp2 {
for (int d=0; d<dim; ++d) {
// C_n = PRODUCT_m,m!=n [(x - x_m) / (x_n - x_m)]
CCTK_REAL const x = offset[d];
- if (abs(x - round(x)) < eps) {
+ // round is not available with PGI compilers
+ // CCTK_REAL const rx = round(x);
+ CCTK_REAL const rx = floor(x+0.5);
+ if (abs(x - rx) < eps) {
// The interpolation point coincides with a grid point; no
// interpolation is necessary (this is a special case)
- iorigin[d] += int(round(x));
+ iorigin[d] += int(rx);
exact[d] = true;
} else {
for (int n=0; n<=order; ++n) {