Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
SWIFTsim
Commits
69d84572
Commit
69d84572
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Skip particles inside the same group earlier when performing a FOF search on a single cell.
parent
579e205a
No related branches found
No related tags found
1 merge request
!543
Fof
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fof.c
+9
-10
9 additions, 10 deletions
src/fof.c
with
9 additions
and
10 deletions
src/fof.c
+
9
−
10
View file @
69d84572
...
@@ -282,6 +282,12 @@ void fof_search_cell(struct space *s, struct cell *c) {
...
@@ -282,6 +282,12 @@ void fof_search_cell(struct space *s, struct cell *c) {
for
(
size_t
j
=
i
+
1
;
j
<
count
;
j
++
)
{
for
(
size_t
j
=
i
+
1
;
j
<
count
;
j
++
)
{
/* Find the root of pj. */
const
int
root_j
=
fof_find
(
offset
[
j
],
group_id
);
/* Skip particles in the same group. */
if
(
root_i
==
root_j
)
continue
;
struct
gpart
*
pj
=
&
gparts
[
j
];
struct
gpart
*
pj
=
&
gparts
[
j
];
const
double
pjx
=
pj
->
x
[
0
];
const
double
pjx
=
pj
->
x
[
0
];
const
double
pjy
=
pj
->
x
[
1
];
const
double
pjy
=
pj
->
x
[
1
];
...
@@ -299,12 +305,6 @@ void fof_search_cell(struct space *s, struct cell *c) {
...
@@ -299,12 +305,6 @@ void fof_search_cell(struct space *s, struct cell *c) {
r2
+=
dx
[
k
]
*
dx
[
k
];
r2
+=
dx
[
k
]
*
dx
[
k
];
}
}
/* Find the root of pj. */
const
int
root_j
=
fof_find
(
offset
[
j
],
group_id
);
/* Skip particles in the same group. */
if
(
root_i
==
root_j
)
continue
;
/* Hit or miss? */
/* Hit or miss? */
if
(
r2
<
l_x2
)
{
if
(
r2
<
l_x2
)
{
...
@@ -368,20 +368,19 @@ void fof_search_pair_cells(struct space *s, struct cell *ci, struct cell *cj) {
...
@@ -368,20 +368,19 @@ void fof_search_pair_cells(struct space *s, struct cell *ci, struct cell *cj) {
for
(
size_t
j
=
0
;
j
<
count_j
;
j
++
)
{
for
(
size_t
j
=
0
;
j
<
count_j
;
j
++
)
{
struct
gpart
*
pj
=
&
gparts_j
[
j
];
/* Find the root of pj. */
/* Find the root of pj. */
const
int
root_j
=
fof_find
(
offset_j
[
j
],
group_id
);
const
int
root_j
=
fof_find
(
offset_j
[
j
],
group_id
);
/* Skip particles in the same group. */
/* Skip particles in the same group. */
if
(
root_i
==
root_j
)
continue
;
if
(
root_i
==
root_j
)
continue
;
/* Compute pairwise distance, remembering to account for boundary
struct
gpart
*
pj
=
&
gparts_j
[
j
];
* conditions. */
const
double
pjx
=
pj
->
x
[
0
];
const
double
pjx
=
pj
->
x
[
0
];
const
double
pjy
=
pj
->
x
[
1
];
const
double
pjy
=
pj
->
x
[
1
];
const
double
pjz
=
pj
->
x
[
2
];
const
double
pjz
=
pj
->
x
[
2
];
/* Compute pairwise distance, remembering to account for boundary
* conditions. */
float
dx
[
3
],
r2
=
0
.
0
f
;
float
dx
[
3
],
r2
=
0
.
0
f
;
dx
[
0
]
=
pix
-
pjx
;
dx
[
0
]
=
pix
-
pjx
;
dx
[
1
]
=
piy
-
pjy
;
dx
[
1
]
=
piy
-
pjy
;
...
...
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