aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-08-18 10:01:03 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-08-18 10:01:03 +0000
commit88ce8f204d96b41c7abd8f302c6aa2e1bd4ea7a9 (patch)
tree98b563a13fa8cbff16e9d3b14893717ceaffd2f2
parentb15e053d659533a3df651bdcf486ae14f5107639 (diff)
move lots and lots of code into C++ namespace AHFinderDirect
so it can't conflict with stuff in other thorns git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1184 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r--src/CODESTYLE4
-rw-r--r--src/README10
-rw-r--r--src/driver/BH_diagnostics.cc10
-rw-r--r--src/driver/BH_diagnostics.hh8
-rw-r--r--src/driver/Newton.cc8
-rw-r--r--src/driver/announce.cc8
-rw-r--r--src/driver/driver.hh8
-rw-r--r--src/driver/find_horizons.cc8
-rw-r--r--src/driver/horizon_sequence.cc8
-rw-r--r--src/driver/horizon_sequence.hh10
-rw-r--r--src/driver/initial_guess.cc8
-rw-r--r--src/driver/io.cc8
-rw-r--r--src/driver/mask.cc8
-rw-r--r--src/driver/misc-driver.cc8
-rw-r--r--src/driver/setup.cc8
-rw-r--r--src/driver/state.cc8
-rw-r--r--src/driver/test_horizon_sequence.cc2
-rw-r--r--src/elliptic/Jacobian.cc10
-rw-r--r--src/elliptic/Jacobian.hh7
-rw-r--r--src/elliptic/dense_Jacobian.cc20
-rw-r--r--src/elliptic/dense_Jacobian.hh11
-rw-r--r--src/elliptic/row_sparse_Jacobian.cc44
-rw-r--r--src/elliptic/row_sparse_Jacobian.hh13
-rw-r--r--src/gr/Schwarzschild_EF.cc8
-rw-r--r--src/gr/cg.hh13
-rw-r--r--src/gr/expansion.cc10
-rw-r--r--src/gr/expansion_Jacobian.cc8
-rw-r--r--src/gr/gfns.hh10
-rw-r--r--src/gr/gr.hh8
-rw-r--r--src/gr/misc-gr.cc8
-rw-r--r--src/jtutil/array.cc4
-rw-r--r--src/jtutil/array.hh4
-rw-r--r--src/jtutil/cpm_map.hh2
-rw-r--r--src/jtutil/linear_map.hh2
-rw-r--r--src/jtutil/test_array.cc2
-rw-r--r--src/jtutil/util.hh2
-rw-r--r--src/patch/coords.cc10
-rw-r--r--src/patch/coords.hh8
-rw-r--r--src/patch/fd_grid.cc8
-rw-r--r--src/patch/fd_grid.hh8
-rw-r--r--src/patch/ghost_zone.cc10
-rw-r--r--src/patch/ghost_zone.hh8
-rw-r--r--src/patch/grid.cc10
-rw-r--r--src/patch/grid.hh8
-rw-r--r--src/patch/patch.cc10
-rw-r--r--src/patch/patch.hh8
-rw-r--r--src/patch/patch_edge.hh8
-rw-r--r--src/patch/patch_info.cc10
-rw-r--r--src/patch/patch_info.hh8
-rw-r--r--src/patch/patch_interp.cc10
-rw-r--r--src/patch/patch_interp.hh8
-rw-r--r--src/patch/patch_system.cc10
-rw-r--r--src/patch/patch_system.hh8
-rw-r--r--src/patch/patch_system_info.hh10
-rw-r--r--src/patch/test_coords.cc1
-rw-r--r--src/patch/test_coords2.cc2
-rw-r--r--src/patch/test_patch_system.cc2
57 files changed, 436 insertions, 47 deletions
diff --git a/src/CODESTYLE b/src/CODESTYLE
index dbbc9c3..d0233eb 100644
--- a/src/CODESTYLE
+++ b/src/CODESTYLE
@@ -1,6 +1,6 @@
AHFinderDirect Code Style
=========================
-$Header: /usr/local/svn/cvs-repositories/numrelcvs/AEIThorns/AHFinderDirect/src/CODESTYLE,v 1.5 2003-07-27 14:02:53 jthorn Exp $
+$Header: /usr/local/svn/cvs-repositories/numrelcvs/AEIThorns/AHFinderDirect/src/CODESTYLE,v 1.6 2003-08-18 10:01:01 jthorn Exp $
This file documents some general programming conventions used in this
thorn.
@@ -245,5 +245,3 @@ Each .cc source file should begin with a "table of comments" block
comment listing all the functions defined in the file. Functions with
a "///" comment (or "**" for C) are local to the file; functions with
a "//" comment (or "*" for C) are visible to the linker.
-//
-//
diff --git a/src/README b/src/README
index 8899ce4..a78b7c1 100644
--- a/src/README
+++ b/src/README
@@ -41,3 +41,13 @@ jtutil/ contains various low-level utility routines for things
include/ contains common header files which don't live in any other
source directory; all compile-time options for this thorn
are configured here
+
+All the code in the directories
+ driver/
+ gr/
+ gr.cg/
+ elliptic/
+ patch/
+is in namespace AHFinderDirect. All the code in the directories
+ jtutil/
+is in namespace jtutil.
diff --git a/src/driver/BH_diagnostics.cc b/src/driver/BH_diagnostics.cc
index 733d2f3..33d6f2d 100644
--- a/src/driver/BH_diagnostics.cc
+++ b/src/driver/BH_diagnostics.cc
@@ -49,6 +49,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -439,3 +443,9 @@ fprintf(fileptr,
fflush(fileptr);
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/BH_diagnostics.hh b/src/driver/BH_diagnostics.hh
index 070a352..5e8dc37 100644
--- a/src/driver/BH_diagnostics.hh
+++ b/src/driver/BH_diagnostics.hh
@@ -6,6 +6,10 @@
// <stdio.h>
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -103,3 +107,7 @@ private:
BH_diagnostics(const BH_diagnostics& rhs);
BH_diagnostics& operator=(const BH_diagnostics& rhs);
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/Newton.cc b/src/driver/Newton.cc
index dd92984..0e82f10 100644
--- a/src/driver/Newton.cc
+++ b/src/driver/Newton.cc
@@ -46,6 +46,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -929,3 +933,7 @@ if (verbose_info.print_algorithm_details)
}
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/announce.cc b/src/driver/announce.cc
index 0ea0256..c5f3422 100644
--- a/src/driver/announce.cc
+++ b/src/driver/announce.cc
@@ -40,6 +40,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -102,3 +106,7 @@ if (CCTK_IsFunctionAliased("SetDriftCorrectPosition"))
SetDriftCorrectPosition(cctkGH, xx, yy, zz);
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/driver.hh b/src/driver/driver.hh
index 66015ed..91063d2 100644
--- a/src/driver/driver.hh
+++ b/src/driver/driver.hh
@@ -8,6 +8,10 @@
// "BH_diagnostics.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
// Cactus likes 3-element arrays for xyz axes
@@ -419,3 +423,7 @@ void output_Jacobians(const patch_system& ps,
// misc-driver.cc
int Cactus_gridfn_varindex(const char gridfn_name[]);
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc
index 5b55bfc..4f74ade 100644
--- a/src/driver/find_horizons.cc
+++ b/src/driver/find_horizons.cc
@@ -45,6 +45,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -383,3 +387,7 @@ if (active_flag)
hn, print_msg_flag);
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/horizon_sequence.cc b/src/driver/horizon_sequence.cc
index de5df24..e33c997 100644
--- a/src/driver/horizon_sequence.cc
+++ b/src/driver/horizon_sequence.cc
@@ -19,6 +19,10 @@
#include "horizon_sequence.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -122,3 +126,7 @@ bool horizon_sequence::is_hn_genuine(int hn)
return false;
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/horizon_sequence.hh b/src/driver/horizon_sequence.hh
index aea4e06..3627e92 100644
--- a/src/driver/horizon_sequence.hh
+++ b/src/driver/horizon_sequence.hh
@@ -1,6 +1,12 @@
// horizon_sequence.hh -- describes sequence of horizons a processor works on
// $Header$
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
+//******************************************************************************
+
//
// A horizon_sequence object describes the sequence of horizons a
// (the current) procesor works on. This is some sequence of genuine
@@ -123,3 +129,7 @@ private:
int* my_hn_; // --> new[]-allocated array of genuine horizon numbers
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/initial_guess.cc b/src/driver/initial_guess.cc
index 6eecd05..71eab86 100644
--- a/src/driver/initial_guess.cc
+++ b/src/driver/initial_guess.cc
@@ -45,6 +45,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -328,3 +332,7 @@ if (print_msg_flag)
}
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/io.cc b/src/driver/io.cc
index 5fb8807..6f7fd71 100644
--- a/src/driver/io.cc
+++ b/src/driver/io.cc
@@ -48,6 +48,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -461,3 +465,7 @@ if (AHF_iteration == 0)
return file_name_buffer;
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/mask.cc b/src/driver/mask.cc
index 2d00590..b556e1e 100644
--- a/src/driver/mask.cc
+++ b/src/driver/mask.cc
@@ -52,6 +52,10 @@ using jtutil::error_exit;
// define this to get extra debugging on the mask grid origin/delta etc
#undef DEBUG_MASK_GRID
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -684,3 +688,7 @@ if (verbose_info.print_algorithm_details)
inside_count, buffer_count);
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/misc-driver.cc b/src/driver/misc-driver.cc
index cc6f590..e3cc6b0 100644
--- a/src/driver/misc-driver.cc
+++ b/src/driver/misc-driver.cc
@@ -39,6 +39,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -59,3 +63,7 @@ if (varindex < 0)
return varindex;
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/setup.cc b/src/driver/setup.cc
index 1145060..027e68c 100644
--- a/src/driver/setup.cc
+++ b/src/driver/setup.cc
@@ -53,6 +53,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -772,3 +776,7 @@ else {
}
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/state.cc b/src/driver/state.cc
index b7e64ae..9d495be 100644
--- a/src/driver/state.cc
+++ b/src/driver/state.cc
@@ -36,6 +36,10 @@ using jtutil::error_exit;
#include "BH_diagnostics.hh"
#include "driver.hh"
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -43,3 +47,7 @@ using jtutil::error_exit;
// The top-level drivers all share it.
//
struct state state;
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/driver/test_horizon_sequence.cc b/src/driver/test_horizon_sequence.cc
index 32b1700..f540fd8 100644
--- a/src/driver/test_horizon_sequence.cc
+++ b/src/driver/test_horizon_sequence.cc
@@ -8,6 +8,8 @@
#include "../include/stdc.h"
#include "horizon_sequence.hh"
+using namespace AHFinderDirect;
+
// prototypes for functions local to this file
namespace {
void test0();
diff --git a/src/elliptic/Jacobian.cc b/src/elliptic/Jacobian.cc
index 8037d74..facd5cb 100644
--- a/src/elliptic/Jacobian.cc
+++ b/src/elliptic/Jacobian.cc
@@ -38,6 +38,10 @@ using jtutil::error_exit;
#include "dense_Jacobian.hh"
#include "row_sparse_Jacobian.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -129,3 +133,9 @@ switch (Jac_method)
int(Jac_method)); /*NOTREACHED*/
}
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/elliptic/Jacobian.hh b/src/elliptic/Jacobian.hh
index 15ead8e..0dcf14b 100644
--- a/src/elliptic/Jacobian.hh
+++ b/src/elliptic/Jacobian.hh
@@ -14,6 +14,10 @@
// "../patch/patch_system.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -231,4 +235,5 @@ Jacobian* new_Jacobian(enum Jacobian_store_solve_method Jac_method,
//******************************************************************************
-#endif // AHFINDERDIRECT__JACOBIAN_HH
+ } // namespace AHFinderDirect
+#endif /* AHFINDERDIRECT__JACOBIAN_HH */
diff --git a/src/elliptic/dense_Jacobian.cc b/src/elliptic/dense_Jacobian.cc
index e5cec64..6deaab1 100644
--- a/src/elliptic/dense_Jacobian.cc
+++ b/src/elliptic/dense_Jacobian.cc
@@ -45,6 +45,10 @@ using jtutil::error_exit;
#include "Jacobian.hh"
#include "dense_Jacobian.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -136,7 +140,7 @@ if (print_msg_flag)
" dense Jacobian matrix (%d rows)",
N_rows_);
}
-#endif // HAVE_DENSE_JACOBIAN
+#endif /* HAVE_DENSE_JACOBIAN */
//******************************************************************************
@@ -155,7 +159,7 @@ void dense_Jacobian::zero_matrix()
}
}
}
-#endif // HAVE_DENSE_JACOBIAN
+#endif /* HAVE_DENSE_JACOBIAN */
//******************************************************************************
//******************************************************************************
@@ -177,7 +181,7 @@ if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
" LAPACK linear-equations solver");
}
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
//******************************************************************************
@@ -191,7 +195,7 @@ delete[] rwork_;
delete[] iwork_;
delete[] pivot_;
}
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
//******************************************************************************
@@ -276,4 +280,10 @@ fp rcond;
return rcond;
}
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/elliptic/dense_Jacobian.hh b/src/elliptic/dense_Jacobian.hh
index b99cd84..6244629 100644
--- a/src/elliptic/dense_Jacobian.hh
+++ b/src/elliptic/dense_Jacobian.hh
@@ -18,6 +18,10 @@
// "Jacobian.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
#ifdef HAVE_DENSE_JACOBIAN
@@ -72,7 +76,7 @@ protected:
// Fortran storage order ==> subscripts are (JJ,II)
jtutil::array2d<fp> matrix_;
};
-#endif // HAVE_DENSE_JACOBIAN
+#endif /* HAVE_DENSE_JACOBIAN */
//******************************************************************************
@@ -110,8 +114,9 @@ private:
integer *iwork_; // size N_rows_
fp *rwork_; // size 4*N_rows_
};
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
//******************************************************************************
-#endif // AHFINDERDIRECT__DENSE_JACOBIAN_HH
+ } // namespace AHFinderDirect
+#endif /* AHFINDERDIRECT__DENSE_JACOBIAN_HH */
diff --git a/src/elliptic/row_sparse_Jacobian.cc b/src/elliptic/row_sparse_Jacobian.cc
index a53c3fb..bb20395 100644
--- a/src/elliptic/row_sparse_Jacobian.cc
+++ b/src/elliptic/row_sparse_Jacobian.cc
@@ -101,6 +101,10 @@ using jtutil::error_exit;
#include "Jacobian.hh"
#include "row_sparse_Jacobian.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -204,7 +208,7 @@ if (print_msg_flag)
zero_matrix();
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -218,7 +222,7 @@ delete[] A_;
delete[] JA_;
delete[] IA_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -232,7 +236,7 @@ fp row_sparse_Jacobian::element(int II, int JJ)
const int posn = find_element(II,JJ);
return (posn >= 0) ? A_[posn] : 0.0;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -250,7 +254,7 @@ N_nonzeros_ = 0;
current_N_rows_= 0;
IA_[0] = IO_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -265,7 +269,7 @@ if (posn >= 0)
then A_[posn] = value;
else insert_element(II,JJ, value);
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -280,7 +284,7 @@ if (posn >= 0)
then A_[posn] += value;
else insert_element(II,JJ, value);
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -306,7 +310,7 @@ const int stop = IA_[II+1] - IO_;
return -1; // not found
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -379,7 +383,7 @@ check_and_print_data_structure(true);
return posn;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -413,7 +417,7 @@ delete[] JA_;
JA_ = new_JA;
A_ = new_A;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -567,8 +571,8 @@ assert(N_nonzeros_ <= N_nonzeros_allocated_);
if (print_flag)
then printf("--- end Jacobian printout\n");
}
-#endif // DEBUG_ROW_SPARSE_JACOBIAN
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* DEBUG_ROW_SPARSE_JACOBIAN */
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
//******************************************************************************
@@ -590,7 +594,7 @@ if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
" ILUCG linear-equations solver");
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
@@ -603,7 +607,7 @@ row_sparse_Jacobian__ILUCG::~row_sparse_Jacobian__ILUCG()
delete[] rtemp_;
delete[] itemp_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
@@ -718,7 +722,7 @@ if (print_msg_flag)
return -1.0; // no condition number estimate available
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
//******************************************************************************
@@ -746,7 +750,7 @@ if (print_msg_flag)
umfpack_defaults(Control_);
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
//******************************************************************************
@@ -765,7 +769,7 @@ delete[] solve_workspace_integer_;
delete[] Info_;
delete[] Control_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
//******************************************************************************
@@ -907,4 +911,10 @@ if (Numeric_ != NULL)
return rcond;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/elliptic/row_sparse_Jacobian.hh b/src/elliptic/row_sparse_Jacobian.hh
index ebdda0e..2fc1640 100644
--- a/src/elliptic/row_sparse_Jacobian.hh
+++ b/src/elliptic/row_sparse_Jacobian.hh
@@ -52,6 +52,10 @@
#undef ROW_SPARSE_JACOBIAN__PRINT_AFTER_INSERT
#endif
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
#ifdef HAVE_ROW_SPARSE_JACOBIAN
@@ -221,7 +225,7 @@ protected:
// 0 <= posn < II[current_N_rows]
fp* A_; // ditto
};
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -257,7 +261,7 @@ private:
integer* itemp_;
fp* rtemp_;
};
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
@@ -313,8 +317,9 @@ private:
//
};
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
//******************************************************************************
-#endif // AHFINDERDIRECT__ROW_SPARSE_JACOBIAN_HH
+ } // namespace AHFinderDirect
+#endif /* AHFINDERDIRECT__ROW_SPARSE_JACOBIAN_HH */
diff --git a/src/gr/Schwarzschild_EF.cc b/src/gr/Schwarzschild_EF.cc
index 598dd94..63bc01f 100644
--- a/src/gr/Schwarzschild_EF.cc
+++ b/src/gr/Schwarzschild_EF.cc
@@ -40,6 +40,10 @@ using jtutil::error_exit;
#include "gfns.hh"
#include "gr.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -367,3 +371,7 @@ T_xz = (x*z/r2)*T_rr - (x*z/r4)*T_theta_theta;
T_yz = (y*z/r2)*T_rr - (y*z/r4)*T_theta_theta;
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/gr/cg.hh b/src/gr/cg.hh
index affd54b..50d1468 100644
--- a/src/gr/cg.hh
+++ b/src/gr/cg.hh
@@ -3,11 +3,14 @@
//
// This header file defines the "virtual machine" used by machine-generated
-// code. It is "dangerous" in that it #defines macros for all the gridfns,
-// which will break lots of other code. Thus this file should only be
-// #included just before #including machine-generated code, and this should
-// be as close as possible to the end of the source file (to minimize the
-// amount of other code affected by this file).
+// code. It is "dangerous" in that it #defines macros and local variables
+// for all the gridfns, which will break lots of other code. Thus this file
+// can only be #included within a function, and should only be #included
+// just before #including machine-generated code, and this should be as
+// close as possible to the end of the source file (to minimize the amount
+// of other code affected by this file).
+//
+// FIXME: we should have an "uncg.hh" header file to #undef all these macros
//
// prerequisites
// gfns.hh
diff --git a/src/gr/expansion.cc b/src/gr/expansion.cc
index c14b9f5..b9014d0 100644
--- a/src/gr/expansion.cc
+++ b/src/gr/expansion.cc
@@ -66,6 +66,10 @@ using jtutil::pow4;
#include "gfns.hh"
#include "gr.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -1283,3 +1287,9 @@ CCTK_VWarn(warn_level, __LINE__, __FILE__, CCTK_THORNSTRING,
return true; // *** NORMAL RETURN ***
}
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/gr/expansion_Jacobian.cc b/src/gr/expansion_Jacobian.cc
index d360076..41618b0 100644
--- a/src/gr/expansion_Jacobian.cc
+++ b/src/gr/expansion_Jacobian.cc
@@ -41,6 +41,10 @@ using jtutil::error_exit;
#include "../gr/gfns.hh"
#include "../gr/gr.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -590,3 +594,7 @@ if (active_flag)
return expansion_success; // *** NORMAL RETURN ***
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/gr/gfns.hh b/src/gr/gfns.hh
index d5186d0..d7a0afd 100644
--- a/src/gr/gfns.hh
+++ b/src/gr/gfns.hh
@@ -1,6 +1,12 @@
// gfns.hh -- define gfns of all gridfns
// $Header$
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
+//******************************************************************************
+
//
// For a skeletal patch system we only use the ghosted gridfns.
//
@@ -82,3 +88,7 @@ enum {
};
} // namespace gfns::
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/gr/gr.hh b/src/gr/gr.hh
index 88877ac..00f106c 100644
--- a/src/gr/gr.hh
+++ b/src/gr/gr.hh
@@ -1,6 +1,10 @@
// gr.hh -- header file for general relativity code
// $Header$
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -192,3 +196,7 @@ void Schwarzschild_EF_geometry(patch_system& ps,
enum Jacobian_compute_method
decode_Jacobian_compute_method(const char Jacobian_compute_method_string[]);
const char* expansion_status_string(enum expansion_status status);
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/gr/misc-gr.cc b/src/gr/misc-gr.cc
index cc9988f..eaaaf9a 100644
--- a/src/gr/misc-gr.cc
+++ b/src/gr/misc-gr.cc
@@ -34,6 +34,10 @@
#include "gfns.hh"
#include "gr.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -96,3 +100,7 @@ default:
status); /*NOTREACHED*/
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/jtutil/array.cc b/src/jtutil/array.cc
index 554d900..b6fbc99 100644
--- a/src/jtutil/array.cc
+++ b/src/jtutil/array.cc
@@ -293,7 +293,7 @@ if (we_own_array_)
}
}
} // namespace jtutil::
-#endif // NOT_USED
+#endif /* NOT_USED */
//******************************************************************************
@@ -310,7 +310,7 @@ if (we_own_array_)
then delete[] array_;
}
} // namespace jtutil::
-#endif // NOT_USED
+#endif /* NOT_USED */
//******************************************************************************
//******************************************************************************
diff --git a/src/jtutil/array.hh b/src/jtutil/array.hh
index 4c62b55..bf70628 100644
--- a/src/jtutil/array.hh
+++ b/src/jtutil/array.hh
@@ -470,8 +470,8 @@ private:
// false ==> array_ --> client-owned storage
};
} // namespace jtutil::
-#endif // NOT_USED
+#endif /* NOT_USED */
//******************************************************************************
-#endif // AHFINDERDIRECT__ARRAY_HH
+#endif /* AHFINDERDIRECT__ARRAY_HH */
diff --git a/src/jtutil/cpm_map.hh b/src/jtutil/cpm_map.hh
index 2ad291b..6b14ab3 100644
--- a/src/jtutil/cpm_map.hh
+++ b/src/jtutil/cpm_map.hh
@@ -136,4 +136,4 @@ private:
//******************************************************************************
-#endif // AHFINDERDIRECT__CPM_MAP_HH
+#endif /* AHFINDERDIRECT__CPM_MAP_HH */
diff --git a/src/jtutil/linear_map.hh b/src/jtutil/linear_map.hh
index f1ed3a1..48c0f2d 100644
--- a/src/jtutil/linear_map.hh
+++ b/src/jtutil/linear_map.hh
@@ -143,4 +143,4 @@ private:
//******************************************************************************
-#endif // AHFINDERDIRECT__LINEAR_MAP_HH
+#endif /* AHFINDERDIRECT__LINEAR_MAP_HH */
diff --git a/src/jtutil/test_array.cc b/src/jtutil/test_array.cc
index c7a421a..56c2a0c 100644
--- a/src/jtutil/test_array.cc
+++ b/src/jtutil/test_array.cc
@@ -625,4 +625,4 @@ if (fancy_storage)
return RMS_diff;
}
-#endif // NOT_USED
+#endif /* NOT_USED */
diff --git a/src/jtutil/util.hh b/src/jtutil/util.hh
index 4b5c281..35f1fcc 100644
--- a/src/jtutil/util.hh
+++ b/src/jtutil/util.hh
@@ -209,4 +209,4 @@ public:
} // namespace jtutil
-#endif // AHFINDERDIRECT__UTIL_HH
+#endif /* AHFINDERDIRECT__UTIL_HH */
diff --git a/src/patch/coords.cc b/src/patch/coords.cc
index 8bc48ef..9171b93 100644
--- a/src/patch/coords.cc
+++ b/src/patch/coords.cc
@@ -41,6 +41,10 @@ using jtutil::hypot3;
#include "coords.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -658,3 +662,9 @@ else error_exit(PANIC_EXIT,
,
int(S)); /*NOTREACHED*/
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/coords.hh b/src/patch/coords.hh
index 560d1d6..e6ca9bd 100644
--- a/src/patch/coords.hh
+++ b/src/patch/coords.hh
@@ -16,6 +16,10 @@
// "../jtutil/util.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -306,3 +310,7 @@ private:
// global (x,y,z) coordinates of local origin point
fp origin_x_, origin_y_, origin_z_;
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/fd_grid.cc b/src/patch/fd_grid.cc
index 3981e3c..48e490e 100644
--- a/src/patch/fd_grid.cc
+++ b/src/patch/fd_grid.cc
@@ -26,6 +26,10 @@ using jtutil::error_exit;
#include "grid.hh"
#include "fd_grid.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//
@@ -95,3 +99,7 @@ default:
m, FINITE_DIFF_ORDER, FD_GRID__MOL_RADIUS); /*NOTREACHED*/
}
}
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/fd_grid.hh b/src/patch/fd_grid.hh
index 6e0bf5f..c750a75 100644
--- a/src/patch/fd_grid.hh
+++ b/src/patch/fd_grid.hh
@@ -23,6 +23,10 @@
// "grid.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -503,3 +507,7 @@ private:
fd_grid(const fd_grid& rhs);
fd_grid& operator=(const fd_grid& rhs);
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc
index fc61220..985c1ca 100644
--- a/src/patch/ghost_zone.cc
+++ b/src/patch/ghost_zone.cc
@@ -44,6 +44,10 @@ using jtutil::error_exit;
#include "patch_interp.hh"
#include "ghost_zone.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -636,3 +640,9 @@ if (Jacobian_buffer_ == NULL)
Jacobian_min_y_ipar_m_, Jacobian_max_y_ipar_m_);
other_patch_interp_->Jacobian(*Jacobian_buffer_);
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/ghost_zone.hh b/src/patch/ghost_zone.hh
index ae98286..a35aa6f 100644
--- a/src/patch/ghost_zone.hh
+++ b/src/patch/ghost_zone.hh
@@ -26,6 +26,10 @@
// "patch_interp.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//
@@ -799,3 +803,7 @@ private:
// ... subscripts are (y_iperp, x_ipar, y_ipar_m)
mutable jtutil::array3d<fp>* Jacobian_buffer_;
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/grid.cc b/src/patch/grid.cc
index 7a32d47..ec29641 100644
--- a/src/patch/grid.cc
+++ b/src/patch/grid.cc
@@ -27,6 +27,10 @@
#include "coords.hh"
#include "grid.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
@@ -152,3 +156,9 @@ grid::grid(const grid_array_pars& grid_array_pars_in,
max_sigma_(jtutil::radians_of_degrees(grid_pars_in.max_dsigma))
// no comma
{ }
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/grid.hh b/src/patch/grid.hh
index d516bd7..3d4a811 100644
--- a/src/patch/grid.hh
+++ b/src/patch/grid.hh
@@ -19,6 +19,10 @@
// "coords.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//
@@ -796,3 +800,7 @@ private:
const fp min_rho_, max_rho_;
const fp min_sigma_, max_sigma_;
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch.cc b/src/patch/patch.cc
index bbe304e..37b61b2 100644
--- a/src/patch/patch.cc
+++ b/src/patch/patch.cc
@@ -53,6 +53,10 @@ using jtutil::error_exit;
#include "patch_interp.hh"
#include "ghost_zone.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -1013,3 +1017,9 @@ max_rho_ghost_zone().assert_fully_setup();
min_sigma_ghost_zone().assert_fully_setup();
max_sigma_ghost_zone().assert_fully_setup();
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch.hh b/src/patch/patch.hh
index 5002aa7..d18c53c 100644
--- a/src/patch/patch.hh
+++ b/src/patch/patch.hh
@@ -24,6 +24,10 @@
// "fd_grid.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
@@ -1055,3 +1059,7 @@ private:
y_patch(const y_patch& rhs);
y_patch& operator=(const y_patch& rhs);
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_edge.hh b/src/patch/patch_edge.hh
index fa49713..7ba45bb 100644
--- a/src/patch/patch_edge.hh
+++ b/src/patch/patch_edge.hh
@@ -18,6 +18,10 @@
// "patch.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//
@@ -276,3 +280,7 @@ private:
patch& my_patch_;
const bool is_min_, is_rho_;
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_info.cc b/src/patch/patch_info.cc
index 68e154e..c293cf6 100644
--- a/src/patch/patch_info.cc
+++ b/src/patch/patch_info.cc
@@ -25,6 +25,10 @@ using jtutil::error_exit;
#include "grid.hh"
#include "patch_info.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -189,3 +193,9 @@ if (! ( jtutil::fuzzy<fp>::is_integer(N_irho_zones_fp)
double(N_irho_zones_fp), double(N_isigma_zones_fp));
/*NOTREACHED*/
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_info.hh b/src/patch/patch_info.hh
index 9be845e..fd4eb9f 100644
--- a/src/patch/patch_info.hh
+++ b/src/patch/patch_info.hh
@@ -13,6 +13,10 @@
// "grid.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//
@@ -76,3 +80,7 @@ private:
void verify_grid_spacing_ok(int N_zones_per_right_angle)
const;
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_interp.cc b/src/patch/patch_interp.cc
index 6136a37..fcc90a7 100644
--- a/src/patch/patch_interp.cc
+++ b/src/patch/patch_interp.cc
@@ -36,6 +36,10 @@ using jtutil::error_exit;
#include "patch_interp.hh"
#include "ghost_zone.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
@@ -651,3 +655,9 @@ if (status < 0)
return status;
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_interp.hh b/src/patch/patch_interp.hh
index e252693..73e2d9d 100644
--- a/src/patch/patch_interp.hh
+++ b/src/patch/patch_interp.hh
@@ -20,6 +20,10 @@
// "patch.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//*****************************************************************************
//
@@ -317,3 +321,7 @@ private:
// ... index is (gfn)
mutable jtutil::array1d<void*> interp_data_buffer_ptrs_;
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_system.cc b/src/patch/patch_system.cc
index 5b1d02d..78c958f 100644
--- a/src/patch/patch_system.cc
+++ b/src/patch/patch_system.cc
@@ -78,6 +78,10 @@ using jtutil::error_exit;
#include "patch_system.hh"
#include "patch_system_info.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -2619,3 +2623,9 @@ max_ym = xgz.Jacobian_max_y_ipar_m();
return xgz.other_edge();
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh
index 070eb56..38e5ea3 100644
--- a/src/patch/patch_system.hh
+++ b/src/patch/patch_system.hh
@@ -25,6 +25,10 @@
// "patch_info.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -609,3 +613,7 @@ private:
// ... used only by radius_in_local_xyz_direction()
int surface_interp_handle_, surface_interp_par_table_handle_;
};
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/patch_system_info.hh b/src/patch/patch_system_info.hh
index 538555f..9d4fed7 100644
--- a/src/patch/patch_system_info.hh
+++ b/src/patch/patch_system_info.hh
@@ -14,6 +14,10 @@
// "patch_info.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -186,4 +190,8 @@ namespace plus_xyz_octant
};
} // namespace patch_system_info::octant_mirrored
-} // namespace patch_system_info::
+ } // namespace patch_system_info::
+
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/patch/test_coords.cc b/src/patch/test_coords.cc
index eaf21cd..0abe7d8 100644
--- a/src/patch/test_coords.cc
+++ b/src/patch/test_coords.cc
@@ -21,6 +21,7 @@ using jtutil::degrees_of_radians;
#include "coords.hh"
+using namespace AHFinderDirect;
using namespace local_coords;
//******************************************************************************
diff --git a/src/patch/test_coords2.cc b/src/patch/test_coords2.cc
index c063af5..bc53633 100644
--- a/src/patch/test_coords2.cc
+++ b/src/patch/test_coords2.cc
@@ -22,6 +22,8 @@ using jtutil::fuzzy;
using jtutil::error_exit;
using jtutil::radians_of_degrees;
using jtutil::degrees_of_radians;
+
+using namespace AHFinderDirect;
using namespace local_coords;
// prototypes
diff --git a/src/patch/test_patch_system.cc b/src/patch/test_patch_system.cc
index 3b3450b..64ff79e 100644
--- a/src/patch/test_patch_system.cc
+++ b/src/patch/test_patch_system.cc
@@ -52,6 +52,8 @@ using jtutil::error_exit;
#include "ghost_zone.hh"
#include "patch_system.hh"
+using namespace AHFinderDirect;
+
//******************************************************************************
//