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
697f3946
Commit
697f3946
authored
Aug 10, 2016
by
Matthieu Schaller
Browse files
Add pressure to the snapshots
parent
68bf7943
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/dimension.h
View file @
697f3946
...
...
@@ -157,7 +157,7 @@ __attribute__((always_inline)) INLINE static vector pow_dimension_plus_one_vec(
#if defined(HYDRO_DIMENSION_3D)
const
vector
x2
=
(
vector
)
(
x
.
v
*
x
.
v
);
const
vector
x2
=
(
vector
)(
x
.
v
*
x
.
v
);
return
(
vector
)(
x2
.
v
*
x2
.
v
);
#elif defined(HYDRO_DIMENSION_2D)
...
...
src/hydro/Gadget2/hydro.h
View file @
697f3946
...
...
@@ -20,6 +20,8 @@
#include
"adiabatic_index.h"
#include
"dimension.h"
#include
"equation_of_state.h"
#include
"hydro_properties.h"
#include
"kernel_hydro.h"
/**
* @brief Returns the internal energy of a particle
...
...
src/hydro/Gadget2/hydro_io.h
View file @
697f3946
...
...
@@ -18,6 +18,7 @@
******************************************************************************/
#include
"adiabatic_index.h"
#include
"hydro.h"
#include
"io_properties.h"
#include
"kernel_hydro.h"
...
...
@@ -54,8 +55,12 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
float
convert_u
(
struct
engine
*
e
,
struct
part
*
p
)
{
return
p
->
entropy
*
pow_gamma_minus_one
(
p
->
rho
)
*
hydro_one_over_gamma_minus_one
;
return
hydro_get_internal_energy
(
p
,
0
);
}
float
convert_P
(
struct
engine
*
e
,
struct
part
*
p
)
{
return
hydro_get_pressure
(
p
,
0
);
}
/**
...
...
@@ -68,7 +73,7 @@ float convert_u(struct engine* e, struct part* p) {
void
hydro_write_particles
(
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
(
"Coordinates"
,
DOUBLE
,
3
,
UNIT_CONV_LENGTH
,
...
...
@@ -90,6 +95,8 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
list
[
8
]
=
io_make_output_field_convert_part
(
"InternalEnergy"
,
FLOAT
,
1
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
,
parts
,
rho
,
convert_u
);
list
[
9
]
=
io_make_output_field_convert_part
(
"Pressure"
,
FLOAT
,
1
,
UNIT_CONV_PRESSURE
,
parts
,
rho
,
convert_P
);
}
/**
...
...
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