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
697f3946
Commit
697f3946
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Add pressure to the snapshots
parent
68bf7943
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!216
Hydrodynamics in 2D + New test cases
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/dimension.h
+1
-1
1 addition, 1 deletion
src/dimension.h
src/hydro/Gadget2/hydro.h
+2
-0
2 additions, 0 deletions
src/hydro/Gadget2/hydro.h
src/hydro/Gadget2/hydro_io.h
+10
-3
10 additions, 3 deletions
src/hydro/Gadget2/hydro_io.h
with
13 additions
and
4 deletions
src/dimension.h
+
1
−
1
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)
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Gadget2/hydro.h
+
2
−
0
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
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Gadget2/hydro_io.h
+
10
−
3
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
);
}
/**
...
...
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