LALSimulation  5.4.0.1-fe68b98
LALSimIMREOBFactorizedFlux.c
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2010 Craig Robinson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19 
20 
21 /**
22  * \author Craig Robinson
23  *
24  * \brief Function to compute the factorized flux as uses in the new EOBNR_PP
25  * model. Flux function given by Phys.Rev.D79:064004,2009.
26  */
27 
28 #include <complex.h>
29 
30 #ifndef _LALSIMIMRFACTORIZEDFLUX_C
31 #define _LALSIMIMRFACTORIZEDFLUX_C
32 
33 /**
34  * This function calculates the factorized flux in the EOB dynamics for
35  * the EOBNR (and potentially subsequent) models. The flux function
36  * is found in Phys.Rev.D79:064004,2009.
37  */
39  REAL8Vector *values, /**<< Dynamics r, phi, pr, pphi */
40  const REAL8 omega, /**<< Angular frequency omega */
41  EOBParams *ak, /**<< Structure containing pre-computed parameters */
42  const INT4 lMax /**<< Maximum l to include when calculating flux (between 2 and 8) */
43  )
44 
45 {
46 
47  REAL8 flux = 0.0;
48  REAL8 v;
49  REAL8 omegaSq;
50  COMPLEX16 hLM;
51  INT4 l, m;
52 
53  EOBNonQCCoeffs *nqcCoeffs;
54  COMPLEX16 hNQC;
55 
56  if ( !values || !ak )
57  {
59  }
60 
61  if ( lMax < 2 )
62  {
64  }
65 
66  nqcCoeffs = ak->nqcCoeffs;
67 
68  /* Omegs is the derivative of phi */
69  omegaSq = omega*omega;
70 
71  v = cbrt( omega );
72 
73  /* We need to apply the NQC for the (2,2) mode */
74  /* To avoid having an if statement in the loop we will */
75  /* deal with (2,2) and (2,1) separately */
76  /* (2,2) */
77  l = 2;
78  m = 2;
79 
80  if ( XLALSimIMREOBNonQCCorrection( &hNQC, values, omega, nqcCoeffs ) == XLAL_FAILURE )
81  {
83  }
84 
85  if ( XLALSimIMREOBGetFactorizedWaveform( &hLM, values, v, l, m, ak )
86  == XLAL_FAILURE )
87  {
89  }
90  /* For the 2,2 mode, we apply NQC correction to the flux */
91  hLM *= hNQC;
92 
93  flux = (REAL8)(m * m) * omegaSq * (creal(hLM)*creal(hLM) + cimag(hLM)*cimag(hLM));
94 
95  /* (2,1) */
96  l = 2;
97  m = 1;
98 
99  if ( XLALSimIMREOBGetFactorizedWaveform( &hLM, values, v, l, m, ak )
100  == XLAL_FAILURE )
101  {
103  }
104 
105  flux += (REAL8)(m * m) * omegaSq * (creal(hLM)*creal(hLM) + cimag(hLM)*cimag(hLM));
106 
107  /* All other modes */
108  for ( l = 3; l <= lMax; l++ )
109  {
110  /*INT4 minM = l-3;
111  if ( minM < 1 )
112  minM = 1;*/
113 
114  for ( m = 1; m <= l; m++ )
115  {
116 
117  if ( XLALSimIMREOBGetFactorizedWaveform( &hLM, values, v, l, m, ak )
118  == XLAL_FAILURE )
119  {
121  }
122 
123  flux += (REAL8)(m * m) * omegaSq * (creal(hLM)*creal(hLM) + cimag(hLM)*cimag(hLM));
124  }
125  }
126 
127  return flux * LAL_1_PI / 8.0;
128 }
129 
130 #endif /*_LALSIMIMRFACTORIZEDFLUX_C*/
static REAL8 XLALSimIMREOBFactorizedFlux(REAL8Vector *values, const REAL8 omega, EOBParams *ak, const INT4 lMax)
This function calculates the factorized flux in the EOB dynamics for the EOBNR (and potentially subse...
static UNUSED int XLALSimIMREOBGetFactorizedWaveform(COMPLEX16 *restrict hlm, REAL8Vector *restrict values, const REAL8 v, const INT4 l, const INT4 m, EOBParams *restrict params)
Computes the factorized waveform according to the prescription given in Pan et al,...
static UNUSED int XLALSimIMREOBNonQCCorrection(COMPLEX16 *restrict nqc, REAL8Vector *restrict values, const REAL8 omega, EOBNonQCCoeffs *restrict coeffs)
This function calculates the non-quasicircular correction to apply to the waveform.
int l
Definition: bh_qnmode.c:135
#define LAL_1_PI
double complex COMPLEX16
double REAL8
int32_t INT4
static const INT4 m
#define XLAL_ERROR_REAL8(...)
XLAL_EFAULT
XLAL_EFUNC
XLAL_EINVAL
XLAL_FAILURE
The coefficients which are used in calculating the non-quasicircular correction to the EOBNRv2 model.
Structure containing all the parameters needed for the EOB waveform.
EOBNonQCCoeffs * nqcCoeffs