Commit 0a053c45 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

No x_diff for the stars. Documentation. Use time_bin for the stars.

parent 80f9ed1c
...@@ -555,8 +555,12 @@ void cell_sunlocktree(struct cell *c) { ...@@ -555,8 +555,12 @@ void cell_sunlocktree(struct cell *c) {
* @param c The #cell array to be sorted. * @param c The #cell array to be sorted.
* @param parts_offset Offset of the cell parts array relative to the * @param parts_offset Offset of the cell parts array relative to the
* space's parts array, i.e. c->parts - s->parts. * space's parts array, i.e. c->parts - s->parts.
* @param sparts_offset Offset of the cell sparts array relative to the
* space's sparts array, i.e. c->sparts - s->sparts.
* @param buff A buffer with at least max(c->count, c->gcount) entries, * @param buff A buffer with at least max(c->count, c->gcount) entries,
* used for sorting indices. * used for sorting indices.
* @param sbuff A buffer with at least max(c->scount, c->gcount) entries,
* used for sorting indices for the sparts.
* @param gbuff A buffer with at least max(c->count, c->gcount) entries, * @param gbuff A buffer with at least max(c->count, c->gcount) entries,
* used for sorting indices for the gparts. * used for sorting indices for the gparts.
*/ */
......
...@@ -1924,10 +1924,8 @@ void space_split_recursive(struct space *s, struct cell *c, ...@@ -1924,10 +1924,8 @@ void space_split_recursive(struct space *s, struct cell *c,
} }
for (int k = 0; k < scount; k++) { for (int k = 0; k < scount; k++) {
struct spart *sp = &sparts[k]; struct spart *sp = &sparts[k];
const int ti_end = sp->ti_end; const integertime_t ti_end =
sp->x_diff[0] = 0.f; get_integer_time_end(e->ti_current, sp->time_bin);
sp->x_diff[1] = 0.f;
sp->x_diff[2] = 0.f;
if (ti_end < ti_end_min) ti_end_min = ti_end; if (ti_end < ti_end_min) ti_end_min = ti_end;
if (ti_end > ti_end_max) ti_end_max = ti_end; if (ti_end > ti_end_max) ti_end_max = ti_end;
} }
...@@ -2214,8 +2212,10 @@ void space_init_sparts(struct space *s) { ...@@ -2214,8 +2212,10 @@ void space_init_sparts(struct space *s) {
* @param dim Spatial dimensions of the domain. * @param dim Spatial dimensions of the domain.
* @param parts Array of Gas particles. * @param parts Array of Gas particles.
* @param gparts Array of Gravity particles. * @param gparts Array of Gravity particles.
* @param sparts Array of star particles.
* @param Npart The number of Gas particles in the space. * @param Npart The number of Gas particles in the space.
* @param Ngpart The number of Gravity particles in the space. * @param Ngpart The number of Gravity particles in the space.
* @param Nspart The number of star particles in the space.
* @param periodic flag whether the domain is periodic or not. * @param periodic flag whether the domain is periodic or not.
* @param gravity flag whether we are doing gravity or not. * @param gravity flag whether we are doing gravity or not.
* @param verbose Print messages to stdout or not. * @param verbose Print messages to stdout or not.
......
...@@ -44,8 +44,7 @@ __attribute__((always_inline)) INLINE static float star_compute_timestep_self( ...@@ -44,8 +44,7 @@ __attribute__((always_inline)) INLINE static float star_compute_timestep_self(
__attribute__((always_inline)) INLINE static void star_first_init_spart( __attribute__((always_inline)) INLINE static void star_first_init_spart(
struct spart* sp) { struct spart* sp) {
sp->ti_begin = 0; sp->time_bin = 0;
sp->ti_end = 0;
} }
/** /**
......
...@@ -34,20 +34,14 @@ struct spart { ...@@ -34,20 +34,14 @@ struct spart {
/* Particle position. */ /* Particle position. */
double x[3]; double x[3];
/* Offset between current position and position at last tree rebuild. */
float x_diff[3];
/* Particle velocity. */ /* Particle velocity. */
float v[3]; float v[3];
/* Star mass */ /* Star mass */
float mass; float mass;
/* Particle time of beginning of time-step. */ /* Particle time bin */
int ti_begin; timebin_t time_bin;
/* Particle time of end of time-step. */
int ti_end;
} SWIFT_STRUCT_ALIGN; } SWIFT_STRUCT_ALIGN;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment