Commit fa561bd5 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

compile even if gadget-sph is used.

parent 74656d28
...@@ -118,25 +118,29 @@ void logger_log_part(struct part *p, unsigned int mask, size_t *offset, ...@@ -118,25 +118,29 @@ void logger_log_part(struct part *p, unsigned int mask, size_t *offset,
/* Particle position as three doubles. */ /* Particle position as three doubles. */
if (mask & logger_mask_x) { if (mask & logger_mask_x) {
memcpy(buff, p->x, 3 * sizeof(double)) memcpy(buff, p->x, 3 * sizeof(double));
buff += 3 * sizeof(double); buff += 3 * sizeof(double);
} }
/* Particle velocity as three floats. */ /* Particle velocity as three floats. */
if (mask & logger_mask_v) { if (mask & logger_mask_v) {
memcpy(buff, p->v, 3 * sizeof(float)) memcpy(buff, p->v, 3 * sizeof(float));
buff += 3 * sizeof(float); buff += 3 * sizeof(float);
} }
/* Particle accelleration as three floats. */ /* Particle accelleration as three floats. */
if (mask & logger_mask_a) { if (mask & logger_mask_a) {
memcpy(buff, p->a_hydro, 3 * sizeof(float)) memcpy(buff, p->a_hydro, 3 * sizeof(float));
buff += 3 * sizeof(float); buff += 3 * sizeof(float);
} }
/* Particle internal energy as a single float. */ /* Particle internal energy as a single float. */
if (mask & logger_mask_u) { if (mask & logger_mask_u) {
#if defined(GADGET2_SPH)
memcpy(buff, &p->entropy, sizeof(float));
#else
memcpy(buff, &p->u, sizeof(float)); memcpy(buff, &p->u, sizeof(float));
#endif
buff += sizeof(float); buff += sizeof(float);
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
/** /**
* Logger entries contain messages representing the particle data at a given * Logger entries contain messages representing the particle data at a given
* point in time during the simulation. * point in time during the simulation.
* *
* The logger messages always start with an 8-byte header structured as * The logger messages always start with an 8-byte header structured as
* follows: * follows:
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
* | | | stored as three doubles. * | | | stored as three doubles.
* 1 | v | 12 | Particle velocity, stored as three floats. * 1 | v | 12 | Particle velocity, stored as three floats.
* 2 | a | 12 | Particle acceleration, stored as three floats. * 2 | a | 12 | Particle acceleration, stored as three floats.
* 3 | u | 4 | Particle internal energy, stored as a single float. * 3 | u | 4 | Particle internal energy (or entropy, if Gadget-SPH
* | | | is used), stored as a single float.
* 4 | h | 4 | Particle smoothing length, stored as a single float. * 4 | h | 4 | Particle smoothing length, stored as a single float.
* 5 | rho | 4 | Particle density, stored as a single float. * 5 | rho | 4 | Particle density, stored as a single float.
* 6 | consts | 12 | Particle constants, i.e. mass and ID. * 6 | consts | 12 | Particle constants, i.e. mass and ID.
...@@ -71,8 +72,11 @@ ...@@ -71,8 +72,11 @@
/* Function prototypes. */ /* Function prototypes. */
int logger_size(unsigned int mask); int logger_size(unsigned int mask);
void logger_log_part(struct part *p, unsigned int mask, struct dump *dump); void logger_log_part(struct part *p, unsigned int mask, size_t *offset,
void logger_log_gpart(struct gpart *p, unsigned int mask, struct dump *dump); struct dump *dump);
void logger_lot_timestamp(unsigned long long int timestamp, struct dump *dump); void logger_log_gpart(struct gpart *p, unsigned int mask, size_t *offset,
struct dump *dump);
void logger_lot_timestamp(unsigned long long int timestamp, size_t *offset,
struct dump *dump);
#endif /* SWIFT_LOGGER_H */ #endif /* SWIFT_LOGGER_H */
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