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
740faaac
Commit
740faaac
authored
Apr 25, 2016
by
Matthieu Schaller
Browse files
Check that the received particles are at the correct position in time.
parent
f0e44d66
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
740faaac
...
...
@@ -1232,6 +1232,7 @@ void runner_dorecv_cell(struct runner *r, struct cell *c, int timer) {
const
struct
gpart
*
const
gparts
=
c
->
gparts
;
const
size_t
nr_parts
=
c
->
count
;
const
size_t
nr_gparts
=
c
->
gcount
;
const
int
ti_current
=
r
->
e
->
ti_current
;
TIMER_TIC
;
...
...
@@ -1241,13 +1242,17 @@ void runner_dorecv_cell(struct runner *r, struct cell *c, int timer) {
/* Collect everything... */
for
(
size_t
k
=
0
;
k
<
nr_parts
;
k
++
)
{
ti_end_min
=
min
(
ti_end_min
,
parts
[
k
].
ti_end
);
ti_end_max
=
max
(
ti_end_max
,
parts
[
k
].
ti_end
);
const
int
ti_end
=
parts
[
k
].
ti_end
;
if
(
ti_end
<
ti_current
)
error
(
"Received invalid particle !"
);
ti_end_min
=
min
(
ti_end_min
,
ti_end
);
ti_end_max
=
max
(
ti_end_max
,
ti_end
);
h_max
=
fmaxf
(
h_max
,
parts
[
k
].
h
);
}
for
(
size_t
k
=
0
;
k
<
nr_gparts
;
k
++
)
{
ti_end_min
=
min
(
ti_end_min
,
gparts
[
k
].
ti_end
);
ti_end_max
=
max
(
ti_end_max
,
gparts
[
k
].
ti_end
);
const
int
ti_end
=
gparts
[
k
].
ti_end
;
if
(
ti_end
<
ti_current
)
error
(
"Received invalid particle !"
);
ti_end_min
=
min
(
ti_end_min
,
ti_end
);
ti_end_max
=
max
(
ti_end_max
,
ti_end
);
}
/* ... and store. */
...
...
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