aboutsummaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/Newton.cc2
-rw-r--r--src/driver/driver.hh7
-rw-r--r--src/driver/find_horizons.cc4
-rw-r--r--src/driver/initial_guess.cc3
-rw-r--r--src/driver/io.cc3
-rw-r--r--src/driver/setup.cc82
-rw-r--r--src/driver/state.cc2
7 files changed, 44 insertions, 59 deletions
diff --git a/src/driver/Newton.cc b/src/driver/Newton.cc
index f13a40e..1127c25 100644
--- a/src/driver/Newton.cc
+++ b/src/driver/Newton.cc
@@ -12,8 +12,6 @@
#include "cctk.h"
#include "cctk_Arguments.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"
diff --git a/src/driver/driver.hh b/src/driver/driver.hh
index 9cd0d1f..149fa0d 100644
--- a/src/driver/driver.hh
+++ b/src/driver/driver.hh
@@ -211,10 +211,9 @@ struct state
int N_horizons;
- // 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
- vector<AH_info *> AH_info_ptrs;
+ // --> array of size N_horizons+1,
+ // indexed with "horizon number" hn (should be in range [1,N_horizons]
+ AH_info* AH_info_array;
};
//******************************************************************************
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc
index c8afd32..b5db69d 100644
--- a/src/driver/find_horizons.cc
+++ b/src/driver/find_horizons.cc
@@ -26,8 +26,6 @@
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"
@@ -157,7 +155,7 @@ if (state.gi.geometry_method == geometry__local_interp_from_Cactus_grid)
for (int hn = 1 ; hn <= state.N_horizons ; ++hn)
{
- struct AH_info& AH_info = * state.AH_info_ptrs[hn];
+ struct AH_info& AH_info = state.AH_info_array[hn];
patch_system& ps = *AH_info.ps_ptr;
//
diff --git a/src/driver/initial_guess.cc b/src/driver/initial_guess.cc
index eafadaf..a58617b 100644
--- a/src/driver/initial_guess.cc
+++ b/src/driver/initial_guess.cc
@@ -12,14 +12,13 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
+#include <string.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"
diff --git a/src/driver/io.cc b/src/driver/io.cc
index a557257..cc6be75 100644
--- a/src/driver/io.cc
+++ b/src/driver/io.cc
@@ -16,14 +16,13 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
+#include <string.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"
diff --git a/src/driver/setup.cc b/src/driver/setup.cc
index 9a923ff..aabc9ae 100644
--- a/src/driver/setup.cc
+++ b/src/driver/setup.cc
@@ -16,14 +16,13 @@
#include <stdio.h>
#include <assert.h>
#include <math.h>
+#include <string.h>
#include "util_Table.h"
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"
@@ -273,24 +272,21 @@ if (interp_param_table_handle < 0)
"AHFinderDirect_setup(): bad interpatch-interpolator parameter(s) \"%s\"!",
interpatch_interpolator_pars); /*NOTREACHED*/
-const bool ps_type_from_Cactus_grid_sym
- = STRING_EQUAL(patch_system_type, "match Cactus grid symmetry");
-
-// we don't use the [0] array element
-state.AH_info_ptrs.push_back(NULL);
+// horizon numbers run from 1 to N_horizons; we don't use horizon number hn=0
+state.AH_info_array = new AH_info[N_horizons+1];
for (int hn = 1 ; hn <= N_horizons ; ++hn)
{
+ struct AH_info& AH_info = state.AH_info_array[hn];
+
if (verbose_info.print_algorithm_highlights)
then CCTK_VInfo(CCTK_THORNSTRING,
" setting up data structures for horizon %d/%d",
hn, int(N_horizons));
- struct AH_info* AH_ptr = new AH_info;
-
// decide what type of patch system this one should be
const enum patch_system::patch_system_type ps_type
- = ps_type_from_Cactus_grid_sym
+ = STRING_EQUAL(patch_system_type[hn], "match Cactus grid symmetry")
? // choose a patch system type based on grid:: parameters
// ... we inherit from grid, and we ask for some of its
// parameters in our param.ccl file; these appear as
@@ -303,7 +299,7 @@ state.AH_info_ptrs.push_back(NULL);
origin_x[hn],
origin_y[hn],
origin_z[hn])
- : patch_system::type_of_name(patch_system_type);
+ : patch_system::type_of_name(patch_system_type[hn]);
// create the patch system
patch_system& ps
@@ -316,14 +312,14 @@ state.AH_info_ptrs.push_back(NULL);
gfns::ghosted_min_gfn, gfns::ghosted_max_gfn,
interp_handle, interp_param_table_handle,
true, verbose_info.print_algorithm_details);
- AH_ptr->ps_ptr = &ps;
+ AH_info.ps_ptr = &ps;
ps.set_gridfn_to_constant(1.0, gfns::gfn__one);
// create the Jacobian matrix
if (verbose_info.print_algorithm_details)
then CCTK_VInfo(CCTK_THORNSTRING,
" constructing Jacobian matrix");
- AH_ptr->Jac_ptr = (state.method == method__evaluate_expansion)
+ AH_info.Jac_ptr = (state.method == method__evaluate_expansion)
? NULL // no Jacobian used for this case
: &new_Jacobian(ps, Jac_info.Jacobian_storage_method);
@@ -332,69 +328,67 @@ state.AH_info_ptrs.push_back(NULL);
" setting initial guess parameters etc");
// store the initial guess parameters
- AH_ptr->initial_guess_info.method
- = decode_initial_guess_method(initial_guess_method);
+ AH_info.initial_guess_info.method
+ = decode_initial_guess_method(initial_guess_method[hn]);
// ... Kerr/Kerr
- AH_ptr->initial_guess_info.Kerr_Kerr_info.x_posn
+ AH_info.initial_guess_info.Kerr_Kerr_info.x_posn
= initial_guess__Kerr_Kerr__x_posn[hn];
- AH_ptr->initial_guess_info.Kerr_Kerr_info.y_posn
+ AH_info.initial_guess_info.Kerr_Kerr_info.y_posn
= initial_guess__Kerr_Kerr__y_posn[hn];
- AH_ptr->initial_guess_info.Kerr_Kerr_info.z_posn
+ AH_info.initial_guess_info.Kerr_Kerr_info.z_posn
= initial_guess__Kerr_Kerr__z_posn[hn];
- AH_ptr->initial_guess_info.Kerr_Kerr_info.mass
+ AH_info.initial_guess_info.Kerr_Kerr_info.mass
= initial_guess__Kerr_Kerr__mass[hn];
- AH_ptr->initial_guess_info.Kerr_Kerr_info.spin
+ AH_info.initial_guess_info.Kerr_Kerr_info.spin
= initial_guess__Kerr_Kerr__spin[hn];
// ... Kerr/Kerr-Schild
- AH_ptr->initial_guess_info.Kerr_KerrSchild_info.x_posn
+ AH_info.initial_guess_info.Kerr_KerrSchild_info.x_posn
= initial_guess__Kerr_KerrSchild__x_posn[hn];
- AH_ptr->initial_guess_info.Kerr_KerrSchild_info.y_posn
+ AH_info.initial_guess_info.Kerr_KerrSchild_info.y_posn
= initial_guess__Kerr_KerrSchild__y_posn[hn];
- AH_ptr->initial_guess_info.Kerr_KerrSchild_info.z_posn
+ AH_info.initial_guess_info.Kerr_KerrSchild_info.z_posn
= initial_guess__Kerr_KerrSchild__z_posn[hn];
- AH_ptr->initial_guess_info.Kerr_KerrSchild_info.mass
+ AH_info.initial_guess_info.Kerr_KerrSchild_info.mass
= initial_guess__Kerr_KerrSchild__mass[hn];
- AH_ptr->initial_guess_info.Kerr_KerrSchild_info.spin
+ AH_info.initial_guess_info.Kerr_KerrSchild_info.spin
= initial_guess__Kerr_KerrSchild__spin[hn];
// ... coordinate sphere
- AH_ptr->initial_guess_info.coord_sphere_info.x_center
+ AH_info.initial_guess_info.coord_sphere_info.x_center
= initial_guess__coord_sphere__x_center[hn];
- AH_ptr->initial_guess_info.coord_sphere_info.y_center
+ AH_info.initial_guess_info.coord_sphere_info.y_center
= initial_guess__coord_sphere__y_center[hn];
- AH_ptr->initial_guess_info.coord_sphere_info.z_center
+ AH_info.initial_guess_info.coord_sphere_info.z_center
= initial_guess__coord_sphere__z_center[hn];
- AH_ptr->initial_guess_info.coord_sphere_info.radius
+ AH_info.initial_guess_info.coord_sphere_info.radius
= initial_guess__coord_sphere__radius[hn];
// ... coordinate ellipsoid
- AH_ptr->initial_guess_info.coord_ellipsoid_info.x_center
+ AH_info.initial_guess_info.coord_ellipsoid_info.x_center
= initial_guess__coord_ellipsoid__x_center[hn];
- AH_ptr->initial_guess_info.coord_ellipsoid_info.y_center
+ AH_info.initial_guess_info.coord_ellipsoid_info.y_center
= initial_guess__coord_ellipsoid__y_center[hn];
- AH_ptr->initial_guess_info.coord_ellipsoid_info.z_center
+ AH_info.initial_guess_info.coord_ellipsoid_info.z_center
= initial_guess__coord_ellipsoid__z_center[hn];
- AH_ptr->initial_guess_info.coord_ellipsoid_info.x_radius
+ AH_info.initial_guess_info.coord_ellipsoid_info.x_radius
= initial_guess__coord_ellipsoid__x_radius[hn];
- AH_ptr->initial_guess_info.coord_ellipsoid_info.y_radius
+ AH_info.initial_guess_info.coord_ellipsoid_info.y_radius
= initial_guess__coord_ellipsoid__y_radius[hn];
- AH_ptr->initial_guess_info.coord_ellipsoid_info.z_radius
+ AH_info.initial_guess_info.coord_ellipsoid_info.z_radius
= initial_guess__coord_ellipsoid__z_radius[hn];
// initialize the BH diagnostics
- AH_ptr->AH_found = false;
- AH_ptr->BH_diagnostics.centroid_x = 0.0;
- AH_ptr->BH_diagnostics.centroid_y = 0.0;
- AH_ptr->BH_diagnostics.centroid_z = 0.0;
- AH_ptr->BH_diagnostics.area = 0.0;
- AH_ptr->BH_diagnostics.m_irreducible = 0.0;
+ AH_info.AH_found = false;
+ AH_info.BH_diagnostics.centroid_x = 0.0;
+ AH_info.BH_diagnostics.centroid_y = 0.0;
+ AH_info.BH_diagnostics.centroid_z = 0.0;
+ AH_info.BH_diagnostics.area = 0.0;
+ AH_info.BH_diagnostics.m_irreducible = 0.0;
// set up the BH-diagnostics output files?
- AH_ptr->BH_diagnostics_fileptr
+ AH_info.BH_diagnostics_fileptr
= ( output_BH_diagnostics
&& (state.method == method__find_horizon) )
? setup_BH_diagnostics_output_file(IO_info, hn, N_horizons)
: NULL;
-
- state.AH_info_ptrs.push_back(AH_ptr);
}
}
diff --git a/src/driver/state.cc b/src/driver/state.cc
index 20b5e0c..77dc1f2 100644
--- a/src/driver/state.cc
+++ b/src/driver/state.cc
@@ -10,8 +10,6 @@
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-#include "stl_vector.hh"
-
#include "config.h"
#include "stdc.h"
#include "../jtutil/util.hh"