Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
b8b3e792
Commit
b8b3e792
authored
Jan 25, 2018
by
Matthieu Schaller
Browse files
Added 1/a^3 as one of the commonly tracked variables.
parent
59da0571
Changes
3
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
b8b3e792
...
...
@@ -407,7 +407,7 @@ AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!))
# Check for GSL
have_gsl="no"
AC_CHECK_LIB([gslcblas],[cblas_dgemm])
AC_CHECK_LIB([gsl],[gsl_
blas_dgemm], have_gsl="yes"
)
AC_CHECK_LIB([gsl],[gsl_
integration_qag]
)
# Check for pthreads.
AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
...
...
src/cosmology.c
View file @
b8b3e792
...
...
@@ -120,6 +120,7 @@ void cosmology_update(struct cosmology *c, const struct engine *e) {
const
double
a_inv
=
1
.
/
a
;
c
->
a
=
a
;
c
->
a_inv
=
a_inv
;
c
->
a3_inv
=
a_inv
*
a_inv
*
a_inv
;
/* Redshift */
c
->
z
=
a_inv
-
1
.;
...
...
@@ -146,7 +147,7 @@ void cosmology_update(struct cosmology *c, const struct engine *e) {
* @brief Computes \f$ dt / a^2 \f$ for the current cosmology.
*
* @param a The scale-factor of interest.
* @param param The current #c
s
omology.
* @param param The current #co
s
mology.
*/
double
drift_integrand
(
double
a
,
void
*
param
)
{
...
...
@@ -171,7 +172,7 @@ double drift_integrand(double a, void *param) {
* @brief Computes \f$ dt / a \f$ for the current cosmology.
*
* @param a The scale-factor of interest.
* @param param The current #c
s
omology.
* @param param The current #co
s
mology.
*/
double
gravity_kick_integrand
(
double
a
,
void
*
param
)
{
...
...
@@ -196,7 +197,7 @@ double gravity_kick_integrand(double a, void *param) {
* @brief Computes \f$ dt / a^{3(\gamma - 1) + 1} \f$ for the current cosmology.
*
* @param a The scale-factor of interest.
* @param param The current #c
s
omology.
* @param param The current #co
s
mology.
*/
double
hydro_kick_integrand
(
double
a
,
void
*
param
)
{
...
...
@@ -223,9 +224,10 @@ double hydro_kick_integrand(double a, void *param) {
* @brief Computes \f$ dt \f$ for the current cosmology.
*
* @param a The scale-factor of interest.
* @param param The current #c
s
omology.
* @param param The current #co
s
mology.
*/
double
time_integrand
(
double
a
,
void
*
param
)
{
const
struct
cosmology
*
c
=
(
const
struct
cosmology
*
)
param
;
const
double
Omega_r
=
c
->
Omega_r
;
const
double
Omega_m
=
c
->
Omega_m
;
...
...
@@ -339,7 +341,7 @@ void cosmology_init_tables(struct cosmology *c) {
* @brief Initialises the #cosmology from the values read in the parameter file.
*
* @param params The parsed values.
* @us The current internal system of units.
* @
param
us The current internal system of units.
* @param phys_const The physical constants in the current system of units.
* @param c The #cosmology to initialise.
*/
...
...
@@ -410,6 +412,7 @@ void cosmology_print(const struct cosmology *c) {
*
* Computes \f$ \int_{a_start}^{a_end} dt/a^2 \f$ using the interpolation table.
*
* @param e The #engine.
* @param ti_start the (integer) time of the start of the drift.
* @param ti_end the (integer) time of the end of the drift.
*/
...
...
@@ -435,6 +438,7 @@ double cosmology_get_drift_factor(const struct engine *e,
*
* Computes \f$ \int_{a_start}^{a_end} dt/a \f$ using the interpolation table.
*
* @param e The #engine.
* @param ti_start the (integer) time of the start of the drift.
* @param ti_end the (integer) time of the end of the drift.
*/
...
...
@@ -460,6 +464,7 @@ double cosmology_get_grav_kick_factor(const struct engine *e,
*
* Computes \f$ \int_{a_start}^{a_end} dt/a \f$ using the interpolation table.
*
* @param e The #engine.
* @param ti_start the (integer) time of the start of the drift.
* @param ti_end the (integer) time of the end of the drift.
*/
...
...
src/cosmology.h
View file @
b8b3e792
...
...
@@ -37,6 +37,9 @@ struct cosmology {
/*! Inverse of the current expansion factor of the Universe */
double
a_inv
;
/*! Inverse cube of the current expansion factor of the Universe */
double
a3_inv
;
/*! Current redshift */
double
z
;
...
...
@@ -49,6 +52,8 @@ struct cosmology {
/*! Dark-energy equation of state at the current time */
double
w
;
/*------------------------------------------------------------------ */
/*! Starting expansion factor */
double
a_begin
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment