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
10405012
Commit
10405012
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Make the cooling compatible with GIZMO as well. Added Stefan and Massimiliano to the author list.
parent
82d4f18f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
AUTHORS
+2
-0
2 additions, 0 deletions
AUTHORS
src/cooling/const_lambda/cooling.h
+1
-1
1 addition, 1 deletion
src/cooling/const_lambda/cooling.h
src/hydro/Gizmo/hydro.h
+32
-0
32 additions, 0 deletions
src/hydro/Gizmo/hydro.h
with
35 additions
and
1 deletion
AUTHORS
+
2
−
0
View file @
10405012
...
@@ -8,3 +8,5 @@ John A. Regan john.a.regan@durham.ac.uk
...
@@ -8,3 +8,5 @@ John A. Regan john.a.regan@durham.ac.uk
Angus Lepper angus.lepper@ed.ac.uk
Angus Lepper angus.lepper@ed.ac.uk
Tom Theuns tom.theuns@durham.ac.uk
Tom Theuns tom.theuns@durham.ac.uk
Richard G. Bower r.g.bower@durham.ac.uk
Richard G. Bower r.g.bower@durham.ac.uk
Stefan Arridge stefan.arridge@durham.ac.uk
Massimiliano Culpo massimiliano.culpo@googlemail.com
This diff is collapsed.
Click to expand it.
src/cooling/const_lambda/cooling.h
+
1
−
1
View file @
10405012
...
@@ -72,7 +72,7 @@ __attribute__((always_inline)) INLINE static float cooling_rate(
...
@@ -72,7 +72,7 @@ __attribute__((always_inline)) INLINE static float cooling_rate(
/* Get particle properties */
/* Get particle properties */
/* Density */
/* Density */
const
float
rho
=
p
->
rho
;
const
float
rho
=
hydro_get_density
(
p
)
;
/* Get cooling function properties */
/* Get cooling function properties */
const
float
X_H
=
cooling
->
hydrogen_mass_abundance
;
const
float
X_H
=
cooling
->
hydrogen_mass_abundance
;
/* lambda should always be set in cgs units */
/* lambda should always be set in cgs units */
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Gizmo/hydro.h
+
32
−
0
View file @
10405012
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include
<float.h>
#include
<float.h>
#include
"adiabatic_index.h"
#include
"adiabatic_index.h"
#include
"approx_math.h"
#include
"approx_math.h"
#include
"equation_of_state.h"
#include
"hydro_gradients.h"
#include
"hydro_gradients.h"
#include
"minmax.h"
#include
"minmax.h"
...
@@ -502,3 +503,34 @@ __attribute__((always_inline)) INLINE static float hydro_get_density(
...
@@ -502,3 +503,34 @@ __attribute__((always_inline)) INLINE static float hydro_get_density(
return
p
->
primitives
.
rho
;
return
p
->
primitives
.
rho
;
}
}
/**
* @brief Modifies the thermal state of a particle to the imposed internal
* energy
*
* This overrides the current state of the particle but does *not* change its
* time-derivatives
*
* @param p The particle
* @param u The new internal energy
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_set_internal_energy
(
struct
part
*
restrict
p
,
float
u
)
{
p
->
conserved
.
energy
=
u
;
}
/**
* @brief Modifies the thermal state of a particle to the imposed entropy
*
* This overrides the current state of the particle but does *not* change its
* time-derivatives
*
* @param p The particle
* @param S The new entropy
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_set_entropy
(
struct
part
*
restrict
p
,
float
S
)
{
p
->
conserved
.
energy
=
gas_internal_energy_from_entropy
(
p
->
primitives
.
rho
,
S
);
}
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