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
03ee72ee
Commit
03ee72ee
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Remove/add the total number found in the group when reassigning group roots.
parent
831f95a4
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
+16
-16
16 additions, 16 deletions
src/fof.c
with
16 additions
and
16 deletions
src/fof.c
+
16
−
16
View file @
03ee72ee
...
@@ -196,13 +196,13 @@ void fof_search_serial(struct space *s) {
...
@@ -196,13 +196,13 @@ void fof_search_serial(struct space *s) {
if
(
root_j
<
root_i
)
{
if
(
root_j
<
root_i
)
{
pid
[
root_i
]
=
root_j
;
pid
[
root_i
]
=
root_j
;
num_in_groups
[
root_i
]
--
;
num_in_groups
[
root_
j
]
+=
num_in_groups
[
root_
i
];
num_in_groups
[
root_
j
]
++
;
num_in_groups
[
root_
i
]
-=
num_in_groups
[
root_i
]
;
}
}
else
{
else
{
pid
[
root_j
]
=
root_i
;
pid
[
root_j
]
=
root_i
;
num_in_groups
[
root_j
]
--
;
num_in_groups
[
root_
i
]
+=
num_in_groups
[
root_
j
];
num_in_groups
[
root_
i
]
++
;
num_in_groups
[
root_
j
]
-=
num_in_groups
[
root_j
]
;
}
}
num_groups
--
;
num_groups
--
;
...
@@ -277,13 +277,13 @@ void fof_search_cell(struct space *s, struct cell *c, int *pid, int *num_in_grou
...
@@ -277,13 +277,13 @@ void fof_search_cell(struct space *s, struct cell *c, int *pid, int *num_in_grou
if
(
root_j
<
root_i
)
{
if
(
root_j
<
root_i
)
{
pid
[
root_i
]
=
root_j
;
pid
[
root_i
]
=
root_j
;
num_in_groups
[
root_i
]
--
;
num_in_groups
[
root_
j
]
+=
num_in_groups
[
root_
i
];
num_in_groups
[
root_
j
]
++
;
num_in_groups
[
root_
i
]
-=
num_in_groups
[
root_i
]
;
}
}
else
{
else
{
pid
[
root_j
]
=
root_i
;
pid
[
root_j
]
=
root_i
;
num_in_groups
[
root_j
]
--
;
num_in_groups
[
root_
i
]
+=
num_in_groups
[
root_
j
];
num_in_groups
[
root_
i
]
++
;
num_in_groups
[
root_
j
]
-=
num_in_groups
[
root_j
]
;
}
}
(
*
num_groups
)
--
;
(
*
num_groups
)
--
;
...
@@ -310,10 +310,10 @@ void fof_search_pair_cells(struct space *s, struct cell *ci, struct cell *cj, in
...
@@ -310,10 +310,10 @@ void fof_search_pair_cells(struct space *s, struct cell *ci, struct cell *cj, in
double
diff
[
3
];
double
diff
[
3
];
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
diff
[
k
]
=
cj
->
loc
[
k
]
-
ci
->
loc
[
k
];
diff
[
k
]
=
cj
->
loc
[
k
]
-
ci
->
loc
[
k
];
if
(
periodic
&&
diff
[
k
]
<
-
s
->
dim
[
k
]
/
2
)
if
(
periodic
&&
diff
[
k
]
<
-
dim
[
k
]
/
2
)
shift
[
k
]
=
s
->
dim
[
k
];
shift
[
k
]
=
dim
[
k
];
else
if
(
periodic
&&
diff
[
k
]
>
s
->
dim
[
k
]
/
2
)
else
if
(
periodic
&&
diff
[
k
]
>
dim
[
k
]
/
2
)
shift
[
k
]
=
-
s
->
dim
[
k
];
shift
[
k
]
=
-
dim
[
k
];
else
else
shift
[
k
]
=
0
.
0
;
shift
[
k
]
=
0
.
0
;
diff
[
k
]
+=
shift
[
k
];
diff
[
k
]
+=
shift
[
k
];
...
@@ -357,13 +357,13 @@ void fof_search_pair_cells(struct space *s, struct cell *ci, struct cell *cj, in
...
@@ -357,13 +357,13 @@ void fof_search_pair_cells(struct space *s, struct cell *ci, struct cell *cj, in
if
(
root_j
<
root_i
)
{
if
(
root_j
<
root_i
)
{
pid
[
root_i
]
=
root_j
;
pid
[
root_i
]
=
root_j
;
num_in_groups
[
root_i
]
--
;
num_in_groups
[
root_
j
]
+=
num_in_groups
[
root_
i
];
num_in_groups
[
root_
j
]
++
;
num_in_groups
[
root_
i
]
-=
num_in_groups
[
root_i
]
;
}
}
else
{
else
{
pid
[
root_j
]
=
root_i
;
pid
[
root_j
]
=
root_i
;
num_in_groups
[
root_j
]
--
;
num_in_groups
[
root_
i
]
+=
num_in_groups
[
root_
j
];
num_in_groups
[
root_
i
]
++
;
num_in_groups
[
root_
j
]
-=
num_in_groups
[
root_j
]
;
}
}
(
*
num_groups
)
--
;
(
*
num_groups
)
--
;
...
...
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