Skip to content
Snippets Groups Projects
Commit af277dea authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Pass the correct units to VR. Pass more cosmology info to VR. Only update the...

Pass the correct units to VR. Pass more cosmology info to VR. Only update the particle fields if running VR at a snapshot dump time.
parent 71c25584
No related branches found
No related tags found
2 merge requests!721Velociraptor outputs,!719Velociraptor output strategy
......@@ -32,7 +32,8 @@
/**
* @brief Converts physical constants to the internal unit system
*
* Some constants can be overwritten by the YAML file values.
* Some constants can be overwritten by the YAML file values. If the
* param argument is NULL, no overwriting is done.
*
* @param us The current internal system of units.
* @param params The parsed parameter file.
......@@ -48,8 +49,10 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
const_newton_G_cgs / units_general_cgs_conversion_factor(us, dimension_G);
/* Overwrite G if present in the file */
internal_const->const_newton_G = parser_get_opt_param_double(
params, "PhysicalConstants:G", internal_const->const_newton_G);
if (params != NULL) {
internal_const->const_newton_G = parser_get_opt_param_double(
params, "PhysicalConstants:G", internal_const->const_newton_G);
}
const float dimension_c[5] = {0, 1, -1, 0, 0}; /* [cm s^-1] */
internal_const->const_speed_light_c =
......
......@@ -144,11 +144,10 @@ void velociraptor_init(struct engine *e) {
#ifdef HAVE_VELOCIRAPTOR
const ticks tic = getticks();
/* Internal SWIFT units and physical constants */
// const struct phys_const *swift_pc = e->physical_constants;
/* Internal SWIFT units */
const struct unit_system *swift_us = e->internal_units;
/* CGS units and physical constants */
/* CGS units and physical constants in CGS */
struct unit_system cgs_us;
units_init_cgs(&cgs_us);
struct phys_const cgs_pc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment