Skip to content
GitLab
Menu
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
f6c33e0a
Commit
f6c33e0a
authored
Jun 30, 2018
by
Matthieu Schaller
Browse files
Do not read the comoving softening from the yaml file if not running with cosmology switched on.
parent
2987a26b
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
f6c33e0a
...
...
@@ -633,7 +633,7 @@ int main(int argc, char *argv[]) {
/* Initialise the gravity properties */
if
(
with_self_gravity
)
gravity_props_init
(
&
gravity_properties
,
params
,
&
cosmo
);
gravity_props_init
(
&
gravity_properties
,
params
,
&
cosmo
,
with_cosmology
);
/* Read particles and space information from (GADGET) ICs */
char
ICfileName
[
200
]
=
""
;
...
...
src/gravity_properties.c
View file @
f6c33e0a
...
...
@@ -39,7 +39,7 @@
#define gravity_props_default_rebuild_frequency 0.01f
void
gravity_props_init
(
struct
gravity_props
*
p
,
struct
swift_params
*
params
,
const
struct
cosmology
*
cosmo
)
{
const
struct
cosmology
*
cosmo
,
int
with_cosmology
)
{
/* Tree updates */
p
->
rebuild_frequency
=
...
...
@@ -74,10 +74,16 @@ void gravity_props_init(struct gravity_props *p, struct swift_params *params,
p
->
theta_crit_inv
=
1
.
/
p
->
theta_crit
;
/* Softening parameters */
p
->
epsilon_comoving
=
parser_get_param_double
(
params
,
"Gravity:comoving_softening"
);
p
->
epsilon_max_physical
=
parser_get_param_double
(
params
,
"Gravity:max_physical_softening"
);
if
(
with_cosmology
)
{
p
->
epsilon_comoving
=
parser_get_param_double
(
params
,
"Gravity:comoving_softening"
);
p
->
epsilon_max_physical
=
parser_get_param_double
(
params
,
"Gravity:max_physical_softening"
);
}
else
{
p
->
epsilon_max_physical
=
parser_get_param_double
(
params
,
"Gravity:max_physical_softening"
);
p
->
epsilon_comoving
=
p
->
epsilon_max_physical
;
}
/* Set the softening to the current time */
gravity_update
(
p
,
cosmo
);
...
...
src/gravity_properties.h
View file @
f6c33e0a
...
...
@@ -88,7 +88,7 @@ struct gravity_props {
void
gravity_props_print
(
const
struct
gravity_props
*
p
);
void
gravity_props_init
(
struct
gravity_props
*
p
,
struct
swift_params
*
params
,
const
struct
cosmology
*
cosmo
);
const
struct
cosmology
*
cosmo
,
int
with_cosmology
);
void
gravity_update
(
struct
gravity_props
*
p
,
const
struct
cosmology
*
cosmo
);
#if defined(HAVE_HDF5)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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