Skip to content
GitLab
Menu
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
d1dfe28b
Commit
d1dfe28b
authored
Feb 09, 2016
by
Matthieu Schaller
Browse files
Correct smoothing length time derivative in all cases
parent
3dfec79e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gadget2/hydro.h
View file @
d1dfe28b
...
...
@@ -168,6 +168,8 @@ __attribute__((always_inline))
p
->
a
[
1
]
=
0
.
0
f
;
p
->
a
[
2
]
=
0
.
0
f
;
p
->
force
.
h_dt
=
0
.
0
f
;
/* Reset the time derivatives. */
p
->
entropy_dt
=
0
.
0
f
;
...
...
@@ -203,7 +205,7 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra(
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_end_force
(
struct
part
*
p
)
{
p
->
entropy_dt
*=
(
const_hydro_gamma
-
1
.
f
)
*
powf
(
p
->
rho
,
-
(
const_hydro_gamma
-
1
.
f
));
}
...
...
src/hydro/Gadget2/hydro_iact.h
View file @
d1dfe28b
...
...
@@ -281,8 +281,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
pj
->
a
[
2
]
+=
acc
*
dx
[
2
];
/* Get the time derivative for h. */
pi
->
force
.
h_dt
-=
mj
*
dvdr
/
rhoj
*
wi_dr
;
pj
->
force
.
h_dt
-=
mi
*
dvdr
/
rhoi
*
wj_dr
;
pi
->
force
.
h_dt
-=
mj
*
dvdr
*
r_inv
/
rhoj
*
wi_dr
;
pj
->
force
.
h_dt
-=
mi
*
dvdr
*
r_inv
/
rhoi
*
wj_dr
;
/* Update the signal velocity. */
pi
->
v_sig
=
fmaxf
(
pi
->
v_sig
,
v_sig
);
...
...
@@ -371,7 +371,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
pi
->
a
[
2
]
-=
acc
*
dx
[
2
];
/* Get the time derivative for h. */
pi
->
force
.
h_dt
-=
mj
*
dvdr
/
rhoj
*
wi_dr
;
pi
->
force
.
h_dt
-=
mj
*
dvdr
*
r_inv
/
rhoj
*
wi_dr
;
/* Update the signal velocity. */
pi
->
v_sig
=
fmaxf
(
pi
->
v_sig
,
v_sig
);
...
...
src/runner.c
View file @
d1dfe28b
...
...
@@ -751,15 +751,16 @@ void runner_dodrift(struct runner *r, struct cell *c, int timer) {
hydro_predict_extra
(
p
,
xp
,
r
->
e
->
timeOld
,
r
->
e
->
time
);
/* if(p->id == 1000 || p->id == 515050 || p->id == 504849) */
/* message("%lld: current_t=%f t0=%f t1=%f v=[%.3e %.3e %.3e]\n",
*/
/* message("%lld: current_t=%f t0=%f t1=%f v=[%.3e %.3e %.3e] dh/dt=%.3e div_v=%.3e\n", */
/* p->id, */
/* r->e->time, */
/* r->e->timeOld, */
/* r->e->time, */
/* p->v[0], */
/* p->v[1], */
/* p->v[2]); */
/* p->v[2], */
/* p->force.h_dt * h_inv * dt, */
/* 0.333333f * p->div_v * dt); */
/* Compute motion since last cell construction */
const
float
dx
=
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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