LALSimulation  5.4.0.1-fe68b98
LALSimNeutronStar.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 J. Creighton, B. Lackey
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  * @author Jolien Creighton, Benjamin Lackey
21  * @addtogroup LALSimNeutronStar_h Header LALSimNeutronStar.h
22  * @ingroup lalsimulation_general
23  * @brief Provides routines for neutron star physical parameters.
24  * @{
25  * @defgroup LALSimNeutronStarEOS_c Module LALSimNeutronStarEOS.c
26  * @defgroup LALSimNeutronStarTOV_c Module LALSimNeutronStarTOV.c
27  * @defgroup LALSimNeutronStarFamily_c Module LALSimNeutronStarFamily.c
28  * @}
29  * @{
30  */
31 
32 #ifndef _LALSIMNEUTRONSTAR_H
33 #define _LALSIMNEUTRONSTAR_H
34 
35 #include <lal/LALConstants.h>
36 
37 
38 /* CONSTANTS */
39 
40 /** Factor to convert density in kg/m^3 to geometerized units of m^-2. */
41 #define LAL_G_C2_SI ((LAL_G_SI) / ((double)(LAL_C_SI) * (double)(LAL_C_SI)))
42 
43 /** Factor to convert pressure in Pa to geometerized units of m^-2. */
44 #define LAL_G_C4_SI ((LAL_G_C2_SI) / ((double)(LAL_C_SI) * (double)(LAL_C_SI)))
45 
46 /** Nuclear density in kg m^-3. */
47 #define LAL_NUCLEAR_DENSITY_SI 2.8e17
48 
49 /** Nuclear density in geometrized units of m^-2. */
50 #define LAL_NUCLEAR_DENSITY_GEOM_SI ((LAL_NUCLEAR_DENSITY_SI) * (LAL_G_C2_SI))
51 
52 
53 /* EOS ROUTINES */
54 
55 /** Incomplete type for the neutron star Equation of State (EOS). */
56 typedef struct tagLALSimNeutronStarEOS LALSimNeutronStarEOS;
57 
58 /** Recognised names of equations of state */
59 extern const char * const lalSimNeutronStarEOSNames[111];
60 
61 /** Incomplete type for a neutron star family having a particular EOS. */
62 typedef struct tagLALSimNeutronStarFamily LALSimNeutronStarFamily;
63 
66 
70  double reference_pressure_si, double reference_density_si);
72  logp1_si, double gamma1, double gamma2, double gamma3);
74  gamma[], int size);
76  double SDgamma0, double SDgamma1, double SDgamma2, double SDgamma3);
78  size_t nsec, int causal);
80  double log10p1_si, double g1, double log10p2_si, double g2);
82  double log10p1_si, double v2, double log10p2_si, double v3);
83 int XLALSimNeutronStarEOS4ParamSDGammaCheck(double g0, double g1, double g2, double g3);
84 int XLALSimNeutronStarEOS4ParamSDViableFamilyCheck(double g0, double g1, double g2, double g3);
85 int XLALSimNeutronStarEOS3PDViableFamilyCheck(double p0, double log10p1_si, double p1, double log10p2_si, double p2, int causal);
86 
89  eos);
92  eos);
93 
95  LALSimNeutronStarEOS * eos);
97  LALSimNeutronStarEOS * eos);
99  LALSimNeutronStarEOS * eos);
101  LALSimNeutronStarEOS * eos);
103  LALSimNeutronStarEOS * eos);
105  LALSimNeutronStarEOS * eos);
106 double XLALSimNeutronStarEOSSpeedOfSound(double h,
107  LALSimNeutronStarEOS * eos);
109  LALSimNeutronStarEOS * eos);
111  LALSimNeutronStarEOS * eos);
112 
114  LALSimNeutronStarEOS * eos);
116  LALSimNeutronStarEOS * eos);
118  LALSimNeutronStarEOS * eos);
120  h, LALSimNeutronStarEOS * eos);
122  h, LALSimNeutronStarEOS * eos);
124  LALSimNeutronStarEOS * eos);
126  LALSimNeutronStarEOS * eos);
127 
128 /* TOV ROUTINES */
129 
130 int XLALSimNeutronStarTOVODEIntegrate(double *radius, double *mass,
131  double *love_number_k2, double central_pressure_si,
132  LALSimNeutronStarEOS * eos);
133 
134 int XLALSimNeutronStarTOVODEIntegrateWithTolerance(double *radius, double *mass,
135  double *love_number_k2, double central_pressure_si,
136  LALSimNeutronStarEOS * eos, double epsrel);
137 
138 int XLALSimNeutronStarVirialODEIntegrate(double *radius, double *mass,
139  double *int1, double *int2, double *int3, double *int4, double *int5, double *int6,
140  double *love_number_k2, double central_pressure_si,
141  LALSimNeutronStarEOS * eos);
142 
143 int XLALSimNeutronStarVirialODEIntegrateWithTolerance(double *radius, double *mass,
144  double *int1, double *int2, double *int3, double *int4, double *int5, double *int6,
145  double *love_number_k2, double central_pressure_si,
146  LALSimNeutronStarEOS * eos, double epsrel);
147 
148 /* MASS-RADIUS TYPE RELATIONSHIP ROUTINES */
149 
152  LALSimNeutronStarEOS * eos);
153 
160 
161 #endif /* _LALSIMNEUTRONSTAR_H */
162 
163 /** @} */
const double g3
const double g2
const double g0
const double g1
const char * name
struct tagLALSimNeutronStarFamily LALSimNeutronStarFamily
Incomplete type for a neutron star family having a particular EOS.
struct tagLALSimNeutronStarEOS LALSimNeutronStarEOS
Incomplete type for the neutron star Equation of State (EOS).
double e
Definition: bh_ringdown.c:117
LALSimNeutronStarEOS * XLALSimNeutronStarEOSSpectralDecomposition(double gamma[], int size)
Reads spectral decomposition eos parameters to make an eos.
LALSimNeutronStarEOS * XLALSimNeutronStarEOS4ParameterSpectralDecomposition(double SDgamma0, double SDgamma1, double SDgamma2, double SDgamma3)
Reads 4 spectral decomposition eos parameters to make an eos.
double XLALSimNeutronStarEOSRestMassDensityOfPseudoEnthalpy(double h, LALSimNeutronStarEOS *eos)
Returns the rest mass density (kg m^-3) at a given value of the dimensionless pseudo-enthalpy.
double XLALSimNeutronStarEOSMinAcausalPseudoEnthalpy(LALSimNeutronStarEOS *eos)
Returns the minimum pseudo-enthalpy at which EOS becomes acausal (speed of sound > speed of light) (d...
double XLALSimNeutronStarEOSEnergyDensityDerivOfPressure(double p, LALSimNeutronStarEOS *eos)
Returns the gradient of the energy density with respect to the pressure (dimensionless) at a given va...
double XLALSimNeutronStarEOSPressureOfRestMassDensity(double rho, LALSimNeutronStarEOS *eos)
Returns the pressure in Pa at a given rest-mass density in kg/m^3.
int XLALSimNeutronStarEOS4ParamSDGammaCheck(double g0, double g1, double g2, double g3)
Check that EOS has adiabatic index in range (0.6,4.5)
double XLALSimNeutronStarEOSEnergyDensityOfPressureGeometerized(double p, LALSimNeutronStarEOS *eos)
Returns the energy density in geometerized units (m^-2) at a given pressure in geometerized units (m^...
int XLALSimNeutronStarEOS4ParamSDViableFamilyCheck(double g0, double g1, double g2, double g3)
Check that EOS has enough points (>4) in M-R space to interpolate.
const char *const lalSimNeutronStarEOSNames[111]
Recognised names of equations of state.
double XLALSimNeutronStarEOSPressureOfPseudoEnthalpy(double h, LALSimNeutronStarEOS *eos)
Returns the pressure (Pa) at a given value of the dimensionless pseudo-enthalpy.
LALSimNeutronStarEOS * XLALSimNeutronStarEOSPolytrope(double Gamma, double reference_pressure_si, double reference_density_si)
Creates a polytrope Equation of State defined by p = K rho^Gamma.
int XLALSimNeutronStarEOS3PDViableFamilyCheck(double p0, double log10p1_si, double p1, double log10p2_si, double p2, int causal)
Check that EOS has enough points (>4) in M-R space to interpolate.
double XLALSimNeutronStarEOSEnergyDensityDerivOfPressureGeometerized(double p, LALSimNeutronStarEOS *eos)
Returns the gradient of the energy density with respect to the pressure (dimensionless) at a given va...
double XLALSimNeutronStarEOSPressureOfEnergyDensity(double e, LALSimNeutronStarEOS *eos)
Returns the pressure in Pa at a given energy density in J/m^3.
LALSimNeutronStarEOS * XLALSimNeutronStarEOS4ParameterPiecewisePolytrope(double logp1_si, double gamma1, double gamma2, double gamma3)
Creates a 4-parameter piecewise-polytrope Equation of State.
double XLALSimNeutronStarEOSEnergyDensityOfPseudoEnthalpyGeometerized(double h, LALSimNeutronStarEOS *eos)
Returns the energy density in geometerized units (m^-2) at a given value of the dimensionless pseudo-...
double XLALSimNeutronStarEOSSpeedOfSound(double h, LALSimNeutronStarEOS *eos)
Returns the speed of sound (m s^-1) at a given value of the pseudo-enthalpy (dimensionless).
double XLALSimNeutronStarEOSRestMassDensityOfPseudoEnthalpyGeometerized(double h, LALSimNeutronStarEOS *eos)
Returns the rest mass density in geometerized units (m^-2) at a given value of the dimensionless pseu...
double XLALSimNeutronStarEOSPseudoEnthalpyOfPressure(double p, LALSimNeutronStarEOS *eos)
Returns the dimensionless pseudo-enthalpy at a given pressure (Pa).
double XLALSimNeutronStarEOSSpeedOfSoundGeometerized(double h, LALSimNeutronStarEOS *eos)
Returns the speed of sound in geometerized units (dimensionless) at a given value of the pseudo-entha...
double XLALSimNeutronStarEOSMaxPressure(LALSimNeutronStarEOS *eos)
Returns the maximum pressure of the EOS in Pa.
LALSimNeutronStarEOS * XLALSimNeutronStarEOS3PieceCausalAnalytic(double v1, double log10p1_si, double v2, double log10p2_si, double v3)
Reads 5 causal analytic eos parameters to make an eos.
char * XLALSimNeutronStarEOSName(LALSimNeutronStarEOS *eos)
The name of the equation of state.
LALSimNeutronStarEOS * XLALSimNeutronStarEOSByName(const char *name)
Creates an equation of state structure from tabulated equation of state data of a known name.
LALSimNeutronStarEOS * XLALSimNeutronStarEOSDynamicAnalytic(double parameters[], size_t nsec, int causal)
Reads dynamic analytic eos parameters to make an eos.
LALSimNeutronStarEOS * XLALSimNeutronStarEOS3PieceDynamicPolytrope(double g0, double log10p1_si, double g1, double log10p2_si, double g2)
Reads 5 dynamic polytrope eos parameters to make an eos.
double XLALSimNeutronStarEOSPressureOfPseudoEnthalpyGeometerized(double h, LALSimNeutronStarEOS *eos)
Returns the pressure in geometerized units (m^-2) at a given value of the dimensionless pseudo-enthal...
double XLALSimNeutronStarEOSEnergyDensityOfPressure(double p, LALSimNeutronStarEOS *eos)
Returns the energy density (J m^-3) at a given pressure (Pa).
double XLALSimNeutronStarEOSMaxPseudoEnthalpy(LALSimNeutronStarEOS *eos)
Returns the maximum pseudo enthalpy of the EOS (dimensionless).
double XLALSimNeutronStarEOSEnergyDensityOfPseudoEnthalpy(double h, LALSimNeutronStarEOS *eos)
Returns the energy density (J m^-3) at a given value of the dimensionless pseudo-enthalpy.
double XLALSimNeutronStarEOSMaxPressureGeometerized(LALSimNeutronStarEOS *eos)
Returns the maximum pressure of the EOS in geometrized units m^-2.
LALSimNeutronStarEOS * XLALSimNeutronStarEOSFromFile(const char *fname)
Reads a data file containing a tabulated equation of state.
void XLALDestroySimNeutronStarEOS(LALSimNeutronStarEOS *eos)
Frees the memory associated with a pointer to an EOS structure.
double XLALSimNeutronStarEOSPseudoEnthalpyOfPressureGeometerized(double p, LALSimNeutronStarEOS *eos)
Returns the dimensionless pseudo-enthalpy at a given pressure in geometerized units (m^-2).
double XLALSimNeutronStarLoveNumberK2(double m, LALSimNeutronStarFamily *fam)
Returns the tidal Love number k2 of a neutron star of mass m.
void XLALDestroySimNeutronStarFamily(LALSimNeutronStarFamily *fam)
Frees the memory associated with a pointer to a neutron star family.
double XLALSimNeutronStarRadius(double m, LALSimNeutronStarFamily *fam)
Returns the radius of a neutron star of mass m.
double XLALSimNeutronStarFamMinimumMass(LALSimNeutronStarFamily *fam)
Returns the minimum mass of a neutron star family.
double XLALSimNeutronStarCentralPressure(double m, LALSimNeutronStarFamily *fam)
Returns the central pressure of a neutron star of mass m.
LALSimNeutronStarFamily * XLALCreateSimNeutronStarFamily(LALSimNeutronStarEOS *eos)
Creates a neutron star family structure for a given equation of state.
double XLALSimNeutronStarMaximumMass(LALSimNeutronStarFamily *fam)
Returns the maximum mass of a neutron star family.
int XLALSimNeutronStarTOVODEIntegrate(double *radius, double *mass, double *love_number_k2, double central_pressure_si, LALSimNeutronStarEOS *eos)
int XLALSimNeutronStarVirialODEIntegrateWithTolerance(double *radius, double *mass, double *int1, double *int2, double *int3, double *int4, double *int5, double *int6, double *love_number_k2, double central_pressure_si, LALSimNeutronStarEOS *eos, double epsrel)
Integrates the Tolman-Oppenheimer-Volkov stellar structure equations and the Virial Equations.
int XLALSimNeutronStarTOVODEIntegrateWithTolerance(double *radius, double *mass, double *love_number_k2, double central_pressure_si, LALSimNeutronStarEOS *eos, double epsrel)
Integrates the Tolman-Oppenheimer-Volkov stellar structure equations.
int XLALSimNeutronStarVirialODEIntegrate(double *radius, double *mass, double *int1, double *int2, double *int3, double *int4, double *int5, double *int6, double *love_number_k2, double central_pressure_si, LALSimNeutronStarEOS *eos)
static const INT4 m