From 712ecb7be4750776368ec51bed63eed272137afc Mon Sep 17 00:00:00 2001 From: hinder Date: Mon, 14 Jun 2010 06:12:17 +0000 Subject: Add testing code for making grid function harmonic coefficient proportional to radius git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/Multipole/trunk@58 4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843 --- param.ccl | 5 +++++ src/sphericalharmonic.cc | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/param.ccl b/param.ccl index 33485fc..5210831 100644 --- a/param.ccl +++ b/param.ccl @@ -94,6 +94,11 @@ CCTK_INT test_sw "which spin weight to put into the test variables" * :: "Any integer" } -2 +CCTK_BOOLEAN test_mode_proportional_to_r "whether the test spherical harmonic coefficient is proportional to the radial coordinate" +{ +} "no" + + # This parameter is deprecated and is no longer used KEYWORD mode_type "Which type of mode extraction do we have" STEERABLE=always { diff --git a/src/sphericalharmonic.cc b/src/sphericalharmonic.cc index 116613c..949d261 100644 --- a/src/sphericalharmonic.cc +++ b/src/sphericalharmonic.cc @@ -88,8 +88,16 @@ extern "C" void Multipole_SetHarmonic(CCTK_ARGUMENTS) CCTK_REAL theta = acos(z[index]/r[index]); CCTK_REAL phi = atan2(y[index],x[index]); + CCTK_REAL re = 0; + CCTK_REAL im = 0; + Multipole_SphericalHarmonic(test_sw,test_l,test_m,theta,phi, - &harmonic_re[index], &harmonic_im[index]); + &re, &im); + + CCTK_REAL fac = test_mode_proportional_to_r ? r[index] : 1.0; + + harmonic_re[index] = re * fac; + harmonic_im[index] = im * fac; } } } -- cgit v1.2.3