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
6d077c19
Commit
6d077c19
authored
Aug 12, 2016
by
Matthieu Schaller
Browse files
Extract constant factor out of loop for dS/dt in GADGET-SPH
parent
8f24cc3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gadget2/hydro.h
View file @
6d077c19
...
...
@@ -320,7 +320,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_force(
p
->
force
.
h_dt
*=
p
->
h
*
hydro_dimension_inv
;
p
->
entropy_dt
*=
hydro_gamma_minus_one
*
pow_minus_gamma_minus_one
(
p
->
rho
);
p
->
entropy_dt
*=
0
.
5
f
*
hydro_gamma_minus_one
*
pow_minus_gamma_minus_one
(
p
->
rho
);
}
/**
...
...
src/hydro/Gadget2/hydro_iact.h
View file @
6d077c19
...
...
@@ -469,8 +469,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
pj
->
force
.
v_sig
=
fmaxf
(
pj
->
force
.
v_sig
,
v_sig
);
/* Change in entropy */
pi
->
entropy_dt
+=
0
.
5
f
*
mj
*
visc_term
*
dvdr
;
pj
->
entropy_dt
+=
0
.
5
f
*
mi
*
visc_term
*
dvdr
;
pi
->
entropy_dt
+=
mj
*
visc_term
*
dvdr
;
pj
->
entropy_dt
+=
mi
*
visc_term
*
dvdr
;
}
/**
...
...
@@ -631,7 +631,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_vec_force(
pjh_dt
.
v
=
mi
.
v
*
dvdr
.
v
*
ri
.
v
/
pirho
.
v
*
wj_dr
.
v
;
/* Change in entropy */
entropy_dt
.
v
=
vec_set1
(
0
.
5
f
)
*
visc_term
.
v
*
dvdr
.
v
;
entropy_dt
.
v
=
visc_term
.
v
*
dvdr
.
v
;
/* Store the forces back on the particles. */
for
(
k
=
0
;
k
<
VEC_SIZE
;
k
++
)
{
...
...
@@ -738,7 +738,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
pi
->
force
.
v_sig
=
fmaxf
(
pi
->
force
.
v_sig
,
v_sig
);
/* Change in entropy */
pi
->
entropy_dt
+=
0
.
5
f
*
mj
*
visc_term
*
dvdr
;
pi
->
entropy_dt
+=
mj
*
visc_term
*
dvdr
;
}
/**
...
...
@@ -894,7 +894,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_vec_force(
pih_dt
.
v
=
mj
.
v
*
dvdr
.
v
*
ri
.
v
/
pjrho
.
v
*
wi_dr
.
v
;
/* Change in entropy */
entropy_dt
.
v
=
vec_set1
(
0
.
5
f
)
*
mj
.
v
*
visc_term
.
v
*
dvdr
.
v
;
entropy_dt
.
v
=
mj
.
v
*
visc_term
.
v
*
dvdr
.
v
;
/* Store the forces back on the particles. */
for
(
k
=
0
;
k
<
VEC_SIZE
;
k
++
)
{
...
...
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