Commit 7b19ce53 authored by Loic Hausammann's avatar Loic Hausammann
Browse files

format

parent 3629ccc3
...@@ -93,27 +93,24 @@ INLINE static void gravity_logger_compute_size_and_mask( ...@@ -93,27 +93,24 @@ INLINE static void gravity_logger_compute_size_and_mask(
/* Here you can decide your own writing logic */ /* Here you can decide your own writing logic */
/* Add the coordinates. */ /* Add the coordinates. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[gravity_logger_field_coordinates],
masks[gravity_logger_field_coordinates], buffer_size);
buffer_size);
/* Add the velocities. */ /* Add the velocities. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[gravity_logger_field_velocities],
masks[gravity_logger_field_velocities], buffer_size); buffer_size);
/* Add the accelerations. */ /* Add the accelerations. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[gravity_logger_field_accelerations],
masks[gravity_logger_field_accelerations], buffer_size);
buffer_size);
/* Add the masses. */ /* Add the masses. */
*mask |= logger_add_field_to_mask( *mask |=
masks[gravity_logger_field_masses], buffer_size); logger_add_field_to_mask(masks[gravity_logger_field_masses], buffer_size);
/* Add the ID. */ /* Add the ID. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[gravity_logger_field_particle_ids],
masks[gravity_logger_field_particle_ids], buffer_size);
buffer_size);
} }
/** /**
...@@ -133,36 +130,35 @@ INLINE static char *gravity_logger_write_particle( ...@@ -133,36 +130,35 @@ INLINE static char *gravity_logger_write_particle(
unsigned int *mask, char *buff) { unsigned int *mask, char *buff) {
/* Write the coordinate. */ /* Write the coordinate. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[gravity_logger_field_coordinates],
mask_data[gravity_logger_field_coordinates], mask)) { mask)) {
memcpy(buff, p->x, 3 * sizeof(double)); memcpy(buff, p->x, 3 * sizeof(double));
buff += 3 * sizeof(double); buff += 3 * sizeof(double);
} }
/* Write the velocity. */ /* Write the velocity. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[gravity_logger_field_velocities],
mask_data[gravity_logger_field_velocities], mask)) { mask)) {
memcpy(buff, p->v_full, 3 * sizeof(float)); memcpy(buff, p->v_full, 3 * sizeof(float));
buff += 3 * sizeof(float); buff += 3 * sizeof(float);
} }
/* Write the acceleration. */ /* Write the acceleration. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[gravity_logger_field_accelerations],
mask_data[gravity_logger_field_accelerations], mask)) { mask)) {
memcpy(buff, p->a_grav, 3 * sizeof(float)); memcpy(buff, p->a_grav, 3 * sizeof(float));
buff += 3 * sizeof(float); buff += 3 * sizeof(float);
} }
/* Write the mass. */ /* Write the mass. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[gravity_logger_field_masses], mask)) {
mask_data[gravity_logger_field_masses], mask)) {
memcpy(buff, &p->mass, sizeof(float)); memcpy(buff, &p->mass, sizeof(float));
buff += sizeof(float); buff += sizeof(float);
} }
/* Write the Id. */ /* Write the Id. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[gravity_logger_field_particle_ids],
mask_data[gravity_logger_field_particle_ids], mask)) { mask)) {
memcpy(buff, &p->id_or_neg_offset, sizeof(long long)); memcpy(buff, &p->id_or_neg_offset, sizeof(long long));
buff += sizeof(long long); buff += sizeof(long long);
} }
......
...@@ -107,37 +107,36 @@ INLINE static void hydro_logger_compute_size_and_mask( ...@@ -107,37 +107,36 @@ INLINE static void hydro_logger_compute_size_and_mask(
/* Here you can decide your own writing logic */ /* Here you can decide your own writing logic */
/* Add the coordinates. */ /* Add the coordinates. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[hydro_logger_field_coordinates],
masks[hydro_logger_field_coordinates], buffer_size); buffer_size);
/* Add the velocities. */ /* Add the velocities. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[hydro_logger_field_velocities],
masks[hydro_logger_field_velocities], buffer_size); buffer_size);
/* Add the accelerations. */ /* Add the accelerations. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[hydro_logger_field_accelerations],
masks[hydro_logger_field_accelerations], buffer_size); buffer_size);
/* Add the masses. */ /* Add the masses. */
*mask |= logger_add_field_to_mask( *mask |=
masks[hydro_logger_field_masses], buffer_size); logger_add_field_to_mask(masks[hydro_logger_field_masses], buffer_size);
/* Add the smoothing lengths. */ /* Add the smoothing lengths. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[hydro_logger_field_smoothing_lengths],
masks[hydro_logger_field_smoothing_lengths], buffer_size);
buffer_size);
/* Add the entropies. */ /* Add the entropies. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[hydro_logger_field_entropies],
masks[hydro_logger_field_entropies], buffer_size); buffer_size);
/* Add the ID. */ /* Add the ID. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[hydro_logger_field_particle_ids],
masks[hydro_logger_field_particle_ids], buffer_size); buffer_size);
/* Add the density. */ /* Add the density. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[hydro_logger_field_densities],
masks[hydro_logger_field_densities], buffer_size); buffer_size);
} }
/** /**
...@@ -158,22 +157,22 @@ INLINE static char *hydro_logger_write_particle( ...@@ -158,22 +157,22 @@ INLINE static char *hydro_logger_write_particle(
const struct xpart *xp, unsigned int *mask, char *buff) { const struct xpart *xp, unsigned int *mask, char *buff) {
/* Write the coordinate. */ /* Write the coordinate. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_coordinates],
mask_data[hydro_logger_field_coordinates], mask)) { mask)) {
memcpy(buff, p->x, 3 * sizeof(double)); memcpy(buff, p->x, 3 * sizeof(double));
buff += 3 * sizeof(double); buff += 3 * sizeof(double);
} }
/* Write the velocity. */ /* Write the velocity. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_velocities],
mask_data[hydro_logger_field_velocities], mask)) { mask)) {
memcpy(buff, p->v, 3 * sizeof(float)); memcpy(buff, p->v, 3 * sizeof(float));
buff += 3 * sizeof(float); buff += 3 * sizeof(float);
} }
/* Write the acceleration. */ /* Write the acceleration. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_accelerations],
mask_data[hydro_logger_field_accelerations], mask)) { mask)) {
/* Compute the acceleration due to hydro and gravity */ /* Compute the acceleration due to hydro and gravity */
float *acc = (float *)buff; float *acc = (float *)buff;
...@@ -186,36 +185,35 @@ INLINE static char *hydro_logger_write_particle( ...@@ -186,36 +185,35 @@ INLINE static char *hydro_logger_write_particle(
} }
/* Write the mass. */ /* Write the mass. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_masses], mask)) {
mask_data[hydro_logger_field_masses], mask)) {
memcpy(buff, &p->mass, sizeof(float)); memcpy(buff, &p->mass, sizeof(float));
buff += sizeof(float); buff += sizeof(float);
} }
/* Write the smoothing length. */ /* Write the smoothing length. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_smoothing_lengths],
mask_data[hydro_logger_field_smoothing_lengths], mask)) { mask)) {
memcpy(buff, &p->h, sizeof(float)); memcpy(buff, &p->h, sizeof(float));
buff += sizeof(float); buff += sizeof(float);
} }
/* Write the entropy. */ /* Write the entropy. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_entropies],
mask_data[hydro_logger_field_entropies], mask)) { mask)) {
memcpy(buff, &p->entropy, sizeof(float)); memcpy(buff, &p->entropy, sizeof(float));
buff += sizeof(float); buff += sizeof(float);
} }
/* Write the Id. */ /* Write the Id. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_particle_ids],
mask_data[hydro_logger_field_particle_ids], mask)) { mask)) {
memcpy(buff, &p->id, sizeof(long long)); memcpy(buff, &p->id, sizeof(long long));
buff += sizeof(long long); buff += sizeof(long long);
} }
/* Write the density. */ /* Write the density. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[hydro_logger_field_densities],
mask_data[hydro_logger_field_densities], mask)) { mask)) {
memcpy(buff, &p->rho, sizeof(float)); memcpy(buff, &p->rho, sizeof(float));
buff += sizeof(float); buff += sizeof(float);
} }
......
...@@ -96,29 +96,28 @@ INLINE static void stars_logger_compute_size_and_mask( ...@@ -96,29 +96,28 @@ INLINE static void stars_logger_compute_size_and_mask(
/* Here you can decide your own writing logic */ /* Here you can decide your own writing logic */
/* Add the coordinates. */ /* Add the coordinates. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[stars_logger_field_coordinates],
masks[stars_logger_field_coordinates], buffer_size); buffer_size);
/* Add the velocities. */ /* Add the velocities. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[stars_logger_field_velocities],
masks[stars_logger_field_velocities], buffer_size); buffer_size);
/* Add the accelerations. */ /* Add the accelerations. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[stars_logger_field_accelerations],
masks[stars_logger_field_accelerations], buffer_size); buffer_size);
/* Add the masses. */ /* Add the masses. */
*mask |= logger_add_field_to_mask( *mask |=
masks[stars_logger_field_masses], buffer_size); logger_add_field_to_mask(masks[stars_logger_field_masses], buffer_size);
/* Add the smoothing lengths. */ /* Add the smoothing lengths. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[stars_logger_field_smoothing_lengths],
masks[stars_logger_field_smoothing_lengths], buffer_size);
buffer_size);
/* Add the ID. */ /* Add the ID. */
*mask |= logger_add_field_to_mask( *mask |= logger_add_field_to_mask(masks[stars_logger_field_particle_ids],
masks[stars_logger_field_particle_ids], buffer_size); buffer_size);
} }
/** /**
...@@ -138,43 +137,42 @@ INLINE static char *stars_logger_write_particle( ...@@ -138,43 +137,42 @@ INLINE static char *stars_logger_write_particle(
unsigned int *mask, char *buff) { unsigned int *mask, char *buff) {
/* Write the coordinate. */ /* Write the coordinate. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[stars_logger_field_coordinates],
mask_data[stars_logger_field_coordinates], mask)) { mask)) {
memcpy(buff, p->x, 3 * sizeof(double)); memcpy(buff, p->x, 3 * sizeof(double));
buff += 3 * sizeof(double); buff += 3 * sizeof(double);
} }
/* Write the velocity. */ /* Write the velocity. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[stars_logger_field_velocities],
mask_data[stars_logger_field_velocities], mask)) { mask)) {
memcpy(buff, p->v, 3 * sizeof(float)); memcpy(buff, p->v, 3 * sizeof(float));
buff += 3 * sizeof(float); buff += 3 * sizeof(float);
} }
/* Write the acceleration. */ /* Write the acceleration. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[stars_logger_field_accelerations],
mask_data[stars_logger_field_accelerations], mask)) { mask)) {
memcpy(buff, p->gpart->a_grav, 3 * sizeof(float)); memcpy(buff, p->gpart->a_grav, 3 * sizeof(float));
buff += 3 * sizeof(float); buff += 3 * sizeof(float);
} }
/* Write the mass. */ /* Write the mass. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[stars_logger_field_masses], mask)) {
mask_data[stars_logger_field_masses], mask)) {
memcpy(buff, &p->mass, sizeof(float)); memcpy(buff, &p->mass, sizeof(float));
buff += sizeof(float); buff += sizeof(float);
} }
/* Write the smoothing length. */ /* Write the smoothing length. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[stars_logger_field_smoothing_lengths],
mask_data[stars_logger_field_smoothing_lengths], mask)) { mask)) {
memcpy(buff, &p->h, sizeof(float)); memcpy(buff, &p->h, sizeof(float));
buff += sizeof(float); buff += sizeof(float);
} }
/* Write the Id. */ /* Write the Id. */
if (logger_should_write_field( if (logger_should_write_field(mask_data[stars_logger_field_particle_ids],
mask_data[stars_logger_field_particle_ids], mask)) { mask)) {
memcpy(buff, &p->id, sizeof(long long)); memcpy(buff, &p->id, sizeof(long long));
buff += sizeof(long long); buff += sizeof(long long);
} }
......
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