Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
f6c33e0a
Commit
f6c33e0a
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Do not read the comoving softening from the yaml file if not running with cosmology switched on.
parent
2987a26b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!566
Periodic gravity calculation
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/main.c
+1
-1
1 addition, 1 deletion
examples/main.c
src/gravity_properties.c
+11
-5
11 additions, 5 deletions
src/gravity_properties.c
src/gravity_properties.h
+1
-1
1 addition, 1 deletion
src/gravity_properties.h
with
13 additions
and
7 deletions
examples/main.c
+
1
−
1
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
]
=
""
;
...
...
This diff is collapsed.
Click to expand it.
src/gravity_properties.c
+
11
−
5
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
);
...
...
This diff is collapsed.
Click to expand it.
src/gravity_properties.h
+
1
−
1
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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment