Skip to content
GitLab
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
9ff194f4
Commit
9ff194f4
authored
Mar 11, 2018
by
Matthieu Schaller
Browse files
When converting internal energy to entropy at startup, apply the correct cosmology factor.
parent
4517ef2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
9ff194f4
...
...
@@ -1081,23 +1081,6 @@ void cell_sanitize(struct cell *c, int treated) {
c
->
h_max
=
h_max
;
}
/**
* @brief Converts hydro quantities to a valid state after the initial density
* calculation
*
* @param c Cell to act upon
* @param data Unused parameter
*/
void
cell_convert_hydro
(
struct
cell
*
c
,
void
*
data
)
{
struct
part
*
p
=
c
->
parts
;
struct
xpart
*
xp
=
c
->
xparts
;
for
(
int
i
=
0
;
i
<
c
->
count
;
++
i
)
{
hydro_convert_quantities
(
&
p
[
i
],
&
xp
[
i
]);
}
}
/**
* @brief Cleans the links in a given cell.
*
...
...
src/cell.h
View file @
9ff194f4
...
...
@@ -492,7 +492,6 @@ int cell_getsize(struct cell *c);
int
cell_link_parts
(
struct
cell
*
c
,
struct
part
*
parts
);
int
cell_link_gparts
(
struct
cell
*
c
,
struct
gpart
*
gparts
);
int
cell_link_sparts
(
struct
cell
*
c
,
struct
spart
*
sparts
);
void
cell_convert_hydro
(
struct
cell
*
c
,
void
*
data
);
void
cell_clean_links
(
struct
cell
*
c
,
void
*
data
);
void
cell_make_multipoles
(
struct
cell
*
c
,
integertime_t
ti_current
);
void
cell_check_multipole
(
struct
cell
*
c
,
void
*
data
);
...
...
src/space.c
View file @
9ff194f4
...
...
@@ -2813,11 +2813,12 @@ void space_init_gparts(struct space *s, int verbose) {
void
space_convert_quantities_mapper
(
void
*
restrict
map_data
,
int
count
,
void
*
restrict
extra_data
)
{
struct
space
*
s
=
(
struct
space
*
)
extra_data
;
const
struct
cosmology
*
cosmo
=
s
->
e
->
cosmology
;
struct
part
*
restrict
parts
=
(
struct
part
*
)
map_data
;
const
ptrdiff_t
index
=
parts
-
s
->
parts
;
struct
xpart
*
restrict
xparts
=
s
->
xparts
+
index
;
for
(
int
k
=
0
;
k
<
count
;
k
++
)
hydro_convert_quantities
(
&
parts
[
k
],
&
xparts
[
k
]);
hydro_convert_quantities
(
&
parts
[
k
],
&
xparts
[
k
]
,
cosmo
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment