1 #ifndef _LALSIMIMRSPINPRECEOBWFGEN_C
2 #define _LALSIMIMRSPINPRECEOBWFGEN_C
29 REAL8 ham, omega, v, magR2, s1dotLN, s2dotLN, chiS, chiA, tplspin;
30 REAL8 rcrossrdot[3], rcrossp[3];
35 REAL8 dvaluesData[14] = {0.};
36 REAL8 polarDynamicsData[4] = {0.};
41 polarDynamics.
data = polarDynamicsData;
42 dvalues.
data = dvaluesData;
46 for(
int i=0;
i<3;
i++){
55 REAL8 rCartData[3], pCartData[3], s1CartData[3], s2CartData[3];
64 rCartVec.
data = rCartData;
65 pCartVec.
data = pCartData;
66 s1CartVec.
data = s1CartData;
67 s2CartVec.
data = s2CartData;
82 seobParams->
a = sqrt(
a2);
88 memset( dvalues.
data, 0, 14*
sizeof(
REAL8));
106 chiS = 0.5 * (s1dotLN + s2dotLN);
107 chiA = 0.5 * (s1dotLN - s2dotLN);
110 tplspin = (1.-2.*seobParams->
eobParams->
eta) * chiS + (m1 - m2)/(m1 + m2) * chiA;
122 polarDynamics.
data[0] = sqrt(magR2);
123 polarDynamics.
data[1] = values->
data[13] + values->
data[12];
162 COMPLEX16 hTSp2, hTSp1, hTS0, hTSm1, hTSm2;
163 REAL8 aP2J, bP2J, gP2J;
164 REAL8 LNhx, LNhy, LNhz;
165 COMPLEX16 hxx[5], hresult[5], hresult2[5];
166 REAL8 rcrossrdot[3], magrcrossrdot;
167 REAL8 rdot[3] = {0.,0.,0.};
174 hxx[0]= hTSm2; hxx[1]=hTSm1; hxx[2]=hTS0; hxx[3]=hTSp1, hxx[4]=hTSp2;
186 LNhx = rcrossrdot[0]/magrcrossrdot;
187 LNhy = rcrossrdot[1]/magrcrossrdot;
188 LNhz = rcrossrdot[2]/magrcrossrdot;
202 EulerAnglesP2J(&aP2J,&bP2J,&gP2J,aI2P, bI2P, gI2P, LNhx, LNhy, LNhz, JframeEx, JframeEy, JframeEz );
210 for(
int m=0;
m<2*
l+1;
m++){
212 for(
int mp=0; mp<2*
l+1; mp++){
214 hresult[
m] += hxx[mp] * W[
m][mp];
221 for(
int m=0;
m<2*
l+1;
m++){
223 for(
int mp=0; mp<2*
l+1; mp++)
228 for (
int i=0;
i<2*
l+1;
i++) x11 += Y[
i]*hresult2[
i];
231 *hcross = cimag(x11);
245 REAL8 valuesdata[14] = {0.};
248 values.
data= valuesdata;
250 for(
int t = 0; t<retLen; t++){
251 for (
int i=1;
i<=14;
i++)
270 REAL8 alJtoI = -atan2(Jy[2], -Jx[2]);
271 REAL8 betJtoI = acos(Jz[2]);
272 REAL8 gamJtoI = -atan2(Jz[1], -Jz[0]);
274 REAL8 valuesdata[14] = {0.};
277 values.
data= valuesdata;
278 for(
int t = 0; t<retLen; t++){
279 for (
int i=1;
i<=14;
i++)
282 XLALEOBSpinPrecCalcHplusHcross(seobParams,&values,AlphaI2PVec->
data[t],BetaI2PVec->
data[t],GammaI2PVec->
data[t], alJtoI,betJtoI,gamJtoI,Jx,Jy,Jz,Y,h->
data+t+retLen,h->
data+t+2*retLen);
static UNUSED int XLALSimIMRSpinEOBNonQCCorrection(COMPLEX16 *restrict nqc, REAL8Vector *restrict values, const REAL8 omega, EOBNonQCCoeffs *restrict coeffs)
This function calculates the non-quasicircular correction to apply to the waveform.
static int XLALSimIMRCalculateSpinEOBHCoeffs(SpinEOBHCoeffs *coeffs, const REAL8 eta, const REAL8 a, const UINT4 SpinAlignedEOBversion)
This function is used to calculate some coefficients which will be used in the spinning EOB Hamiltoni...
static REAL8 XLALSimIMRSpinPrecEOBHamiltonian(const REAL8 eta, REAL8Vector *restrict x, REAL8Vector *restrict p, REAL8Vector *restrict s1Vec, REAL8Vector *restrict s2Vec, REAL8Vector *restrict sigmaKerr, REAL8Vector *restrict sigmaStar, int tortoise, SpinEOBHCoeffs *coeffs)
static REAL8 * cross_product(const REAL8 values1[], const REAL8 values2[], REAL8 result[])
static REAL8 inner_product(const REAL8 values1[], const REAL8 values2[])
Functions to compute the inner product and cross products between vectors.
static UNUSED void EulerAnglesP2J(REAL8 *aP2J, REAL8 *bP2J, REAL8 *gP2J, const REAL8 aI2P, const REAL8 bI2P, const REAL8 gI2P, const REAL8 LNhx, const REAL8 LNhy, const REAL8 LNhz, const REAL8 JframeEx[], const REAL8 JframeEy[], const REAL8 JframeEz[])
Given Euler angles to go from initial inertial frame to precessing frama and the LNhat vector,...
static void XLALEOBSpinPrecGenerateHTSModesFromEOMSoln(COMPLEX16 *hTSm2, COMPLEX16 *hTSm1, COMPLEX16 *hTS0, COMPLEX16 *hTSp1, COMPLEX16 *hTSp2, int retLen, REAL8Array *dynamics, SpinEOBParams *seobParams)
static void XLALEOBSpinPrecCalcHplusHcross(SpinEOBParams *seobParams, REAL8Vector *values, REAL8 aI2P, REAL8 bI2P, REAL8 gI2P, REAL8 alJtoI, REAL8 betJtoI, REAL8 gamJtoI, REAL8 JframeEx[3], REAL8 JframeEy[3], REAL8 JframeEz[3], COMPLEX16 Y[5], REAL8 *hplus, REAL8 *hcross)
static void XLALEOBSpinPrecGenerateHplusHcrossTSFromEOMSoln(REAL8Vector *h, int retLen, REAL8Vector *AlphaI2PVec, REAL8Vector *BetaI2PVec, REAL8Vector *GammaI2PVec, REAL8 Jx[3], REAL8 Jy[3], REAL8 Jz[3], COMPLEX16 Y[5], REAL8Array *dynamics, SpinEOBParams *seobParams)
static void XLALEOBSpinPrecCalcHModes(COMPLEX16 *hp2, COMPLEX16 *hp1, COMPLEX16 *h0, COMPLEX16 *hm1, COMPLEX16 *hm2, SpinEOBParams *seobParams, REAL8Vector *values)
static int XLALSpinPrecHcapRvecDerivative_exact(double UNUSED t, const REAL8 values[], REAL8 dvalues[], void *funcParams)
Function to calculate exact derivatives of the spin EOB Hamiltonian, to get , as decribed in Eqs.
COMPLEX16 XLALWignerDMatrix(int l, int mp, int m, double alpha, double beta, double gam)
FacWaveformCoeffs * hCoeffs
Parameters for the spinning EOB model.
SpinEOBHCoeffs * seobCoeffs
EOBNonQCCoeffs * nqcCoeffs