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
7e8d5d0b
Commit
7e8d5d0b
authored
Dec 04, 2017
by
Matthieu Schaller
Browse files
Do not recurse in the gravity pairs if the active cell is foreign.
parent
1ef92d72
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner_doiact_grav.h
View file @
7e8d5d0b
...
...
@@ -935,6 +935,7 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
/* Some constants */
const
struct
engine
*
e
=
r
->
e
;
const
struct
space
*
s
=
e
->
s
;
const
int
nodeID
=
e
->
nodeID
;
const
int
periodic
=
s
->
periodic
;
const
double
cell_width
=
s
->
width
[
0
];
const
double
dim
[
3
]
=
{
s
->
dim
[
0
],
s
->
dim
[
1
],
s
->
dim
[
2
]};
...
...
@@ -943,6 +944,11 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
const
double
max_distance
=
props
->
a_smooth
*
props
->
r_cut_max
*
cell_width
;
const
double
max_distance2
=
max_distance
*
max_distance
;
/* Anything to do here? */
if
(
!
((
cell_is_active
(
ci
,
e
)
&&
ci
->
nodeID
==
nodeID
)
||
(
cell_is_active
(
cj
,
e
)
&&
cj
->
nodeID
==
nodeID
)))
return
;
#ifdef SWIFT_DEBUG_CHECKS
const
int
gcount_i
=
ci
->
gcount
;
...
...
@@ -963,9 +969,6 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
TIMER_TIC
;
/* Anything to do here? */
if
(
!
cell_is_active
(
ci
,
e
)
&&
!
cell_is_active
(
cj
,
e
))
return
;
/* Recover the multipole information */
struct
gravity_tensors
*
const
multi_i
=
ci
->
multipole
;
struct
gravity_tensors
*
const
multi_j
=
cj
->
multipole
;
...
...
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