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
95cb0e07
Commit
95cb0e07
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Correctly skip inactive particles in the P-P pair tasks.
parent
b2b4a66f
No related branches found
No related tags found
1 merge request
!398
Use particle caches for the gravity P-P interactions. Ewald summation for the gravity force checks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact_grav.h
+20
-4
20 additions, 4 deletions
src/runner_doiact_grav.h
with
20 additions
and
4 deletions
src/runner_doiact_grav.h
+
20
−
4
View file @
95cb0e07
...
...
@@ -200,6 +200,9 @@ void runner_dopair_grav_pp_full(struct runner *r, struct cell *ci,
/* Loop over all particles in ci... */
for
(
int
pid
=
0
;
pid
<
gcount_i
;
pid
++
)
{
/* Skip inactive particles */
if
(
!
gpart_is_active
(
&
gparts_i
[
pid
],
e
))
continue
;
const
float
x_i
=
ci_cache
->
x
[
pid
];
const
float
y_i
=
ci_cache
->
y
[
pid
];
const
float
z_i
=
ci_cache
->
z
[
pid
];
...
...
@@ -272,7 +275,8 @@ void runner_dopair_grav_pp_full(struct runner *r, struct cell *ci,
a_z
-=
f_ij
*
dz
;
#ifdef SWIFT_DEBUG_CHECKS
gparts_i
[
pid
].
num_interacted
++
;
/* Update the interaction counter if it's not a padded gpart */
if
(
pjd
<
gcount_j
)
gparts_i
[
pid
].
num_interacted
++
;
#endif
}
...
...
@@ -289,6 +293,9 @@ void runner_dopair_grav_pp_full(struct runner *r, struct cell *ci,
/* Loop over all particles in ci... */
for
(
int
pjd
=
0
;
pjd
<
gcount_j
;
pjd
++
)
{
/* Skip inactive particles */
if
(
!
gpart_is_active
(
&
gparts_j
[
pjd
],
e
))
continue
;
const
float
x_j
=
cj_cache
->
x
[
pjd
];
const
float
y_j
=
cj_cache
->
y
[
pjd
];
const
float
z_j
=
cj_cache
->
z
[
pjd
];
...
...
@@ -361,7 +368,8 @@ void runner_dopair_grav_pp_full(struct runner *r, struct cell *ci,
a_z
-=
f_ji
*
dz
;
#ifdef SWIFT_DEBUG_CHECKS
gparts_j
[
pjd
].
num_interacted
++
;
/* Update the interaction counter if it's not a padded gpart */
if
(
pid
<
gcount_i
)
gparts_j
[
pjd
].
num_interacted
++
;
#endif
}
...
...
@@ -535,6 +543,9 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
/* Loop over all particles in ci... */
for
(
int
pid
=
0
;
pid
<
gcount_i
;
pid
++
)
{
/* Skip inactive particles */
if
(
!
gpart_is_active
(
&
gparts_i
[
pid
],
e
))
continue
;
const
float
x_i
=
ci_cache
->
x
[
pid
];
const
float
y_i
=
ci_cache
->
y
[
pid
];
const
float
z_i
=
ci_cache
->
z
[
pid
];
...
...
@@ -612,7 +623,8 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
a_z
-=
f_ij
*
dz
;
#ifdef SWIFT_DEBUG_CHECKS
gparts_i
[
pid
].
num_interacted
++
;
/* Update the interaction counter if it's not a padded gpart */
if
(
pjd
<
gcount_j
)
gparts_i
[
pid
].
num_interacted
++
;
#endif
}
...
...
@@ -629,6 +641,9 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
/* Loop over all particles in ci... */
for
(
int
pjd
=
0
;
pjd
<
gcount_j
;
pjd
++
)
{
/* Skip inactive particles */
if
(
!
gpart_is_active
(
&
gparts_j
[
pjd
],
e
))
continue
;
const
float
x_j
=
cj_cache
->
x
[
pjd
];
const
float
y_j
=
cj_cache
->
y
[
pjd
];
const
float
z_j
=
cj_cache
->
z
[
pjd
];
...
...
@@ -706,7 +721,8 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
a_z
-=
f_ji
*
dz
;
#ifdef SWIFT_DEBUG_CHECKS
gparts_j
[
pjd
].
num_interacted
++
;
/* Update the interaction counter if it's not a padded gpart */
if
(
pid
<
gcount_i
)
gparts_j
[
pjd
].
num_interacted
++
;
#endif
}
...
...
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