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
c08fce03
Commit
c08fce03
authored
Aug 18, 2017
by
Matthieu Schaller
Browse files
Also use quadrupole P-M interactions when running the truncated pair_pp a the lead level
parent
797090ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner_doiact_grav.h
View file @
c08fce03
...
...
@@ -494,8 +494,8 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
/* Recover the multipole info and shift the CoM locations */
const
float
rmax_i
=
ci
->
multipole
->
r_max
;
const
float
rmax_j
=
cj
->
multipole
->
r_max
;
const
floa
t
multi
_mass
_i
=
ci
->
multipole
->
m_pole
.
M_000
;
const
floa
t
multi
_mass
_j
=
cj
->
multipole
->
m_pole
.
M_000
;
const
struc
t
multi
pole
*
multi
_i
=
&
ci
->
multipole
->
m_pole
;
const
struc
t
multi
pole
*
multi
_j
=
&
cj
->
multipole
->
m_pole
;
const
float
CoM_i
[
3
]
=
{
ci
->
multipole
->
CoM
[
0
]
-
loc_mean
[
0
],
ci
->
multipole
->
CoM
[
1
]
-
loc_mean
[
1
],
ci
->
multipole
->
CoM
[
2
]
-
loc_mean
[
2
]};
...
...
@@ -533,14 +533,14 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
if
(
gravity_multipole_accept
(
0
.,
rmax_j
,
theta_crit2
,
r2
))
{
/* Interact! */
float
f_
ij
;
runner_iact_grav_p
p_truncated
(
r2
,
h2_i
,
h_inv
_i
,
h_inv
3
_i
,
multi_
mass_j
,
rlr_inv
,
&
f_
ij
);
float
f_
x
,
f_y
,
f_z
;
runner_iact_grav_p
m
(
dx
,
dy
,
dz
,
r2
,
h
_i
,
h_inv_i
,
multi_
j
,
&
f_x
,
&
f_y
,
&
f_
z
);
/* Store it back */
ci_cache
->
a_x
[
pid
]
=
-
f_
ij
*
d
x
;
ci_cache
->
a_y
[
pid
]
=
-
f_
ij
*
d
y
;
ci_cache
->
a_z
[
pid
]
=
-
f_
ij
*
d
z
;
ci_cache
->
a_x
[
pid
]
=
f_x
;
ci_cache
->
a_y
[
pid
]
=
f_y
;
ci_cache
->
a_z
[
pid
]
=
f_z
;
#ifdef SWIFT_DEBUG_CHECKS
/* Update the interaction counter */
...
...
@@ -639,14 +639,14 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
if
(
gravity_multipole_accept
(
0
.,
rmax_i
,
theta_crit2
,
r2
))
{
/* Interact! */
float
f_
ji
;
runner_iact_grav_p
p_truncated
(
r2
,
h2_j
,
h_inv
_j
,
h_inv
3
_j
,
multi_
mass_i
,
rlr_inv
,
&
f_
ji
);
float
f_
x
,
f_y
,
f_z
;
runner_iact_grav_p
m
(
dx
,
dy
,
dz
,
r2
,
h
_j
,
h_inv_j
,
multi_
i
,
&
f_x
,
&
f_y
,
&
f_
z
);
/* Store it back */
cj_cache
->
a_x
[
pjd
]
=
-
f_
ji
*
d
x
;
cj_cache
->
a_y
[
pjd
]
=
-
f_
ji
*
d
y
;
cj_cache
->
a_z
[
pjd
]
=
-
f_
ji
*
d
z
;
cj_cache
->
a_x
[
pjd
]
=
f_x
;
cj_cache
->
a_y
[
pjd
]
=
f_y
;
cj_cache
->
a_z
[
pjd
]
=
f_z
;
#ifdef SWIFT_DEBUG_CHECKS
/* Update the interaction counter */
...
...
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