Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuickSched
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
QuickSched
Commits
0cbf4d4a
Commit
0cbf4d4a
authored
10 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
The tree walk for cell-multipoles now only recurses if both the children are not leaves.
parent
8057be2e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/test_bh_sorted.c
+32
-26
32 additions, 26 deletions
examples/test_bh_sorted.c
with
32 additions
and
26 deletions
examples/test_bh_sorted.c
+
32
−
26
View file @
0cbf4d4a
...
...
@@ -804,40 +804,46 @@ static inline void iact_pair_pc(struct cell *ci, struct cell *cj, struct cell *l
if
(
!
is_inside
(
leaf
,
ci
)
)
error
(
"The impossible has happened: The leaf is not within ci"
);
/* Are the cells
NOT
direct neighbours? */
/* Are the cells direct neighbours? */
if
(
!
are_neighbours
(
ci
,
cj
)
)
error
(
"Cells are not neighours"
);
#endif
/* Are both cells split ? */
if
(
ci
->
split
&&
cj
->
split
)
{
if
(
!
ci
->
split
||
!
cj
->
split
)
error
(
"One of the cells is not split !"
);
#endif
/* Let's find in which subcell of ci the leaf is */
for
(
cp
=
ci
->
firstchild
;
cp
!=
ci
->
sibling
;
cp
=
cp
->
sibling
)
{
if
(
is_inside
(
leaf
,
cp
)
)
break
;
}
/* Let's find in which subcell of ci the leaf is */
for
(
cp
=
ci
->
firstchild
;
cp
!=
ci
->
sibling
;
cp
=
cp
->
sibling
)
{
if
(
are_neighbours
(
cp
,
cj
)
)
{
/* Now interact this subcell with all subcells of cj */
for
(
cps
=
cj
->
firstchild
;
cps
!=
cj
->
sibling
;
cps
=
cps
->
sibling
)
{
/* Check whether we have to recurse or can directly jump to the multipole calculation */
if
(
are_neighbours
(
cp
,
cps
)
)
iact_pair_pc
(
cp
,
cps
,
leaf
);
else
make_interact_pc
(
leaf
,
cps
);
}
}
else
{
if
(
is_inside
(
leaf
,
cp
)
)
break
;
}
if
(
are_neighbours
(
cp
,
cj
)
)
{
/* Now interact this subcell with all subcells of cj */
for
(
cps
=
cj
->
firstchild
;
cps
!=
cj
->
sibling
;
cps
=
cps
->
sibling
)
{
/* If cp is not a neoghbour of cj, we can directly interact with the multipoles */
for
(
cps
=
cj
->
firstchild
;
cps
!=
cj
->
sibling
;
cps
=
cps
->
sibling
)
{
/* Check whether we have to recurse or can directly jump to the multipole calculation */
if
(
are_neighbours
(
cp
,
cps
)
)
{
/* We only recurse if the children are split */
if
(
cp
->
split
&&
cps
->
split
)
{
iact_pair_pc
(
cp
,
cps
,
leaf
);
}
}
else
{
make_interact_pc
(
leaf
,
cps
);
}
}
}
}
}
else
{
/* If cp is not a neoghbour of cj, we can directly interact with the multipoles */
for
(
cps
=
cj
->
firstchild
;
cps
!=
cj
->
sibling
;
cps
=
cps
->
sibling
)
{
make_interact_pc
(
leaf
,
cps
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment