SphericalHarmonicDecomp

Yosef Zlochower <yosef@astro.rit.edu>

November 12 2008

Abstract

This thorns provides a mechanism to decompose grid functions in terms of Spin Weighted spherical harmonics of arbitrary spin. This thorn will also decompose the ADM metric on spherical shells for use in a subsequent CCE null evolution.

1 Introduction

The idea behind this thorn was to decompose GFs on 2D spheres and 3D spherical shells in terms of spin-weighted spherical harmonics and Chebyshev or Legendre polynomials in radius. This was used for waveform extraction, compression of 3D data for visualization and CCE. The code uses more “collocation” points than spectral functions. The idea here was to try to smooth the data by using a least-squares fit to obtain the spectral coefficients. This thorn provides aliased functions to perform the decomposition. This will also dump the Cauchy metric.

2 Physical System

3 Numerical Implementation

4 Using This Thorn

4.1 Dumping Cauchy Data for CCE

The following is a section of a parfile appended to an ordinary Cauchy evolution run (see the par/ directory for the complete parfile)

ActiveThorns="SphericalHarmonicDecomp"  
 
SphericalHarmonicDecomp::extract_spacetime_metric_every=32  
SphericalHarmonicDecomp::num_radii=3  
SphericalHarmonicDecomp::EM_Rin[0]=18  
SphericalHarmonicDecomp::EM_Rout[0]=22  
SphericalHarmonicDecomp::EM_Rin[1]=47  
SphericalHarmonicDecomp::EM_Rout[1]=53  
SphericalHarmonicDecomp::EM_Rin[2]=94  
SphericalHarmonicDecomp::EM_Rout[2]=106  
SphericalHarmonicDecomp::num_l_modes=7  
SphericalHarmonicDecomp::num_n_modes=7  
SphericalHarmonicDecomp::num_mu_points=41  
SphericalHarmonicDecomp::num_phi_points=82  
SphericalHarmonicDecomp::num_x_points=28  

In this example we will extract the metric on 3 different shells (num_radii), the first between r=18 and r=22, the second between r=47 and r=53, and the third between r=94 and 106. The idea here is to make the shell small enough that we can accurately calculate the radial derivatives of the metric function, while also large enough that we can smooth out the grid noise. We decompose the metric functions in terms of 7 modes (num_l_modes=7 or all modes from = 0 to = 6, the m modes are automatically set) and 7 radial modes (num_n_mode=7). The grid functions are evaluated at 41 points in mu (mu=cos(theta)), 82 points in phi, and 28 points in radius. Minimally, we would need the number of angular points to be equal to the number of angular spectral functions 2 + 2, in this case we have many more angular modes (41 82) than angular spectral functions. Similarly num_x_points must be greater than num_n_modes. The number of n modes is set by the need to accurately model the radial derivative of the mertric functions in the spherical shell. The larger the difference between EM_Rin[] and EM_Rout[] the more points required. The number of l modes is determined by the accuracy requiremnts of the final CCE waveoform. in this case, choosin num_n_modes=7 is marginally acceptable.

Note that the parameters

SphericalHarmonicDecomp::Rin  
SphericalHarmonicDecomp::Rout

are not used for CCE metric extraction. These parameters affect the 3D decomposition of GFs using the

SphericalHarmonicDecomp_3D_Decompose aliased function mechanism

4.2 Aliased functions

SphericalHarmonicDecomp provides a mechanism for other thorns to decompose GFs either on 2D surfaces or 3D shells via aliased functions. These two functions should be called in GLOBAL mode.

CCTK_INT  SphericalHarmonicDecomp_3D_Decompose (  
       CCTK_POINTER_TO_CONST _GHp,  
       CCTK_POINTER_TO_CONST _name,  
       CCTK_INT re_gindx,  
       CCTK_INT im_gindx,  
       CCTK_INT spin )  
 
e.g.  
 
  SphericalHarmonicDecomp_3D_Decompose(cctkGH, "Psi4",  
       CCTK_VarIndex("WeylScal4::Psi4r"),  
       CCTK_VarIndex("WeylScal4::Psi4i"), -2);  
 
CCTK_INT FUNCTION sYlm_DecomposeField(\  
               CCTK_POINTER_TO_CONST IN cctkGH,\  
               CCTK_POINTER_TO_CONST IN name,\  
               CCTK_INT IN re_gindx,\  
               CCTK_INT IN im_gindx,\  
               CCTK_REAL IN radius,\  
               CCTK_INT IN spin)  
 
e.g.  
 
  SphericalHarmonicDecomp_DecomposeField(cctkGH, "Psi4",  
       CCTK_VarIndex("WeylScal4::Psi4r"),  
       CCTK_VarIndex("WeylScal4::Psi4i"), 50, -2);  

4.3 Parameters

SphericalHarmonicDecomp::extract_spacetime_metric_every how often  
               (in iterations) should the metric be decomposed and dumped.  
 
