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
328bd523
Commit
328bd523
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added temperature to the properties passed to VELOCIraptor.
parent
5c942443
No related branches found
No related tags found
2 merge requests
!721
Velociraptor outputs
,
!719
Velociraptor output strategy
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/swift_velociraptor_part.h
+3
-0
3 additions, 0 deletions
src/swift_velociraptor_part.h
src/velociraptor_interface.c
+27
-6
27 additions, 6 deletions
src/velociraptor_interface.c
with
30 additions
and
6 deletions
src/swift_velociraptor_part.h
+
3
−
0
View file @
328bd523
...
...
@@ -42,6 +42,9 @@ struct swift_vel_part {
/*! Internal energy of gas particle */
float
u
;
/*! Temperature of a gas particle */
float
T
;
/*! Type of the #gpart (DM, gas, star, ...) */
enum
part_type
type
;
...
...
This diff is collapsed.
Click to expand it.
src/velociraptor_interface.c
+
27
−
6
View file @
328bd523
...
...
@@ -27,6 +27,7 @@
#include
"velociraptor_interface.h"
/* Local includes. */
#include
"cooling.h"
#include
"engine.h"
#include
"hydro.h"
#include
"swift_velociraptor_part.h"
...
...
@@ -276,9 +277,17 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
#ifdef HAVE_VELOCIRAPTOR
const
struct
cosmology
*
cosmo
=
e
->
cosmology
;
const
struct
hydro_props
*
hydro_props
=
e
->
hydro_properties
;
const
struct
unit_system
*
us
=
e
->
internal_units
;
const
struct
phys_const
*
phys_const
=
e
->
physical_constants
;
const
struct
cooling_function_data
*
cool_func
=
e
->
cooling_func
;
/* Handle on the particles */
const
struct
space
*
s
=
e
->
s
;
const
struct
gpart
*
gparts
=
s
->
gparts
;
const
struct
part
*
parts
=
s
->
parts
;
const
struct
xpart
*
xparts
=
s
->
xparts
;
const
struct
gpart
*
gparts
=
s
->
gparts
;
const
struct
spart
*
sparts
=
s
->
sparts
;
const
size_t
nr_gparts
=
s
->
nr_gparts
;
const
size_t
nr_parts
=
s
->
nr_parts
;
...
...
@@ -432,7 +441,14 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
const
float
a_inv
=
e
->
cosmology
->
a_inv
;
/* Convert particle properties into VELOCIraptor units */
/* Convert particle properties into VELOCIraptor units.
* VELOCIraptor wants:
* - Co-moving positions,
* - Peculiar velocities,
* - Co-moving potential,
* - Physical internal energy (for the gas),
* - Temperatures (for the gas).
*/
for
(
size_t
i
=
0
;
i
<
nr_gparts
;
i
++
)
{
swift_parts
[
i
].
x
[
0
]
=
gparts
[
i
].
x
[
0
];
...
...
@@ -459,23 +475,28 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
* energies. */
switch
(
gparts
[
i
].
type
)
{
case
swift_type_gas
:
case
swift_type_gas
:
{
const
struct
part
*
p
=
&
parts
[
-
gparts
[
i
].
id_or_neg_offset
];
const
struct
xpart
*
xp
=
&
xparts
[
-
gparts
[
i
].
id_or_neg_offset
];
swift_parts
[
i
].
id
=
parts
[
-
gparts
[
i
].
id_or_neg_offset
].
id
;
swift_parts
[
i
].
u
=
hydro_get_drifted_physical_internal_energy
(
&
parts
[
-
gparts
[
i
].
id_or_neg_offset
],
e
->
cosmology
);
break
;
swift_parts
[
i
].
u
=
hydro_get_drifted_physical_internal_energy
(
p
,
cosmo
);
swift_parts
[
i
].
T
=
cooling_get_temperature
(
phys_const
,
hydro_props
,
us
,
cosmo
,
cool_func
,
p
,
xp
);
}
break
;
case
swift_type_stars
:
swift_parts
[
i
].
id
=
sparts
[
-
gparts
[
i
].
id_or_neg_offset
].
id
;
swift_parts
[
i
].
u
=
0
.
f
;
swift_parts
[
i
].
T
=
0
.
f
;
break
;
case
swift_type_dark_matter
:
swift_parts
[
i
].
id
=
gparts
[
i
].
id_or_neg_offset
;
swift_parts
[
i
].
u
=
0
.
f
;
swift_parts
[
i
].
T
=
0
.
f
;
break
;
default:
...
...
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