aboutsummaryrefslogtreecommitdiff
path: root/src/patch
diff options
context:
space:
mode:
Diffstat (limited to 'src/patch')
-rw-r--r--src/patch/patch_system.cc17
-rw-r--r--src/patch/patch_system.hh10
-rw-r--r--src/patch/test_patch_system.cc2
3 files changed, 16 insertions, 13 deletions
diff --git a/src/patch/patch_system.cc b/src/patch/patch_system.cc
index 1b3ee83..e6d729f 100644
--- a/src/patch/patch_system.cc
+++ b/src/patch/patch_system.cc
@@ -60,8 +60,6 @@
#include "cctk.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"
@@ -130,9 +128,9 @@ patch_system::patch_system(fp origin_x_in, fp origin_y_in, fp origin_z_in,
: global_coords_(origin_x_in, origin_y_in, origin_z_in),
type_(type_in),
N_patches_(N_patches_of_type(type_in)),
- all_patches_(N_patches_),
- starting_gpn_(N_patches_+1),
- ghosted_starting_gpn_(N_patches_+1),
+ all_patches_(new patch*[N_patches_]),
+ starting_gpn_(new int[N_patches_+1]),
+ ghosted_starting_gpn_(new int[N_patches_+1]),
gridfn_storage_(NULL), // set in setup_gridfn_storage()
ghosted_gridfn_storage_(NULL) // set in setup_gridfn_storage()
{
@@ -141,7 +139,7 @@ if (! jtutil::is_odd(patch_overlap_width))
"***** patch_system::patch_system(): implementation restriction:\n"
" patch_overlap_width=%d, but we only support odd values!\n"
,
- patch_overlap_width); /*NOTREACHED*/
+ patch_overlap_width); /*NOTREACHED*/
const int patch_extend_width = patch_overlap_width >> 1;
if (ghost_zone_width < fd_grid::molecule_radius())
@@ -280,8 +278,11 @@ default:
//
patch_system::~patch_system()
{
-delete ghosted_gridfn_storage_;
-delete gridfn_storage_;
+delete[] ghosted_gridfn_storage_;
+delete[] gridfn_storage_;
+delete[] ghosted_starting_gpn_;
+delete[] starting_gpn_;
+delete[] all_patches_;
for (int pn = N_patches()-1 ; pn >= 0 ; --pn)
{
diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh
index 24e61de..99bead8 100644
--- a/src/patch/patch_system.hh
+++ b/src/patch/patch_system.hh
@@ -559,13 +559,17 @@ private:
int N_grid_points_, ghosted_N_grid_points_;
// [pn] = --> individual patches
- vector<patch *> all_patches_;
+ // *** constructor initialization list ordering:
+ // *** this must be declared after N_patches_
+ 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_
- vector<int> starting_gpn_;
- vector<int> ghosted_starting_gpn_;
+ // *** constructor initialization list ordering:
+ // *** these must be declared after N_patches_
+ int* starting_gpn_;
+ 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_patch_system.cc b/src/patch/test_patch_system.cc
index 1aa0917..2f65378 100644
--- a/src/patch/test_patch_system.cc
+++ b/src/patch/test_patch_system.cc
@@ -35,8 +35,6 @@
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"