Skip to content
Snippets Groups Projects
Commit 9f114949 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Cleaned-up init tasks

parent eba84165
No related branches found
No related tags found
2 merge requests!136Master,!79First version of the multiple time-stepping
...@@ -499,18 +499,18 @@ void runner_dogsort(struct runner *r, struct cell *c, int flags, int clock) { ...@@ -499,18 +499,18 @@ void runner_dogsort(struct runner *r, struct cell *c, int flags, int clock) {
void runner_doinit(struct runner *r, struct cell *c) { void runner_doinit(struct runner *r, struct cell *c) {
struct part *p, *parts = c->parts; struct part *p, *parts = c->parts;
int i, k, count = c->count; const int count = c->count;
float t_end = r->e->time; const float t_end = r->e->time;
/* Recurse? */ /* Recurse? */
if (c->split) { if (c->split) {
for (k = 0; k < 8; k++) for (int k = 0; k < 8; k++)
if (c->progeny[k] != NULL) runner_doinit(r, c->progeny[k]); if (c->progeny[k] != NULL) runner_doinit(r, c->progeny[k]);
return; return;
} }
/* Loop over the parts in this cell. */ /* Loop over the parts in this cell. */
for (i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
/* Get a direct pointer on the part. */ /* Get a direct pointer on the part. */
p = &parts[i]; p = &parts[i];
...@@ -518,15 +518,15 @@ void runner_doinit(struct runner *r, struct cell *c) { ...@@ -518,15 +518,15 @@ void runner_doinit(struct runner *r, struct cell *c) {
if (p->t_end <= t_end) { if (p->t_end <= t_end) {
/* Get ready for a density calculation */ /* Get ready for a density calculation */
p->density.wcount = 0.0; p->density.wcount = 0.f;
p->density.wcount_dh = 0.0; p->density.wcount_dh = 0.f;
p->rho = 0.0; p->rho = 0.f;
p->rho_dh = 0.0; p->rho_dh = 0.f;
p->density.div_v = 0.0; p->density.div_v = 0.f;
for (k = 0; k < 3; k++) p->density.curl_v[k] = 0.0; p->density.curl_v[0] = 0.f;
p->density.curl_v[1] = 0.f;
p->density.curl_v[2] = 0.f;
} }
;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment