Skip to content
GitLab
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
4ed1c86e
Commit
4ed1c86e
authored
Apr 26, 2017
by
Matthieu Schaller
Browse files
Add the drifting and activity checks to the subset_naive interaction function
parent
fba0dd79
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner_doiact.h
View file @
4ed1c86e
...
...
@@ -459,9 +459,7 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
struct
part
*
restrict
parts_i
,
int
*
restrict
ind
,
int
count
,
struct
cell
*
restrict
cj
)
{
struct
engine
*
e
=
r
->
e
;
// error("Don't use in actual runs ! Slow code !");
const
struct
engine
*
e
=
r
->
e
;
#ifdef WITH_OLD_VECTORIZATION
int
icount
=
0
;
...
...
@@ -496,6 +494,12 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
const
float
hi
=
pi
->
h
;
const
float
hig2
=
hi
*
hi
*
kernel_gamma2
;
#ifdef SWIFT_DEBUG_CHECKS
if
(
!
part_is_active
(
pi
,
e
))
error
(
"Trying to correct smoothing length of inactive particle !"
);
#endif
/* Loop over the parts in cj. */
for
(
int
pjd
=
0
;
pjd
<
count_j
;
pjd
++
)
{
...
...
@@ -510,6 +514,14 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
r2
+=
dx
[
k
]
*
dx
[
k
];
}
#ifdef SWIFT_DEBUG_CHECKS
/* Check that particles have been drifted to the current time */
if
(
pi
->
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pi not drifted to current time"
);
if
(
pj
->
ti_drift
!=
e
->
ti_current
)
error
(
"Particle pj not drifted to current time"
);
#endif
/* Hit or miss? */
if
(
r2
<
hig2
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment