aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-29 16:18:19 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-29 16:18:19 +0000
commit96226e24b7f0856f2cd8f68e9c22adcd7d2946ad (patch)
tree0ff524fe7b3dd7732c455c424273be84082f0928 /src
parentf90849f3ccd99793b71eb19d9c8f9a8c5f628158 (diff)
- rename "config.hh" to "config.h" since it's now C++/C/Fortran
minor code tweaks for better portability (std:: namespace stuff) - switch all (new-style) #include <cstdio> style includes back to (old-style) #include <stdio.h> style - drop all using std::printf; declarations - change all uses of std::min and std::max to jtuti:: instead - drop all explicit std:: qualifiers git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@777 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r--src/driver/Newton.cc4
-rw-r--r--src/driver/driver.hh2
-rw-r--r--src/driver/find_horizons.cc4
-rw-r--r--src/driver/horizon_Jacobian.cc4
-rw-r--r--src/driver/initial_guess.cc4
-rw-r--r--src/driver/io.cc4
-rw-r--r--src/driver/setup.cc4
-rw-r--r--src/driver/state.cc4
-rw-r--r--src/elliptic/Jacobian.cc9
-rw-r--r--src/elliptic/gecon_wrapper.F772
-rw-r--r--src/gr/Schwarzschild_EF.cc4
-rw-r--r--src/gr/horizon_function.cc4
-rw-r--r--src/jtutil/cpm_map.cc1
-rw-r--r--src/jtutil/fuzzy.cc5
-rw-r--r--src/jtutil/linear_map.cc1
-rw-r--r--src/jtutil/miscfp.cc5
-rw-r--r--src/jtutil/norm.cc9
-rw-r--r--src/jtutil/test_array.cc1
-rw-r--r--src/jtutil/test_cpm_map.cc1
-rw-r--r--src/jtutil/test_fuzzy.cc1
-rw-r--r--src/jtutil/test_linear_map.cc1
-rw-r--r--src/jtutil/test_modulo.cc1
-rw-r--r--src/jtutil/test_norm.cc8
-rw-r--r--src/jtutil/test_round.cc1
-rw-r--r--src/jtutil/util.hh4
-rw-r--r--src/patch/coords.cc2
-rw-r--r--src/patch/fd_grid.cc2
-rw-r--r--src/patch/fd_grid.hh31
-rw-r--r--src/patch/ghost_zone.cc9
-rw-r--r--src/patch/grid.cc2
-rw-r--r--src/patch/patch.cc12
-rw-r--r--src/patch/patch_info.cc8
-rw-r--r--src/patch/patch_interp.cc2
-rw-r--r--src/patch/patch_system.cc32
-rw-r--r--src/patch/patch_system.hh6
-rw-r--r--src/patch/test_coords.cc2
-rw-r--r--src/patch/test_coords2.cc2
-rw-r--r--src/patch/test_patch_system.cc4
38 files changed, 107 insertions, 95 deletions
diff --git a/src/driver/Newton.cc b/src/driver/Newton.cc
index 7267088..5ad4267 100644
--- a/src/driver/Newton.cc
+++ b/src/driver/Newton.cc
@@ -7,14 +7,14 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/driver/driver.hh b/src/driver/driver.hh
index 195a7e5..554ce33 100644
--- a/src/driver/driver.hh
+++ b/src/driver/driver.hh
@@ -147,7 +147,7 @@ struct state
// this vector is of size N_horizons+1,
// and is indexed with a "horizon number" hn
// which is (hopefully) always in the range 1 <= hn <= N_horizons
- std::vector<AH_info *> AH_info_ptrs;
+ vector<AH_info *> AH_info_ptrs;
};
//******************************************************************************
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc
index 0739a3c..5776937 100644
--- a/src/driver/find_horizons.cc
+++ b/src/driver/find_horizons.cc
@@ -12,15 +12,15 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/driver/horizon_Jacobian.cc b/src/driver/horizon_Jacobian.cc
index c69e54b..09a6a4d 100644
--- a/src/driver/horizon_Jacobian.cc
+++ b/src/driver/horizon_Jacobian.cc
@@ -14,14 +14,14 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/driver/initial_guess.cc b/src/driver/initial_guess.cc
index 8acf679..2f55312 100644
--- a/src/driver/initial_guess.cc
+++ b/src/driver/initial_guess.cc
@@ -11,15 +11,15 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/driver/io.cc b/src/driver/io.cc
index 716d331..f1006b7 100644
--- a/src/driver/io.cc
+++ b/src/driver/io.cc
@@ -12,15 +12,15 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/driver/setup.cc b/src/driver/setup.cc
index 1c45794..cd9efd7 100644
--- a/src/driver/setup.cc
+++ b/src/driver/setup.cc
@@ -18,15 +18,15 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/driver/state.cc b/src/driver/state.cc
index 4c6c1b8..3d89a2e 100644
--- a/src/driver/state.cc
+++ b/src/driver/state.cc
@@ -4,15 +4,15 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/elliptic/Jacobian.cc b/src/elliptic/Jacobian.cc
index ee7e79c..2698c16 100644
--- a/src/elliptic/Jacobian.cc
+++ b/src/elliptic/Jacobian.cc
@@ -19,21 +19,16 @@
//
#include <stdio.h>
-using std::fopen;
-using std::printf;
-using std::fprintf;
-using std::fclose;
-using std::FILE;
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/elliptic/gecon_wrapper.F77 b/src/elliptic/gecon_wrapper.F77
index eda57aa..9c19785 100644
--- a/src/elliptic/gecon_wrapper.F77
+++ b/src/elliptic/gecon_wrapper.F77
@@ -12,7 +12,7 @@ c norm_int = (in) 0 ==> infinity-norm
c 1 ==> 1-norm
c
-#include "config.hh"
+#include "config.h"
#ifdef HAVE_DENSE_JACOBIAN
subroutine sgecon_wrapper(norm_int,
diff --git a/src/gr/Schwarzschild_EF.cc b/src/gr/Schwarzschild_EF.cc
index 9960bfc..ad7294d 100644
--- a/src/gr/Schwarzschild_EF.cc
+++ b/src/gr/Schwarzschild_EF.cc
@@ -13,14 +13,14 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/gr/horizon_function.cc b/src/gr/horizon_function.cc
index 679b120..3804be2 100644
--- a/src/gr/horizon_function.cc
+++ b/src/gr/horizon_function.cc
@@ -11,14 +11,14 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/jtutil/cpm_map.cc b/src/jtutil/cpm_map.cc
index db04d75..90a7dba 100644
--- a/src/jtutil/cpm_map.cc
+++ b/src/jtutil/cpm_map.cc
@@ -10,6 +10,7 @@
#include <assert.h>
#include <stdio.h>
+
#include "stdc.h"
#include "util.hh"
#include "cpm_map.hh"
diff --git a/src/jtutil/fuzzy.cc b/src/jtutil/fuzzy.cc
index e6b598d..581adfe 100644
--- a/src/jtutil/fuzzy.cc
+++ b/src/jtutil/fuzzy.cc
@@ -10,7 +10,6 @@
// ***** template instantiations *****
//
-#include <algorithm>
#include "stdc.h"
#include "util.hh"
@@ -21,8 +20,8 @@ namespace jtutil
template <typename fp>
bool fuzzy<fp>::EQ(fp x, fp y)
{
-fp max_abs = std::max(jtutil::abs(x), jtutil::abs(y));
-fp epsilon = std::max(tolerance, tolerance*max_abs);
+fp max_abs = jtutil::max(jtutil::abs(x), jtutil::abs(y));
+fp epsilon = jtutil::max(tolerance, tolerance*max_abs);
return jtutil::abs(x-y) <= epsilon;
}
diff --git a/src/jtutil/linear_map.cc b/src/jtutil/linear_map.cc
index 41a779e..ad4666b 100644
--- a/src/jtutil/linear_map.cc
+++ b/src/jtutil/linear_map.cc
@@ -12,6 +12,7 @@
#include <assert.h>
#include <stdio.h>
+
#include "stdc.h"
#include "util.hh"
#include "linear_map.hh"
diff --git a/src/jtutil/miscfp.cc b/src/jtutil/miscfp.cc
index 3d19276..fb59352 100644
--- a/src/jtutil/miscfp.cc
+++ b/src/jtutil/miscfp.cc
@@ -8,6 +8,7 @@
//
#include <math.h>
+
#include "stdc.h"
#include "util.hh"
@@ -50,7 +51,7 @@ namespace jtutil
{
double hypot3(double x, double y, double z)
{
-return std::sqrt(x*x + y*y + z*z);
+return sqrt(x*x + y*y + z*z);
}
} // namespace jtutil::
@@ -74,7 +75,7 @@ namespace jtutil
double arctan_xy(double x, double y)
{
// note reversed argument order (y,x) in std::atan2() function
-return ((x == 0.0) && (y == 0.0)) ? 0.0 : std::atan2(y,x);
+return ((x == 0.0) && (y == 0.0)) ? 0.0 : atan2(y,x);
}
} // namespace jtutil::
diff --git a/src/jtutil/norm.cc b/src/jtutil/norm.cc
index 1e6c1b5..bce9ee2 100644
--- a/src/jtutil/norm.cc
+++ b/src/jtutil/norm.cc
@@ -5,8 +5,7 @@
// *** class jtutil::norm::
//
-#include <cmath>
-#include <algorithm>
+#include <math.h>
#include <assert.h>
#include "util.hh"
@@ -22,7 +21,7 @@ template <typename fp>
++N_;
sum_ += x;
sum2_ += x*x;
-infinity_norm_ = std::max(infinity_norm_, jtutil::abs<fp>(x));
+infinity_norm_ = jtutil::max(infinity_norm_, jtutil::abs<fp>(x));
}
} // namespace jtutil::
@@ -34,10 +33,10 @@ namespace jtutil
template<typename fp>
fp norm<fp>::mean() const { return sum_/fp(N_); }
template<typename fp>
- fp norm<fp>::two_norm() const { return std::sqrt(sum2_); }
+ fp norm<fp>::two_norm() const { return sqrt(sum2_); }
template<typename fp>
fp norm<fp>::rms_norm() const
- { assert(is_nonempty()); return std::sqrt(sum2_/fp(N_)); }
+ { assert(is_nonempty()); return sqrt(sum2_/fp(N_)); }
template<typename fp>
fp norm<fp>::infinity_norm() const { return infinity_norm_; }
} // namespace jtutil::
diff --git a/src/jtutil/test_array.cc b/src/jtutil/test_array.cc
index cf13c6d..dfca98e 100644
--- a/src/jtutil/test_array.cc
+++ b/src/jtutil/test_array.cc
@@ -4,7 +4,6 @@
#include <assert.h>
#include <stdio.h>
#include <math.h>
-using std::printf;
#include "stdc.h"
#include "util.hh"
diff --git a/src/jtutil/test_cpm_map.cc b/src/jtutil/test_cpm_map.cc
index 8b5b182..070321a 100644
--- a/src/jtutil/test_cpm_map.cc
+++ b/src/jtutil/test_cpm_map.cc
@@ -3,6 +3,7 @@
#include <assert.h>
#include <stdio.h>
+
#include "stdc.h"
#include "util.hh"
#include "cpm_map.hh"
diff --git a/src/jtutil/test_fuzzy.cc b/src/jtutil/test_fuzzy.cc
index 3384d23..b68d9e5 100644
--- a/src/jtutil/test_fuzzy.cc
+++ b/src/jtutil/test_fuzzy.cc
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <assert.h>
+
#include "stdc.h"
#include "util.hh"
using jtutil::error_exit;
diff --git a/src/jtutil/test_linear_map.cc b/src/jtutil/test_linear_map.cc
index 1243cc6..0a185e7 100644
--- a/src/jtutil/test_linear_map.cc
+++ b/src/jtutil/test_linear_map.cc
@@ -3,6 +3,7 @@
#include <assert.h>
#include <stdio.h>
+
#include "stdc.h"
#include "util.hh"
#include "linear_map.hh"
diff --git a/src/jtutil/test_modulo.cc b/src/jtutil/test_modulo.cc
index 322ddd7..c587ea6 100644
--- a/src/jtutil/test_modulo.cc
+++ b/src/jtutil/test_modulo.cc
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <assert.h>
+
#include "stdc.h"
#include "util.hh"
using jtutil::error_exit;
diff --git a/src/jtutil/test_norm.cc b/src/jtutil/test_norm.cc
index 6f89030..b156873 100644
--- a/src/jtutil/test_norm.cc
+++ b/src/jtutil/test_norm.cc
@@ -1,11 +1,9 @@
// test_norm -- quick-n-dirty test of norm template class
// $Header$
-#include <cstdio>
-#include <cassert>
-#include <cmath>
-using std::printf;
-using std::sqrt;
+#include <stdio.h>
+#include <assert.h>
+#include <math.h>
#include "stdc.h"
#include "util.hh"
diff --git a/src/jtutil/test_round.cc b/src/jtutil/test_round.cc
index faf4942..e5a900f 100644
--- a/src/jtutil/test_round.cc
+++ b/src/jtutil/test_round.cc
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <assert.h>
+
#include "stdc.h"
#include "util.hh"
using jtutil::round;
diff --git a/src/jtutil/util.hh b/src/jtutil/util.hh
index fa46f70..bdc4f86 100644
--- a/src/jtutil/util.hh
+++ b/src/jtutil/util.hh
@@ -20,8 +20,8 @@ inline int is_odd (int i) { return (i & 0x1); }
//
// min/max/absolute value template
-// FIXME: <cmath> puts this in std::, but older g++ versions
-// (which don't fully implement namespaces) get confused
+// FIXME: <algorithm> is supposed to have min/max, but these are
+// broken on too many platforms (eg older gcc versions)
//
template <typename fp>
inline fp min(fp x, fp y) { return (x < y) ? x : y; }
diff --git a/src/patch/coords.cc b/src/patch/coords.cc
index cd1308c..a87469d 100644
--- a/src/patch/coords.cc
+++ b/src/patch/coords.cc
@@ -30,8 +30,8 @@
#include "cctk.h"
#endif
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
using jtutil::error_exit;
using jtutil::arctan_xy;
diff --git a/src/patch/fd_grid.cc b/src/patch/fd_grid.cc
index d2b4638..296a1c3 100644
--- a/src/patch/fd_grid.cc
+++ b/src/patch/fd_grid.cc
@@ -15,8 +15,8 @@
#include "cctk.h"
#endif
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/linear_map.hh"
diff --git a/src/patch/fd_grid.hh b/src/patch/fd_grid.hh
index 78ae6b6..b0d6307 100644
--- a/src/patch/fd_grid.hh
+++ b/src/patch/fd_grid.hh
@@ -370,6 +370,23 @@ class fd_grid
: public grid
{
//
+ // molecule sizes
+ //
+public:
+ // n.b. this interface implicitly assumes that all molecules
+ // are centered and are the same order and size
+ static
+ int finite_diff_order() { return FINITE_DIFF_ORDER; }
+ static
+ int molecule_radius() { return FD_GRID__MOL_RADIUS; }
+ static
+ int molecule_diameter() { return FD_GRID__MOL_DIAMETER; }
+ static
+ int molecule_min_m() { return -FD_GRID__MOL_RADIUS; }
+ static
+ int molecule_max_m() { return FD_GRID__MOL_RADIUS; }
+
+ //
// helper functions to compute (irho,isigma) + [m]
// along each axis
//
@@ -435,19 +452,11 @@ public:
rho_axis__isigma_plus_m);
}
+
//
- // ***** molecule orders, sizes, and coefficients *****
+ // ***** molecule coefficients *****
//
public:
-
- // n.b. this interface implicitly assumes that all molecules
- // are centered and are the same order and size
- int finite_diff_order() const { return FINITE_DIFF_ORDER; }
- int molecule_radius() const { return FD_GRID__MOL_RADIUS; }
- int molecule_diameter() const { return FD_GRID__MOL_DIAMETER; }
- int molecule_min_m() const { return -FD_GRID__MOL_RADIUS; }
- int molecule_max_m() const { return FD_GRID__MOL_RADIUS; }
-
// molecule coefficients
// n.b. this interface implicitly assumes that all molecules
// are position-independent
@@ -471,6 +480,7 @@ private:
static
fp dxx_coeff(int m);
+
//
// ***** constructor, destructor *****
//
@@ -483,6 +493,7 @@ public:
{ }
// compiler-generated default destructor is ok
+
private:
// we forbid copying and passing by value
// by declaring the copy constructor and assignment operator
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc
index 801132c..6f10b76 100644
--- a/src/patch/ghost_zone.cc
+++ b/src/patch/ghost_zone.cc
@@ -24,12 +24,11 @@
#include <stdlib.h>
#include <limits.h>
#include <math.h>
-#include <algorithm>
#include "cctk.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
@@ -426,8 +425,10 @@ return max_par_adjacent_ghost_zone().is_symmetry()
void interpatch_ghost_zone::finish_setup(int interp_handle,
int interp_par_table_handle)
{
-min_other_iperp_ = std::min(other_iperp(min_iperp()), other_iperp(max_iperp()));
-max_other_iperp_ = std::max(other_iperp(min_iperp()), other_iperp(max_iperp()));
+min_other_iperp_ = jtutil::min(other_iperp(min_iperp()),
+ other_iperp(max_iperp()));
+max_other_iperp_ = jtutil::max(other_iperp(min_iperp()),
+ other_iperp(max_iperp()));
//
diff --git a/src/patch/grid.cc b/src/patch/grid.cc
index 896ec46..e2a55e9 100644
--- a/src/patch/grid.cc
+++ b/src/patch/grid.cc
@@ -18,8 +18,8 @@
#include "cctk.h"
#endif
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/linear_map.hh"
diff --git a/src/patch/patch.cc b/src/patch/patch.cc
index 48b3a18..e843d03 100644
--- a/src/patch/patch.cc
+++ b/src/patch/patch.cc
@@ -25,19 +25,15 @@
// patch::assert_all_ghost_zones_fully_setup
//
-#include <cstdio>
-#include <cmath>
-#include <cstring>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
#include <assert.h>
-using std::fprintf;
-using std::printf;
-using std::strcmp;
-using std::sqrt;
#include "cctk.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/patch/patch_info.cc b/src/patch/patch_info.cc
index db49ba7..2f54a21 100644
--- a/src/patch/patch_info.cc
+++ b/src/patch/patch_info.cc
@@ -6,16 +6,14 @@
// patch_info::grid_pars
//
-#include <cstdio>
-#include <cmath>
+#include <stdio.h>
+#include <math.h>
#include <assert.h>
-using std::fprintf;
-using std::printf;
#include "cctk.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/patch/patch_interp.cc b/src/patch/patch_interp.cc
index dfc751b..a2f8f58 100644
--- a/src/patch/patch_interp.cc
+++ b/src/patch/patch_interp.cc
@@ -20,8 +20,8 @@
#include "util_Table.h"
#include "cctk.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
diff --git a/src/patch/patch_system.cc b/src/patch/patch_system.cc
index de0ec01..b80f865 100644
--- a/src/patch/patch_system.cc
+++ b/src/patch/patch_system.cc
@@ -41,19 +41,17 @@
/// patch_system::ghost_zone_Jacobian
//
-#include <cstdio>
-#include <cmath>
-#include <cstring>
-#include <vector>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include <vector.h>
#include <assert.h>
#include <limits.h>
-using std::printf;
-using std::fprintf;
#include "cctk.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"
@@ -125,6 +123,16 @@ if (! jtutil::is_odd(N_overlap_points))
N_overlap_points); /*NOTREACHED*/
const int N_extend_points = N_overlap_points >> 1;
+if (N_ghost_points < fd_grid::molecule_radius())
+ then error_exit(ERROR_EXIT,
+"***** patch_system::patch_system():\n"
+" must have N_ghost_points >= fd_grid::molecule_radius()\n"
+" but got N_ghost_points=%d fd_grid::molecule_radius()=%d!\n"
+" FINITE_DIFF_ORDER=%d (see #define in src/include/config.hh)\n"
+,
+ N_ghost_points, fd_grid::molecule_radius(),
+ FINITE_DIFF_ORDER); /*NOTREACHED*/
+
// construct/interlink the patches and ghost zones
switch (type_in)
{
@@ -1340,7 +1348,7 @@ if (want_ghost_zones && print_xyz_flag && !radius_is_ghosted_flag)
unknown_gfn,
unknown_radius_gfn); /*NOTREACHED*/
-FILE *output_fp = std::fopen(output_file_name, "w");
+FILE *output_fp = fopen(output_file_name, "w");
if (output_fp == NULL)
then error_exit(ERROR_EXIT,
"***** patch_system::print_unknown_gridfn(unknown_gfn=%d):\n"
@@ -1409,7 +1417,7 @@ fprintf(output_fp, "\n");
fprintf(output_fp, "\n");
}
-std::fclose(output_fp);
+fclose(output_fp);
}
//******************************************************************************
@@ -1433,7 +1441,7 @@ if (want_ghost_zones && !ghosted_flag)
,
unknown_gfn); /*NOTREACHED*/
-FILE *input_fp = std::fopen(input_file_name, "r");
+FILE *input_fp = fopen(input_file_name, "r");
if (input_fp == NULL)
then error_exit(ERROR_EXIT,
"***** patch_system::read_unknown_gridfn(unknown_gfn=%d):\n"
@@ -1465,7 +1473,7 @@ int line_number = 1;
// read/discard comments and blank lines
do
{
- if (std::fgets(buffer, N_buffer, input_fp) == NULL)
+ if (fgets(buffer, N_buffer, input_fp) == NULL)
then error_exit(ERROR_EXIT,
"***** patch::read_unknown_gridfn(%s patch, unknown_gfn=%d):\n"
" I/O error or unexpected end-of-file on input!\n"
@@ -1511,7 +1519,7 @@ int line_number = 1;
}
-std::fclose(input_fp);
+fclose(input_fp);
}
//******************************************************************************
diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh
index 2b2f1c9..6eb70d6 100644
--- a/src/patch/patch_system.hh
+++ b/src/patch/patch_system.hh
@@ -498,13 +498,13 @@ private:
int N_grid_points_, ghosted_N_grid_points_;
// [pn] = --> individual patches
- std::vector<patch *> all_patches_;
+ vector<patch *> all_patches_;
// [pn] = starting grid point number of individual patches
// ... arrays are actually of size N_patches_+1, the [N_patches_]
// entries are == N_grid_points_ and ghosted_N_grid_points_
- std::vector<int> starting_gpn_;
- std::vector<int> ghosted_starting_gpn_;
+ vector<int> starting_gpn_;
+ vector<int> ghosted_starting_gpn_;
// pointers to storage blocks for all gridfns
// ... patches point into these, but we own the storage blocks
diff --git a/src/patch/test_coords.cc b/src/patch/test_coords.cc
index 05e3628..eaf21cd 100644
--- a/src/patch/test_coords.cc
+++ b/src/patch/test_coords.cc
@@ -12,8 +12,8 @@
#include "cctk.h"
#endif
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
using jtutil::error_exit;
using jtutil::radians_of_degrees;
diff --git a/src/patch/test_coords2.cc b/src/patch/test_coords2.cc
index 762ad14..c063af5 100644
--- a/src/patch/test_coords2.cc
+++ b/src/patch/test_coords2.cc
@@ -12,8 +12,8 @@
#include "cctk.h"
#endif
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "coords.hh"
diff --git a/src/patch/test_patch_system.cc b/src/patch/test_patch_system.cc
index 0ff72fb..6056d1b 100644
--- a/src/patch/test_patch_system.cc
+++ b/src/patch/test_patch_system.cc
@@ -29,15 +29,15 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
-#include <vector>
+#include <vector.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "config.h"
#include "stdc.h"
-#include "config.hh"
#include "../jtutil/util.hh"
#include "../jtutil/array.hh"
#include "../jtutil/cpm_map.hh"