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
117013d5
Commit
117013d5
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Zero the hydro, EoS and gravity properties if they are not used by the calculation.
parent
3af1a04a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/main.c
+11
-2
11 additions, 2 deletions
examples/main.c
with
11 additions
and
2 deletions
examples/main.c
+
11
−
2
View file @
117013d5
...
@@ -634,7 +634,7 @@ int main(int argc, char *argv[]) {
...
@@ -634,7 +634,7 @@ int main(int argc, char *argv[]) {
/* Initialize unit system and constants */
/* Initialize unit system and constants */
units_init_from_params
(
&
us
,
params
,
"InternalUnitSystem"
);
units_init_from_params
(
&
us
,
params
,
"InternalUnitSystem"
);
phys_const_init
(
&
us
,
params
,
&
prog_const
);
phys_const_init
(
&
us
,
params
,
&
prog_const
);
if
(
myrank
==
0
&&
verbose
>
0
)
{
if
(
myrank
==
0
)
{
message
(
"Internal unit system: U_M = %e g."
,
us
.
UnitMass_in_cgs
);
message
(
"Internal unit system: U_M = %e g."
,
us
.
UnitMass_in_cgs
);
message
(
"Internal unit system: U_L = %e cm."
,
us
.
UnitLength_in_cgs
);
message
(
"Internal unit system: U_L = %e cm."
,
us
.
UnitLength_in_cgs
);
message
(
"Internal unit system: U_t = %e s."
,
us
.
UnitTime_in_cgs
);
message
(
"Internal unit system: U_t = %e s."
,
us
.
UnitTime_in_cgs
);
...
@@ -653,11 +653,20 @@ int main(int argc, char *argv[]) {
...
@@ -653,11 +653,20 @@ int main(int argc, char *argv[]) {
/* Initialise the hydro properties */
/* Initialise the hydro properties */
if
(
with_hydro
)
if
(
with_hydro
)
hydro_props_init
(
&
hydro_properties
,
&
prog_const
,
&
us
,
params
);
hydro_props_init
(
&
hydro_properties
,
&
prog_const
,
&
us
,
params
);
if
(
with_hydro
)
eos_init
(
&
eos
,
&
prog_const
,
&
us
,
params
);
else
bzero
(
&
hydro_properties
,
sizeof
(
struct
hydro_props
));
/* Initialise the equation of state */
if
(
with_hydro
)
eos_init
(
&
eos
,
&
prog_const
,
&
us
,
params
);
else
bzero
(
&
eos
,
sizeof
(
struct
eos_parameters
));
/* Initialise the gravity properties */
/* Initialise the gravity properties */
if
(
with_self_gravity
)
if
(
with_self_gravity
)
gravity_props_init
(
&
gravity_properties
,
params
,
&
cosmo
,
with_cosmology
);
gravity_props_init
(
&
gravity_properties
,
params
,
&
cosmo
,
with_cosmology
);
else
bzero
(
&
gravity_properties
,
sizeof
(
struct
gravity_props
));
/* Read particles and space information from (GADGET) ICs */
/* Read particles and space information from (GADGET) ICs */
char
ICfileName
[
200
]
=
""
;
char
ICfileName
[
200
]
=
""
;
...
...
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