SphericalHarmonicDecomp::out_dir=""  Output directory for all output,  
                                usually set to "", which causes the  
                                thorn to use IO::out_dir  
 
SphericalHarmonicDecomp::max_spin=2  Largest spin value. For most configuration  
                             this should be set to 2.  
 
SphericalHarmonicDecomp::num_l_modes How many l modes. This affects all  
                           output. Note this is not lmax-1 in general.  
                           For spin-weight 2 GF, lmax will be num_l_modes+2-1  
 
SphericalHarmonicDecomp::num_mu_points number of points in the mu (cos(theta))  
                           direction. Affects all output.  
 
SphericalHarmonicDecomp::num_phi_points number of points in phi direction.  
                                Affects all output.  
 
SphericalHarmonicDecomp::num_x_points number of points in x (radial) direction.  
                       Affects all 3D output including MetricDecomp  
 
SphericalHarmonicDecomp::Rin inner radius of 3D shell. Only affects fields  
                      dumped using aliased function mechanism  
 
SphericalHarmonicDecomp::Rout outer radius of 3D shell. Only affects fields  
                      dumped using aliased function mechanism  
 
SphericalHarmonicDecomp::EM_Rin an array of Rins used for the CCE Metric  
                             extraction  
 
SphericalHarmonicDecomp::EM_Rout an array of Routs used for the CCE Metric  
                             extraction  
 
SphericalHarmonicDecomp::output_m_max limit on the maximum abs(m) dumped to  
                output. These options are useful if you don’t want to  
                dump all the m modes from -l to l.  
 
SphericalHarmonicDecomp::output_l_max limit on the maximum l dumped to  
                output. This option is useful if you want the maximum  
                l dumped to output to be independent of the spin of the  
                GF.

4.4 Obtaining This Thorn

4.5 Basic Usage

4.6 Special Behaviour

4.7 Interaction With Other Thorns

4.8 Examples

4.9 Support and Feedback

5 History

5.1 Thorn Source Code

5.2 Thorn Documentation

5.3 Acknowledgements

References

6 Parameters




action_on_hdf5_error
Scope: private  KEYWORD



Description: What to do



Range   Default: alert
abort
stop the run.
alert
only alert the user






do_test
Scope: private  BOOLEAN



Description: to test or not to test



  Default: no






em_rin
Scope: private  REAL



Description: inner radius for decomp



Range   Default: 10.0
0:*
positive






em_rout
Scope: private  REAL



Description: outer radius for decomp



Range   Default: 100.0
(0:*
positive > Rin






extract_spacetime_metric_every
Scope: private  INT



Description:



Range   Default: (none)
0:*
0 or positive. 0 means never






max_spin
Scope: private  INT



Description: maximum absolute spin of fields



Range   Default: 2
0:*
positive only






num_l_modes
Scope: private  INT



Description: number of l modes ... not lmax



Range   Default: 7
1:*
1 or larger






num_mu_points
Scope: private  INT



Description: number of points in mu direction



Range   Default: 15
1:*






num_n_modes
Scope: private  INT



Description: number of n modes



Range   Default: 15
1:*
1 or larger






num_phi_points
Scope: private  INT



Description: number of points in phi directions



Range   Default: 31
1:*






num_radii
Scope: private  INT



Description: number of radii



Range   Default: 1
1:99






num_x_points
Scope: private  INT



Description: number of points in phi directions



Range   Default: 31
1:*






out_dir
Scope: private  STRING



Description: output directory



Range   Default: (none)
Empty stting -> use IO::out_dir
.+
directory name






output_l_max
Scope: private  INT



Description: don’t dump l modes larger than this



Range   Default: 100
0:*
positive, but if l_max < —s— then no output generated






output_m_max
Scope: private  INT



Description: don’t dump m modes larger than this



Range   Default: 100
0:*
positive or zero






rin
Scope: private  REAL



Description: inner radius for decomp



Range   Default: 10.0
0:*
positive






rout
Scope: private  REAL



Description: outer radius for decomp



Range   Default: 100.0
(0:*
positive > Rin






sync_file_each_time
Scope: private  BOOLEAN



Description: not yet activated



  Default: yes






io_out_dir
Scope: shared from IO STRING



7 Interfaces

General

Implements:

sphericalharmonicdecomp

Provides:

sYlm_DecomposeField to

sYlm_DecomposeField_3D to

8 Schedule

This section lists all the variables which are assigned storage by thorn PITTNullCode/SphericalHarmonicDecomp. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

Storage

NONE

Scheduled Functions

CCTK_INITIAL (conditional)

  sphericalharmonicdecomp_test

  test

 

 Language:c
 Options: global
 Type: function

CCTK_POSTSTEP (conditional)

  sphericalharmonicdecomp_dumpmetric

  extract and decompose spacetime metric

 

 Language:c
 Options: global
 Type: function