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
882305fe
Commit
882305fe
authored
Nov 09, 2017
by
Matthieu Schaller
Browse files
Use eos.isothermal_internal_energy instead of the old constant everywhere in gizmo as well.
parent
b35e7191
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gizmo/hydro.h
View file @
882305fe
...
...
@@ -131,7 +131,7 @@ __attribute__((always_inline)) INLINE static void hydro_first_init_part(
energy (as in Gadget) */
#if defined(EOS_ISOTHERMAL_GAS)
/* this overwrites the internal energy from the initial condition file */
p
->
conserved
.
energy
=
mass
*
const_
isothermal_internal_energy
;
p
->
conserved
.
energy
=
mass
*
eos
.
isothermal_internal_energy
;
#else
p
->
conserved
.
energy
*=
mass
;
#endif
...
...
@@ -608,7 +608,7 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
p
->
conserved
.
momentum
[
1
]
+=
p
->
conserved
.
flux
.
momentum
[
1
];
p
->
conserved
.
momentum
[
2
]
+=
p
->
conserved
.
flux
.
momentum
[
2
];
#if defined(EOS_ISOTHERMAL_GAS)
p
->
conserved
.
energy
=
p
->
conserved
.
mass
*
const_
isothermal_internal_energy
;
p
->
conserved
.
energy
=
p
->
conserved
.
mass
*
eos
.
isothermal_internal_energy
;
#else
p
->
conserved
.
energy
+=
p
->
conserved
.
flux
.
energy
;
#endif
...
...
@@ -709,9 +709,9 @@ __attribute__((always_inline)) INLINE static float hydro_get_internal_energy(
if
(
p
->
primitives
.
rho
>
0
.)
{
#ifdef EOS_ISOTHERMAL_GAS
return
p
->
primitives
.
P
/
hydro_gamma_minus_one
/
p
->
primitives
.
rho
;
return
eos
.
isothermal_internal_energy
;
#else
return
const_isothermal_internal_energy
;
return
p
->
primitives
.
P
/
hydro_gamma_minus_one
/
p
->
primitives
.
rho
;
#endif
}
else
{
return
0
.;
...
...
@@ -743,7 +743,7 @@ __attribute__((always_inline)) INLINE static float hydro_get_soundspeed(
if
(
p
->
primitives
.
rho
>
0
.)
{
#ifdef EOS_ISOTHERMAL_GAS
return
sqrtf
(
const_
isothermal_internal_energy
*
hydro_gamma
*
return
sqrtf
(
eos
.
isothermal_internal_energy
*
hydro_gamma
*
hydro_gamma_minus_one
);
#else
return
sqrtf
(
hydro_gamma
*
p
->
primitives
.
P
/
p
->
primitives
.
rho
);
...
...
src/hydro/Gizmo/hydro_io.h
View file @
882305fe
...
...
@@ -18,6 +18,7 @@
******************************************************************************/
#include
"adiabatic_index.h"
#include
"equation_of_state.h"
#include
"hydro_flux_limiters.h"
#include
"hydro_gradients.h"
#include
"hydro_slope_limiters.h"
...
...
@@ -73,7 +74,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
float
convert_u
(
struct
engine
*
e
,
struct
part
*
p
)
{
if
(
p
->
primitives
.
rho
>
0
.)
{
#ifdef EOS_ISOTHERMAL_GAS
return
const_
isothermal_internal_energy
;
return
eos
.
isothermal_internal_energy
;
#else
return
p
->
primitives
.
P
/
hydro_gamma_minus_one
/
p
->
primitives
.
rho
;
#endif
...
...
tests/testFFT.c
View file @
882305fe
...
...
@@ -78,7 +78,7 @@ int main() {
engine
.
nr_threads
=
1
;
engine
.
nodeID
=
0
;
engine_rank
=
0
;
struct
runner
runner
;
runner
.
e
=
&
engine
;
...
...
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