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
58f1666a
Commit
58f1666a
authored
6 years ago
by
Loic Hausammann
Browse files
Options
Downloads
Patches
Plain Diff
Update io fields
parent
b578d4f6
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!837
GEAR: Update io fields
,
!824
Add a description and a scale-factor exponent to each individual array written to the snapshots.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/chemistry/GEAR/chemistry_io.h
+15
-11
15 additions, 11 deletions
src/chemistry/GEAR/chemistry_io.h
src/cooling/grackle/cooling_io.h
+24
-24
24 additions, 24 deletions
src/cooling/grackle/cooling_io.h
with
39 additions
and
35 deletions
src/chemistry/GEAR/chemistry_io.h
+
15
−
11
View file @
58f1666a
...
@@ -74,15 +74,17 @@ INLINE static int chemistry_write_particles(const struct part* parts,
...
@@ -74,15 +74,17 @@ INLINE static int chemistry_write_particles(const struct part* parts,
/* List what we want to write */
/* List what we want to write */
list
[
0
]
=
io_make_output_field
(
list
[
0
]
=
io_make_output_field
(
"SmoothedElementAbundance"
,
FLOAT
,
chemistry_element_count
,
"SmoothedElementAbundances"
,
FLOAT
,
chemistry_element_count
,
UNIT_CONV_NO_UNITS
,
parts
,
chemistry_data
.
smoothed_metal_mass_fraction
);
UNIT_CONV_NO_UNITS
,
0
.
f
,
parts
,
chemistry_data
.
smoothed_metal_mass_fraction
,
"Element abundances smoothed over the neighbors"
);
list
[
1
]
=
io_make_output_field
(
"Z"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
parts
,
list
[
1
]
=
io_make_output_field
(
"Z"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
parts
,
chemistry_data
.
Z
);
chemistry_data
.
Z
,
"Temporary field"
);
list
[
2
]
=
io_make_output_field
(
"ElementAbundance"
,
FLOAT
,
list
[
2
]
=
io_make_output_field
(
"ElementAbundance
s
"
,
FLOAT
,
chemistry_element_count
,
UNIT_CONV_NO_UNITS
,
chemistry_element_count
,
UNIT_CONV_NO_UNITS
,
parts
,
chemistry_data
.
metal_mass_fraction
);
0
.
f
,
parts
,
chemistry_data
.
metal_mass_fraction
,
"Mass fraction of each element"
);
return
3
;
return
3
;
}
}
...
@@ -100,15 +102,17 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts,
...
@@ -100,15 +102,17 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts,
/* List what we want to write */
/* List what we want to write */
list
[
0
]
=
io_make_output_field
(
list
[
0
]
=
io_make_output_field
(
"SmoothedElementAbundance"
,
FLOAT
,
chemistry_element_count
,
"SmoothedElementAbundances"
,
FLOAT
,
chemistry_element_count
,
UNIT_CONV_NO_UNITS
,
sparts
,
chemistry_data
.
smoothed_metal_mass_fraction
);
UNIT_CONV_NO_UNITS
,
0
.
f
,
sparts
,
chemistry_data
.
smoothed_metal_mass_fraction
,
"Element abundances smoothed over the neighbors"
);
list
[
1
]
=
io_make_output_field
(
"Z"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
sparts
,
list
[
1
]
=
io_make_output_field
(
"Z"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
sparts
,
chemistry_data
.
Z
);
chemistry_data
.
Z
,
"Temporary field"
);
list
[
2
]
=
io_make_output_field
(
"ElementAbundance"
,
FLOAT
,
list
[
2
]
=
io_make_output_field
(
"ElementAbundance"
,
FLOAT
,
chemistry_element_count
,
UNIT_CONV_NO_UNITS
,
chemistry_element_count
,
UNIT_CONV_NO_UNITS
,
sparts
,
chemistry_data
.
metal_mass_fraction
);
0
.
f
,
sparts
,
chemistry_data
.
metal_mass_fraction
,
"Mass fraction of each element"
);
return
3
;
return
3
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/cooling/grackle/cooling_io.h
+
24
−
24
View file @
58f1666a
...
@@ -63,23 +63,23 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
...
@@ -63,23 +63,23 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
#if COOLING_GRACKLE_MODE >= 1
#if COOLING_GRACKLE_MODE >= 1
/* List what we want to write */
/* List what we want to write */
list
[
0
]
=
io_make_output_field
(
"HI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
0
]
=
io_make_output_field
(
"HI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
HI_frac
);
cooling_data
.
HI_frac
,
"HI mass fraction"
);
list
[
1
]
=
io_make_output_field
(
"HII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
1
]
=
io_make_output_field
(
"HII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
HII_frac
);
cooling_data
.
HII_frac
,
"HII mass fraction"
);
list
[
2
]
=
io_make_output_field
(
"HeI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
2
]
=
io_make_output_field
(
"HeI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
HeI_frac
);
cooling_data
.
HeI_frac
,
"HeI mass fraction"
);
list
[
3
]
=
io_make_output_field
(
"HeII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
3
]
=
io_make_output_field
(
"HeII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
HeII_frac
);
cooling_data
.
HeII_frac
,
"HeII mass fraction"
);
list
[
4
]
=
io_make_output_field
(
"HeIII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
4
]
=
io_make_output_field
(
"HeIII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
HeIII_frac
);
cooling_data
.
HeIII_frac
,
"HeIII mass fraction"
);
list
[
5
]
=
io_make_output_field
(
"e"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
5
]
=
io_make_output_field
(
"e"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
e_frac
);
cooling_data
.
e_frac
,
"free electron mass fraction"
);
num
+=
6
;
num
+=
6
;
#endif
#endif
...
@@ -87,14 +87,14 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
...
@@ -87,14 +87,14 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
#if COOLING_GRACKLE_MODE >= 2
#if COOLING_GRACKLE_MODE >= 2
list
+=
num
;
list
+=
num
;
list
[
0
]
=
io_make_output_field
(
"HM"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
0
]
=
io_make_output_field
(
"HM"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
HM_frac
);
cooling_data
.
HM_frac
,
"H- mass fraction"
);
list
[
1
]
=
io_make_output_field
(
"H2I"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
1
]
=
io_make_output_field
(
"H2I"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
H2I_frac
);
cooling_data
.
H2I_frac
,
"H2I mass fraction"
);
list
[
2
]
=
io_make_output_field
(
"H2II"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
2
]
=
io_make_output_field
(
"H2II"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
H2II_frac
);
cooling_data
.
H2II_frac
,
"H2II mass fraction"
);
num
+=
3
;
num
+=
3
;
#endif
#endif
...
@@ -102,14 +102,14 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
...
@@ -102,14 +102,14 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
#if COOLING_GRACKLE_MODE >= 3
#if COOLING_GRACKLE_MODE >= 3
list
+=
num
;
list
+=
num
;
list
[
0
]
=
io_make_output_field
(
"DI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
0
]
=
io_make_output_field
(
"DI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
DI_frac
);
cooling_data
.
DI_frac
,
"DI mass fraction"
);
list
[
1
]
=
io_make_output_field
(
"DII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
1
]
=
io_make_output_field
(
"DII"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
DII_frac
);
cooling_data
.
DII_frac
,
"DII mass fraction"
);
list
[
2
]
=
io_make_output_field
(
"HDI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
xparts
,
list
[
2
]
=
io_make_output_field
(
"HDI"
,
FLOAT
,
1
,
UNIT_CONV_NO_UNITS
,
0
.
f
,
xparts
,
cooling_data
.
HDI_frac
);
cooling_data
.
HDI_frac
,
"HDI mass fraction"
);
num
+=
3
;
num
+=
3
;
#endif
#endif
...
...
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