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
b7869d73
Commit
b7869d73
authored
Feb 14, 2016
by
Matthieu Schaller
Browse files
New interface for kick_extra
parent
cefdb664
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/hydro/Default/hydro.h
View file @
b7869d73
...
...
@@ -194,14 +194,15 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_end_force
(
struct
part
*
p
)
{}
/**
* @brief Kick the additional variables
*
* @param p The particle to act upon
* @param dt The time-step for this kick
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{}
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{}
/**
* @brief Converts hydro quantity of a particle
...
...
src/hydro/Gadget2/hydro.h
View file @
b7869d73
...
...
@@ -190,13 +190,18 @@ __attribute__((always_inline))
(
const_hydro_gamma
-
1
.
f
)
*
powf
(
p
->
rho
,
-
(
const_hydro_gamma
-
1
.
f
));
}
/**
* @brief Kick the additional variables
*
* @param p The particle to act upon
* @param xp The particle extended data to act upon
* @param dt The time-step for this kick
* @param half_dt The half time-step for this kick
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
struct
xpart
*
xp
,
float
dt
,
float
half_dt
)
{
/* Do not decrease the entropy (temperature) by more than a factor of 2*/
const
float
entropy_change
=
p
->
entropy_dt
*
dt
;
...
...
src/hydro/Minimal/hydro.h
View file @
b7869d73
...
...
@@ -156,10 +156,20 @@ __attribute__((always_inline))
* @brief Kick the additional variables
*
* @param p The particle to act upon
* @param xp The particle extended data to act upon
* @param dt The time-step for this kick
* @param half_dt The half time-step for this kick
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{}
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
struct
xpart
*
xp
,
float
dt
,
float
half_dt
)
{
/* Kick in momentum space */
xp
->
u_full
+=
p
->
u_dt
*
dt
;
/* Get the predicted internal energy */
p
->
u
=
xp
->
u_full
-
half_dt
*
p
->
u_dt
;
}
/**
* @brief Converts hydro quantity of a particle
...
...
src/runner.c
View file @
b7869d73
...
...
@@ -930,7 +930,7 @@ void runner_dokick(struct runner *r, struct cell *c, int timer) {
/* p->v[2]); */
/* Extra kick work */
hydro_kick_extra
(
p
,
dt
);
hydro_kick_extra
(
p
,
xp
,
dt
,
half_
dt
);
}
/* Now collect quantities for statistics */
...
...
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