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
91487daf
Commit
91487daf
authored
Mar 05, 2020
by
Matthieu Schaller
Browse files
Add the option to use the Gadget-2 physical constants rather than the more up-to-date default ones.
parent
47f482cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
91487daf
...
...
@@ -2151,6 +2151,17 @@ case "$with_star_formation" in
;;
esac
AC_ARG_WITH([gadget2-physical-constants],
[AS_HELP_STRING([--with-gadget2-physical-constants],
[Use the same physical constants (G, Msun, Mpc) as the Gadget-2 code rather than more up-to-date values.]
)],
[with_gadget2_physical_constants="$withval"],
[with_gadget2_physical_constants="no"]
)
if test "$with_gadget2_physical_constants" = "yes"; then
AC_DEFINE([SWIFT_USE_GADGET2_PHYSICAL_CONSTANTS],1,[Use the same physical constants as Gadget-2])
fi
# Gravity multipole order
AC_ARG_WITH([multipole-order],
[AS_HELP_STRING([--with-multipole-order=<order>],
...
...
src/physical_constants_cgs.h
View file @
91487daf
...
...
@@ -40,9 +40,18 @@
* The primordial Helium fraction is the value obtained by WMAP7.
*/
#ifdef SWIFT_USE_GADGET2_PHYSICAL_CONSTANTS
/*! Newton's gravitation constant [g^-1 cm^3 s^-2] */
const
double
const_newton_G_cgs
=
6.672e-8
;
#else
/*! Newton's gravitation constant [g^-1 cm^3 s^-2] */
const
double
const_newton_G_cgs
=
6.67408e-8
;
#endif
/*! Speed of light in vacuum [cm s^-1] */
const
double
const_speed_light_c_cgs
=
2.99792458e10
;
...
...
@@ -82,15 +91,33 @@ const double const_year_cgs = 3.15569252e7;
/*! Astronomical unit [cm] */
const
double
const_astronomical_unit_cgs
=
1.49597870700e13
;
#ifdef SWIFT_USE_GADGET2_PHYSICAL_CONSTANTS
/*! Parsec [cm] */
const
double
const_parsec_cgs
=
3.085678e18
;
#else
/*! Parsec [cm] */
const
double
const_parsec_cgs
=
3.08567758149e18
;
#endif
/*! Light-year [cm] */
const
double
const_light_year_cgs
=
9.46053e17
;
#ifdef SWIFT_USE_GADGET2_PHYSICAL_CONSTANTS
/*! Mass of the Sun [g] */
const
double
const_solar_mass_cgs
=
1.989e33
;
#error aa
#else
/*! Mass of the Sun [g] */
const
double
const_solar_mass_cgs
=
1.98848e33
;
#endif
/*! Mass of the Earth [g] */
const
double
const_earth_mass_cgs
=
5.9724e27
;
...
...
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