aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/Carpet')
-rw-r--r--Carpet/Carpet/interface.ccl6
-rw-r--r--Carpet/Carpet/src/Comm.cc12
-rw-r--r--Carpet/Carpet/src/Recompose.cc20
-rw-r--r--Carpet/Carpet/src/Restrict.cc4
-rw-r--r--Carpet/Carpet/src/SetupGH.cc34
-rw-r--r--Carpet/Carpet/src/Storage.cc8
-rw-r--r--Carpet/Carpet/src/defines.hh12
-rw-r--r--Carpet/Carpet/src/functions.hh14
-rw-r--r--Carpet/Carpet/src/modes.cc9
-rw-r--r--Carpet/Carpet/src/variables.cc6
-rw-r--r--Carpet/Carpet/src/variables.hh14
11 files changed, 65 insertions, 74 deletions
diff --git a/Carpet/Carpet/interface.ccl b/Carpet/Carpet/interface.ccl
index 3f32a6bb0..414e43d0e 100644
--- a/Carpet/Carpet/interface.ccl
+++ b/Carpet/Carpet/interface.ccl
@@ -77,9 +77,9 @@ USES FUNCTION ConvertFromExteriorBoundary
# The true prototype of the routine below:
# int Carpet_Regrid (const cGH * cctkGH,
-# gh<dim>::rexts * bbsss,
-# gh<dim>::rbnds * obss,
-# gh<dim>::rprocs * pss);
+# gh::rexts * bbsss,
+# gh::rbnds * obss,
+# gh::rprocs * pss);
CCTK_INT FUNCTION Carpet_Regrid (CCTK_POINTER_TO_CONST IN cctkGH, \
CCTK_POINTER IN bbsss, \
CCTK_POINTER IN obss, \
diff --git a/Carpet/Carpet/src/Comm.cc b/Carpet/Carpet/src/Comm.cc
index c4319781a..93e17a01b 100644
--- a/Carpet/Carpet/src/Comm.cc
+++ b/Carpet/Carpet/src/Comm.cc
@@ -20,8 +20,8 @@ namespace Carpet {
const char *groupname );
static void ProlongateGroupBoundaries ( const cGH* cgh,
CCTK_REAL initial_time, int group );
- static void SyncGFGroup ( const cGH* cgh, comm_state<dim> &state, int group );
- static void SyncGFArrayGroup ( const cGH* cgh, comm_state<dim> &state, int group );
+ static void SyncGFGroup ( const cGH* cgh, comm_state &state, int group );
+ static void SyncGFArrayGroup ( const cGH* cgh, comm_state &state, int group );
int SyncGroup (const cGH* cgh, const char* groupname)
{
@@ -66,7 +66,7 @@ namespace Carpet {
}
// Sync
- for (comm_state<dim> state; !state.done(); state.step()) {
+ for (comm_state state; !state.done(); state.step()) {
switch (CCTK_GroupTypeI(group)) {
case CCTK_GF:
@@ -93,7 +93,7 @@ namespace Carpet {
const CCTK_REAL time = (cgh->cctk_time - initial_time) / delta_time;
const int tl = 0;
- for (comm_state<dim> state; !state.done(); state.step()) {
+ for (comm_state state; !state.done(); state.step()) {
for (int m=0; m<(int)arrdata.at(group).size(); ++m) {
for (int var=0; var<CCTK_NumVarsInGroupI(group); ++var) {
for (int c=0; c<vhh.at(m)->components(reflevel); ++c) {
@@ -105,7 +105,7 @@ namespace Carpet {
}
}
- void SyncGFGroup ( const cGH* cgh, comm_state<dim> &state, int group )
+ void SyncGFGroup ( const cGH* cgh, comm_state &state, int group )
{
const int tl = 0;
for (int m=0; m<(int)arrdata.at(group).size(); ++m) {
@@ -118,7 +118,7 @@ namespace Carpet {
}
}
- void SyncGFArrayGroup ( const cGH* cgh, comm_state<dim> &state, int group )
+ void SyncGFArrayGroup ( const cGH* cgh, comm_state &state, int group )
{
for (int var=0; var<(int)arrdata.at(group).at(0).data.size(); ++var) {
arrdata.at(group).at(0).data.at(var)->sync (state, 0, 0, 0, 0);
diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc
index bcb1ac378..8e4618c5a 100644
--- a/Carpet/Carpet/src/Recompose.cc
+++ b/Carpet/Carpet/src/Recompose.cc
@@ -65,9 +65,9 @@ namespace Carpet {
- void CheckRegions (const gh<dim>::rexts & bbsss,
- const gh<dim>::rbnds & obss,
- const gh<dim>::rprocs& pss)
+ void CheckRegions (const gh::rexts & bbsss,
+ const gh::rbnds & obss,
+ const gh::rprocs& pss)
{
// At least one level
if (bbsss.size() == 0) {
@@ -128,9 +128,9 @@ namespace Carpet {
bool did_change = false;
BEGIN_MAP_LOOP(cgh, CCTK_GF) {
- gh<dim>::rexts bbsss = vhh.at(map)->extents();
- gh<dim>::rbnds obss = vhh.at(map)->outer_boundaries();
- gh<dim>::rprocs pss = vhh.at(map)->processors();
+ gh::rexts bbsss = vhh.at(map)->extents();
+ gh::rbnds obss = vhh.at(map)->outer_boundaries();
+ gh::rprocs pss = vhh.at(map)->processors();
// Check whether to recompose
CCTK_INT const do_recompose
@@ -173,7 +173,7 @@ namespace Carpet {
- void OutputGrids (const cGH* cgh, const int m, const gh<dim>& hh)
+ void OutputGrids (const cGH* cgh, const int m, const gh& hh)
{
CCTK_INFO ("New grid structure (grid points):");
cout << " Refinement level " << reflevel << ", map " << map << endl;
@@ -230,9 +230,9 @@ namespace Carpet {
void OutputGridStructure (const cGH * const cgh,
const int m,
- const gh<dim>::rexts & bbsss,
- const gh<dim>::rbnds & obss,
- const gh<dim>::rprocs& pss)
+ const gh::rexts & bbsss,
+ const gh::rbnds & obss,
+ const gh::rprocs& pss)
{
DECLARE_CCTK_PARAMETERS;
diff --git a/Carpet/Carpet/src/Restrict.cc b/Carpet/Carpet/src/Restrict.cc
index b3186c1a6..95c473b2d 100644
--- a/Carpet/Carpet/src/Restrict.cc
+++ b/Carpet/Carpet/src/Restrict.cc
@@ -33,7 +33,7 @@ namespace Carpet {
// Restrict
if (reflevel < reflevels-1) {
- for (comm_state<dim> state; !state.done(); state.step()) {
+ for (comm_state state; !state.done(); state.step()) {
for (int group=0; group<CCTK_NumGroups(); ++group) {
if (CCTK_GroupTypeI(group) == CCTK_GF) {
if (CCTK_QueryGroupStorageI(cgh, group)) {
@@ -71,7 +71,7 @@ namespace Carpet {
// Sync
if (reflevel < reflevels-1) {
- for (comm_state<dim> state; !state.done(); state.step()) {
+ for (comm_state state; !state.done(); state.step()) {
for (int group=0; group<CCTK_NumGroups(); ++group) {
if (CCTK_GroupTypeI(group) == CCTK_GF) {
if (CCTK_QueryGroupStorageI(cgh, group)) {
diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc
index 7ca40d935..65c71745e 100644
--- a/Carpet/Carpet/src/SetupGH.cc
+++ b/Carpet/Carpet/src/SetupGH.cc
@@ -306,7 +306,7 @@ namespace Carpet {
CCTK_INT ghost_size_z);
static ivect make_global_number_of_grid_points (CCTK_INT global_nsize,
CCTK_INT global_nx, CCTK_INT global_ny, CCTK_INT global_nz);
- static void check_time_hierarchy (const vector<dh<dim>*> &vdd, int m,
+ static void check_time_hierarchy (const vector<dh*> &vdd, int m,
CCTK_INT max_refinement_levels,
CCTK_INT refinement_factor,
CCTK_INT prolongation_order_space,
@@ -340,7 +340,7 @@ namespace Carpet {
static void handle_group_tags_table (cGH* cgh, int group, cGroup &gp,
jvect &convpowers, jvect &convoffsets);
static void finish_initialisation (cGH* cgh);
- static void print_grid_structure (vector<gh<dim>*> & vhh, int m);
+ static void print_grid_structure (vector<gh*> & vhh, int m);
static void print_some_statistics (cGH* cgh);
static void enable_storage_for_all_groups (cGH* cgh);
static void leave_all_modes (cGH* cgh);
@@ -563,15 +563,15 @@ namespace Carpet {
const ibbox baseext (lb, ub, str);
// Allocate grid hierarchy
- vhh.at(m) = new gh<dim> (refinement_factor, vertex_centered,
- convergence_factor, vertex_centered, baseext);
+ vhh.at(m) = new gh (refinement_factor, vertex_centered,
+ convergence_factor, vertex_centered, baseext);
// Allocate data hierarchy
- vdd.at(m) = new dh<dim> (*vhh.at(m), lghosts, ughosts,
- prolongation_order_space, buffer_width);
+ vdd.at(m) = new dh (*vhh.at(m), lghosts, ughosts,
+ prolongation_order_space, buffer_width);
// Allocate time hierarchy
- vtt.at(m) = new th<dim> (*vhh.at(m), 1.0);
+ vtt.at(m) = new th (*vhh.at(m), 1.0);
check_time_hierarchy (vdd, m, max_refinement_levels, refinement_factor,
prolongation_order_space, lghosts, ughosts);
@@ -719,7 +719,7 @@ namespace Carpet {
}
}
- void check_time_hierarchy (const vector<dh<dim>*> &vdd, int m,
+ void check_time_hierarchy (const vector<dh*> &vdd, int m,
CCTK_INT max_refinement_levels,
CCTK_INT refinement_factor,
CCTK_INT prolongation_order_space,
@@ -743,8 +743,10 @@ namespace Carpet {
}
void read_explicit_grid_components (CCTK_STRING base_extents,
- CCTK_STRING base_outerbounds,
- vector<ibbox> & bbs, vector<bbvect> & obs) {
+ CCTK_STRING base_outerbounds,
+ vector<ibbox> & bbs,
+ vector<bbvect> & obs)
+ {
// TODO: invent something for the other convergence levels
istringstream ext_str (base_extents);
try {
@@ -766,7 +768,7 @@ namespace Carpet {
assert (obs.size() == bbs.size());
}
- void print_grid_structure (vector<gh<dim>*> & vhh, int m) {
+ void print_grid_structure (vector<gh*> & vhh, int m) {
const int rl = 0;
for (int c=0; c<vhh.at(m)->components(rl); ++c) {
for (int ml=0; ml<vhh.at(m)->mglevels(rl,c); ++ml) {
@@ -925,15 +927,15 @@ namespace Carpet {
const int amgfact1 = ipow(mgfact, convpowers[0]);
arrdata.at (group).at (0).hh
- = new gh<dim> (refinement_factor, vertex_centered,
- amgfact1, vertex_centered,
- abaseext);
+ = new gh (refinement_factor, vertex_centered,
+ amgfact1, vertex_centered,
+ abaseext);
arrdata.at (group).at (0).dd
- = new dh<dim> (*arrdata.at (group).at (0).hh, alghosts, aughosts, 0, 0);
+ = new dh (*arrdata.at (group).at (0).hh, alghosts, aughosts, 0, 0);
arrdata.at (group).at (0).tt
- = new th<dim> (*arrdata.at (group).at (0).hh, 1.0);
+ = new th (*arrdata.at (group).at (0).hh, 1.0);
diff --git a/Carpet/Carpet/src/Storage.cc b/Carpet/Carpet/src/Storage.cc
index 79f9d3f30..9a07dee7b 100644
--- a/Carpet/Carpet/src/Storage.cc
+++ b/Carpet/Carpet/src/Storage.cc
@@ -85,7 +85,7 @@ namespace Carpet {
for (int m=0; m<(int)arrdata.at(group).size(); ++m) {
for (int var=0; var<CCTK_NumVarsInGroupI(group); ++var) {
const int vectorindex = gp.vectorgroup ? var % vectorlength : 0;
- ggf<dim>* vectorleader
+ ggf* vectorleader
= (gp.vectorgroup && vectorindex>0
? arrdata.at(group).at(m).data.at(var - vectorindex)
: NULL);
@@ -93,11 +93,11 @@ namespace Carpet {
switch (CCTK_VarTypeI(n)) {
#define TYPECASE(N,T) \
case N: \
- arrdata.at(group).at(m).data.at(var) = new gf<T,dim> \
+ arrdata.at(group).at(m).data.at(var) = new gf<T> \
(n, groupdata.at(group).transport_operator, \
*arrdata.at(group).at(m).tt, *arrdata.at(group).at(m).dd, \
tmin, tmax, prolongation_order_time, \
- vectorlength, vectorindex, (gf<T,dim>*)vectorleader); \
+ vectorlength, vectorindex, (gf<T>*)vectorleader); \
break;
#include "typecase"
#undef TYPECASE
@@ -156,7 +156,7 @@ namespace Carpet {
#define TYPECASE(N,T) \
case N: \
assert (arrdata.at(group).at(m).data.at(var)); \
- delete (gf<T,dim>*)arrdata.at(group).at(m).data.at(var); \
+ delete (gf<T>*)arrdata.at(group).at(m).data.at(var); \
arrdata.at(group).at(m).data.at(var) = NULL; \
break;
#include "typecase"
diff --git a/Carpet/Carpet/src/defines.hh b/Carpet/Carpet/src/defines.hh
index f0d4a646b..878407b69 100644
--- a/Carpet/Carpet/src/defines.hh
+++ b/Carpet/Carpet/src/defines.hh
@@ -3,27 +3,17 @@
#include "cctk.h"
-#include <bbox.hh>
-#include <bboxset.hh>
-#include <vect.hh>
+#include <defs.hh>
namespace Carpet {
- const int dim = 3;
-
- typedef vect<bool,dim> bvect;
- typedef vect<int,dim> ivect;
typedef vect<CCTK_INT,dim> jvect;
typedef vect<CCTK_REAL,dim> rvect;
- typedef bbox<int,dim> ibbox;
typedef bbox<CCTK_INT,dim> jbbox;
typedef bbox<CCTK_REAL,dim> rbbox;
- typedef bboxset<int,dim> ibset;
- typedef vect<vect<bool,2>,dim> bbvect;
- typedef vect<vect<int,2>,dim> iivect;
typedef vect<vect<CCTK_INT,2>,dim> jjvect;
} // namespace Carpet
diff --git a/Carpet/Carpet/src/functions.hh b/Carpet/Carpet/src/functions.hh
index 4a92d0624..be95997c9 100644
--- a/Carpet/Carpet/src/functions.hh
+++ b/Carpet/Carpet/src/functions.hh
@@ -36,17 +36,17 @@ namespace Carpet {
// Helpers for recomposing the grid hierarchy
- void CheckRegions (const gh<dim>::rexts & bbsss,
- const gh<dim>::rbnds & obss,
- const gh<dim>::rprocs& pss);
+ void CheckRegions (const gh::rexts & bbsss,
+ const gh::rbnds & obss,
+ const gh::rprocs& pss);
- void OutputGrids (const cGH* cgh, const int m, const gh<dim>& hh);
+ void OutputGrids (const cGH* cgh, const int m, const gh& hh);
void OutputGridStructure (const cGH *cgh,
const int m,
- const gh<dim>::rexts & bbsss,
- const gh<dim>::rbnds & obss,
- const gh<dim>::rprocs& pss);
+ const gh::rexts & bbsss,
+ const gh::rbnds & obss,
+ const gh::rprocs& pss);
diff --git a/Carpet/Carpet/src/modes.cc b/Carpet/Carpet/src/modes.cc
index 91de2a58b..d489cf88b 100644
--- a/Carpet/Carpet/src/modes.cc
+++ b/Carpet/Carpet/src/modes.cc
@@ -134,9 +134,9 @@ namespace Carpet {
for (int var=0; var<numvars; ++var) {
assert (firstvar+var<CCTK_NumVars());
for (int tl=0; tl<num_tl; ++tl) {
- ggf<dim> * const ff = arrdata.at(group).at(m).data.at(var);
+ ggf * const ff = arrdata.at(group).at(m).data.at(var);
if (ff) {
- gdata<dim> * const data = (*ff) (-tl, rl, c, ml);
+ gdata * const data = (*ff) (-tl, rl, c, ml);
assert (data);
cgh->data[firstvar+var][tl] = data->storage();
} else {
@@ -414,10 +414,9 @@ namespace Carpet {
for (int var=0; var<numvars; ++var) {
assert (firstvar+var<CCTK_NumVars());
for (int tl=0; tl<num_tl; ++tl) {
- ggf<dim> * const ff = arrdata.at(group).at(map).data.at(var);
+ ggf * const ff = arrdata.at(group).at(map).data.at(var);
if (ff) {
- gdata<dim> * const data
- = (*ff) (-tl, reflevel, component, mglevel);
+ gdata * const data = (*ff) (-tl, reflevel, component, mglevel);
assert (data);
cgh->data[firstvar+var][tl] = data->storage();
} else {
diff --git a/Carpet/Carpet/src/variables.cc b/Carpet/Carpet/src/variables.cc
index fe3d10d4a..190878acb 100644
--- a/Carpet/Carpet/src/variables.cc
+++ b/Carpet/Carpet/src/variables.cc
@@ -82,9 +82,9 @@ namespace Carpet {
// Data for grid functions
// The grid hierarchy
- vector<gh<dim>*> vhh; // [map]
- vector<dh<dim>*> vdd; // [map]
- vector<th<dim>*> vtt; // [map]
+ vector<gh*> vhh; // [map]
+ vector<dh*> vdd; // [map]
+ vector<th*> vtt; // [map]
// Data for the groups
vector<groupdesc> groupdata; // [group]
diff --git a/Carpet/Carpet/src/variables.hh b/Carpet/Carpet/src/variables.hh
index cdf8567a2..ae5ade6df 100644
--- a/Carpet/Carpet/src/variables.hh
+++ b/Carpet/Carpet/src/variables.hh
@@ -108,9 +108,9 @@ namespace Carpet {
// Data for grid functions
// The grid hierarchy
- extern vector<gh<dim>*> vhh; // [map]
- extern vector<dh<dim>*> vdd; // [map]
- extern vector<th<dim>*> vtt; // [map]
+ extern vector<gh*> vhh; // [map]
+ extern vector<dh*> vdd; // [map]
+ extern vector<th*> vtt; // [map]
// Data for the groups
struct groupdesc {
@@ -122,10 +122,10 @@ namespace Carpet {
// Data for everything
struct arrdesc {
// points to hh etc. for GF, and is unique for SCALAR and ARRAY
- gh<dim>* hh;
- dh<dim>* dd;
- th<dim>* tt;
- vector<ggf<dim>*> data; // [var]
+ gh* hh;
+ dh* dd;
+ th* tt;
+ vector<ggf*> data; // [var]
};
extern vector<vector<arrdesc> > arrdata; // [group][map]