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
f2be0d0b
"README.md" did not exist on "2035c96b083b8b61cde2059bf60daf1941178a76"
Commit
f2be0d0b
authored
9 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
fix-up engine_collect_kick.
parent
c45ae0f1
No related branches found
No related tags found
2 merge requests
!136
Master
,
!113
Local variable cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+8
-9
8 additions, 9 deletions
src/engine.c
with
8 additions
and
9 deletions
src/engine.c
+
8
−
9
View file @
f2be0d0b
...
...
@@ -1199,13 +1199,11 @@ void engine_rebuild(struct engine *e) {
void
engine_prepare
(
struct
engine
*
e
)
{
int
rebuild
;
TIMER_TIC
/* Run through the tasks and mark as skip or not. */
// tic = getticks();
rebuild
=
(
e
->
forcerebuild
||
engine_marktasks
(
e
));
int
rebuild
=
(
e
->
forcerebuild
||
engine_marktasks
(
e
));
// message( "space_marktasks took %.3f %s." ,
//clocks_from_ticks(getticks() - tic), clocks_getunit());
...
...
@@ -1288,14 +1286,14 @@ void engine_barrier(struct engine *e, int tid) {
void
engine_collect_kick
(
struct
cell
*
c
)
{
/* Skip super-cells (Their values are already set) */
if
(
c
->
kick
!=
NULL
)
return
;
/* Counters for the different quantities. */
int
updated
=
0
;
int
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
;
double
e_kin
=
0
.
0
,
e_int
=
0
.
0
,
e_pot
=
0
.
0
;
float
mom
[
3
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
ang
[
3
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
struct
cell
*
cp
;
/* Skip super-cells (Their values are already set) */
if
(
c
->
kick
!=
NULL
)
return
;
int
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
;
/* Only do something is the cell is non-empty */
if
(
c
->
count
!=
0
)
{
...
...
@@ -1305,7 +1303,8 @@ void engine_collect_kick(struct cell *c) {
/* Collect the values from the progeny. */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
((
cp
=
c
->
progeny
[
k
])
!=
NULL
)
{
struct
cell
*
cp
=
c
->
progeny
[
k
];
if
(
cp
!=
NULL
)
{
/* Recurse */
engine_collect_kick
(
cp
);
...
...
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