aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-16 14:15:48 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-16 14:15:48 +0000
commit3936e30b144fd1cb0d0463839d7d50521df93ac9 (patch)
tree9a17039c69f4d47dcabdf48afb674f70c69a4a48
parentdeecc38240c8aecb1f6b9ad22d7901b14c77f82e (diff)
* change from $Id: to $Header:
* change from local_coords::set_* to local_coords::coords_set_* to reduce risks of accidental name collisions * add integration_method__automatic_choice option to enum integration_method and to patch::decode_integration_method() and to patch::integration_coeff() git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@746 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r--src/patch/makefile2
-rw-r--r--src/patch/patch.cc23
-rw-r--r--src/patch/patch.hh13
3 files changed, 30 insertions, 8 deletions
diff --git a/src/patch/makefile b/src/patch/makefile
index c1b146e..2820a80 100644
--- a/src/patch/makefile
+++ b/src/patch/makefile
@@ -1,5 +1,5 @@
# Makefile for standalone test drivers in this directory
-# $Id: makefile,v 1.4 2002-07-08 13:54:54 jthorn Exp $
+# $Header: /usr/local/svn/cvs-repositories/numrelcvs/AEIThorns/AHFinderDirect/src/patch/makefile,v 1.5 2002-09-16 14:15:48 jthorn Exp $
#
# CC, CXX = C and C++ compilers. Defaults are gcc and g++ if
# variables aren't set from command line or environment.
diff --git a/src/patch/patch.cc b/src/patch/patch.cc
index e486016..4261bc7 100644
--- a/src/patch/patch.cc
+++ b/src/patch/patch.cc
@@ -123,8 +123,8 @@ z_patch::z_patch(patch_system &my_patch_system_in, int patch_number_in,
const grid::grid_pars& grid_pars_in)
: patch(my_patch_system_in, patch_number_in,
name_in, is_plus_in, 'z',
- local_coords::set_mu, local_coords::set_nu,
- local_coords::set_phi,
+ local_coords::coords_set_mu, local_coords::coords_set_nu,
+ local_coords::coords_set_phi,
grid_array_pars_in, grid_pars_in)
{ }
@@ -139,8 +139,8 @@ x_patch::x_patch(patch_system &my_patch_system_in, int patch_number_in,
const grid::grid_pars& grid_pars_in)
: patch(my_patch_system_in, patch_number_in,
name_in, is_plus_in, 'x',
- local_coords::set_nu, local_coords::set_phi,
- local_coords::set_mu,
+ local_coords::coords_set_nu, local_coords::coords_set_phi,
+ local_coords::coords_set_mu,
grid_array_pars_in, grid_pars_in)
{ }
@@ -155,8 +155,8 @@ y_patch::y_patch(patch_system &my_patch_system_in, int patch_number_in,
const grid::grid_pars& grid_pars_in)
: patch(my_patch_system_in, patch_number_in,
name_in, is_plus_in, 'y',
- local_coords::set_mu, local_coords::set_phi,
- local_coords::set_nu,
+ local_coords::coords_set_mu, local_coords::coords_set_phi,
+ local_coords::coords_set_nu,
grid_array_pars_in, grid_pars_in)
{ }
@@ -254,6 +254,8 @@ else if ( STRING_EQUAL(method_string, "Simpson")
else if ( STRING_EQUAL(method_string, "Simpson (variant)")
|| STRING_EQUAL(method_string, "Simpson's rule (variant)") )
then return integration_method__Simpson_variant;
+else if ( STRING_EQUAL(method_string, "automatic choice") )
+ then return integration_method__automatic_choice;
else error_exit(ERROR_EXIT,
"***** patch::decode_integration_method():\n"
" unknown method_string=\"%s\"!\n"
@@ -350,6 +352,15 @@ return delta_rho() * delta_sigma() * sum;
assert(i >= 0);
assert(i <= N);
+if (method == integration_method__automatic_choice)
+ then {
+ if (N >= 7)
+ then method = integration_method__Simpson_variant;
+ else if ((N % 2) == 0)
+ then method = integration_method__Simpson;
+ else method = integration_method__trapezoid;
+ }
+
switch (method)
{
case integration_method__trapezoid:
diff --git a/src/patch/patch.hh b/src/patch/patch.hh
index 95726b7..aa64e0d 100644
--- a/src/patch/patch.hh
+++ b/src/patch/patch.hh
@@ -343,7 +343,18 @@ public:
// + \frac{17}{48} f_N
// \right]
// $$
- integration_method__Simpson_variant // no comma here!
+ integration_method__Simpson_variant,
+
+ // automatic choice of the "best" one of the above methods:
+ // ... i.e. choose Simpson's rule or variant if applicable,
+ // otherwise trapezoid rule
+ // N == 2 Simpson's rule
+ // N == 3 trapezoid rule
+ // N == 4 Simpson's rule
+ // N == 5 trapezoid rule
+ // N == 6 Simpson's rule
+ // N >= 7 Simpson's rule, variant form
+ integration_method__automatic_choice // no comma here!
};
// decode character string name into internal enum