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
d65cb17c
Commit
d65cb17c
authored
6 years ago
by
Josh Borrow
Browse files
Options
Downloads
Patches
Plain Diff
Potential is now written for the PressureEnergy scheme
parent
2bb9b208
No related branches found
No related tags found
1 merge request
!611
Cosmology pressure energy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hydro/PressureEnergy/hydro_io.h
+13
-1
13 additions, 1 deletion
src/hydro/PressureEnergy/hydro_io.h
with
13 additions
and
1 deletion
src/hydro/PressureEnergy/hydro_io.h
+
13
−
1
View file @
d65cb17c
...
...
@@ -136,6 +136,15 @@ INLINE static void convert_part_vel(const struct engine* e,
ret
[
2
]
*=
cosmo
->
a_inv
;
}
INLINE
static
void
convert_part_potential
(
const
struct
engine
*
e
,
const
struct
part
*
p
,
const
struct
xpart
*
xp
,
float
*
ret
)
{
if
(
p
->
gpart
!=
NULL
)
ret
[
0
]
=
gravity_get_comoving_potential
(
p
->
gpart
);
else
ret
[
0
]
=
0
.
f
;
}
/**
* @brief Specifies which particle fields to write to a dataset
*
...
...
@@ -148,7 +157,7 @@ INLINE static void hydro_write_particles(const struct part* parts,
struct
io_props
*
list
,
int
*
num_fields
)
{
*
num_fields
=
9
;
*
num_fields
=
10
;
/* List what we want to write */
list
[
0
]
=
io_make_output_field_convert_part
(
"Coordinates"
,
DOUBLE
,
3
,
...
...
@@ -172,6 +181,9 @@ INLINE static void hydro_write_particles(const struct part* parts,
list
[
8
]
=
io_make_output_field_convert_part
(
"Entropy"
,
FLOAT
,
1
,
UNIT_CONV_ENTROPY_PER_UNIT_MASS
,
parts
,
xparts
,
convert_S
);
list
[
9
]
=
io_make_output_field_convert_part
(
"Potential"
,
FLOAT
,
1
,
UNIT_CONV_POTENTIAL
,
parts
,
xparts
,
convert_part_potential
);
}
/**
...
...
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