LALInspiral 5.0.3.1-eeff03c
LALFactorizedFlux.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 <math.h>
29#include <lal/LALInspiral.h>
30#include <lal/LALEOBNRv2Waveform.h>
31
33 REAL8Vector *values,
34 const REAL8 omega,
35 EOBParams *ak,
36 const INT4 lMax
37 )
38
39{
40
41 REAL8 flux = 0.0;
42 REAL8 v;
43 REAL8 omegaSq;
44 COMPLEX16 hLM;
45 INT4 l, m;
46
47 EOBNonQCCoeffs *nqcCoeffs;
48 COMPLEX16 hNQC;
49
50 if ( !values || !ak )
51 {
53 }
54
55 if ( lMax < 2 )
56 {
58 }
59
60 nqcCoeffs = ak->nqcCoeffs;
61
62 /* Omegs is the derivative of phi */
63 omegaSq = omega*omega;
64
65 v = cbrt( omega );
66
67 /* We need to apply the NQC for the (2,2) mode */
68 /* To avoid having an if statement in the loop we will */
69 /* deal with (2,2) and (2,1) separately */
70 /* (2,2) */
71 l = 2;
72 m = 2;
73
74 if ( XLALEOBNonQCCorrection( &hNQC, values, omega, nqcCoeffs ) == XLAL_FAILURE )
75 {
77 }
78
79 if ( XLALGetFactorizedWaveform( &hLM, values, v, l, m, ak )
80 == XLAL_FAILURE )
81 {
83 }
84 /* For the 2,2 mode, we apply NQC correction to the flux */
85 hLM = hNQC * hLM;
86
87 flux = (REAL8)(m * m) * omegaSq * cabs( hLM ) * cabs( hLM );
88
89 /* (2,1) */
90 l = 2;
91 m = 1;
92
93 if ( XLALGetFactorizedWaveform( &hLM, values, v, l, m, ak )
94 == XLAL_FAILURE )
95 {
97 }
98
99 flux += (REAL8)(m * m) * omegaSq * cabs( hLM ) * cabs( hLM );
100
101 /* All other modes */
102 for ( l = 3; l <= lMax; l++ )
103 {
104 /*INT4 minM = l-3;
105 if ( minM < 1 )
106 minM = 1;*/
107
108 for ( m = 1; m <= l; m++ )
109 {
110
111 if ( XLALGetFactorizedWaveform( &hLM, values, v, l, m, ak )
112 == XLAL_FAILURE )
113 {
115 }
116
117 flux += (REAL8)(m * m) * omegaSq * cabs( hLM ) * cabs( hLM );
118 }
119 }
120
121 return flux * LAL_1_PI / 8.0;
122}
int XLALEOBNonQCCorrection(COMPLEX16 *restrict nqc, REAL8Vector *restrict values, const REAL8 omega, EOBNonQCCoeffs *restrict coeffs)
int l
#define LAL_1_PI
double complex COMPLEX16
double REAL8
int32_t INT4
REAL8 XLALInspiralFactorizedFlux(REAL8Vector *values, const REAL8 omega, EOBParams *ak, const INT4 lMax)
Function to compute the factorized flux as uses in the new EOBNR_PP model. Flux function given by Phy...
INT4 XLALGetFactorizedWaveform(COMPLEX16 *hlm, REAL8Vector *values, const REAL8 v, const INT4 l, const INT4 m, EOBParams *params)
static const INT4 m
#define XLAL_ERROR_REAL8(...)
XLAL_EFAULT
XLAL_EFUNC
XLAL_EINVAL
XLAL_FAILURE
EOBNonQCCoeffs * nqcCoeffs