aboutsummaryrefslogtreecommitdiff
path: root/src/patch/patch_system.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/patch/patch_system.cc')
-rw-r--r--src/patch/patch_system.cc32
1 files changed, 20 insertions, 12 deletions
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);
}
//******************************************************************************