diff --git a/src/hydro/Gadget2/hydro.h b/src/hydro/Gadget2/hydro.h index 7598f7b454bcda45c51c6090e97dd6843e9bb147..8b81f6e8e8c79d9a3904d3263da01c3f9877149f 100644 --- a/src/hydro/Gadget2/hydro.h +++ b/src/hydro/Gadget2/hydro.h @@ -76,13 +76,24 @@ __attribute__((always_inline)) INLINE static float hydro_get_pressure( return gas_pressure_from_entropy(p->rho, p->entropy); } +/** + * @brief Returns the comoving entropy of a particle + * + * @param p The particle of interest. + */ +__attribute__((always_inline)) INLINE static float hydro_get_comoving_entropy( + const struct part *restrict p) { + + return p->entropy; +} + /** * @brief Returns the entropy of a particle * * @param p The particle of interest. * @param cosmo The cosmological model. */ -__attribute__((always_inline)) INLINE static float hydro_get_entropy( +__attribute__((always_inline)) INLINE static float hydro_get_physical_entropy( const struct part *restrict p, const struct cosmology *cosmo) { return p->entropy; diff --git a/src/statistics.c b/src/statistics.c index 66b0308f69deab84411d7647168537837d55305e..7223ffd9cd463205b6d97d28f7e095b1061a9de5 100644 --- a/src/statistics.c +++ b/src/statistics.c @@ -164,7 +164,7 @@ void stats_collect_part_mapper(void *map_data, int nr_parts, void *extra_data) { hydro_get_drifted_velocities(p, xp, dt_kick_hydro, dt_kick_grav, v); const double x[3] = {p->x[0], p->x[1], p->x[2]}; const float m = hydro_get_mass(p); - const float entropy = hydro_get_entropy(p, cosmo); + const float entropy = hydro_get_physical_entropy(p, cosmo); const float u_int = hydro_get_physical_internal_energy(p, cosmo); /* Collect mass */ diff --git a/tests/test125cells.c b/tests/test125cells.c index 6df500f05c254ed9b6686956dce1a07588318e35..efaf4f168585953233ebd7401142b44a43823cce 100644 --- a/tests/test125cells.c +++ b/tests/test125cells.c @@ -403,14 +403,14 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, main_cell->parts[pid].x[1], main_cell->parts[pid].x[2], main_cell->parts[pid].v[0], main_cell->parts[pid].v[1], main_cell->parts[pid].v[2], main_cell->parts[pid].h, - hydro_get_density(&main_cell->parts[pid]), + hydro_get_comoving_density(&main_cell->parts[pid]), #if defined(MINIMAL_SPH) || defined(SHADOWFAX_SPH) 0.f, #else main_cell->parts[pid].density.div_v, #endif - hydro_get_entropy(&main_cell->parts[pid]), - hydro_get_internal_energy(&main_cell->parts[pid]), + hydro_get_comoving_entropy(&main_cell->parts[pid]), + hydro_get_comoving_internal_energy(&main_cell->parts[pid]), hydro_get_pressure(&main_cell->parts[pid]), hydro_get_soundspeed(&main_cell->parts[pid]), main_cell->parts[pid].a_hydro[0], main_cell->parts[pid].a_hydro[1], diff --git a/tests/test27cells.c b/tests/test27cells.c index 85d2709dad1de4e5f5502ace092a9cb18f36a4c5..88c20294eeb571d9e74101b8594d99cfdcf1b63a 100644 --- a/tests/test27cells.c +++ b/tests/test27cells.c @@ -260,7 +260,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, main_cell->parts[pid].x[1], main_cell->parts[pid].x[2], main_cell->parts[pid].v[0], main_cell->parts[pid].v[1], main_cell->parts[pid].v[2], - hydro_get_density(&main_cell->parts[pid]), + hydro_get_comoving_density(&main_cell->parts[pid]), #if defined(GIZMO_SPH) || defined(SHADOWFAX_SPH) 0.f, #else @@ -297,7 +297,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, "%13e %13e %13e\n", cj->parts[pjd].id, cj->parts[pjd].x[0], cj->parts[pjd].x[1], cj->parts[pjd].x[2], cj->parts[pjd].v[0], cj->parts[pjd].v[1], - cj->parts[pjd].v[2], hydro_get_density(&cj->parts[pjd]), + cj->parts[pjd].v[2], hydro_get_comoving_density(&cj->parts[pjd]), #if defined(GIZMO_SPH) || defined(SHADOWFAX_SPH) 0.f, #else diff --git a/tests/testInteractions.c b/tests/testInteractions.c index 76ee5078819882c38e3e57ac33bc4ee3ae6fc67e..d7ef9eb0a35dc3446827f16acd57ce658294a709 100644 --- a/tests/testInteractions.c +++ b/tests/testInteractions.c @@ -130,13 +130,13 @@ void dump_indv_particle_fields(char *fileName, struct part *p) { "%8.5f " "%8.5f %8.5f %13e %13e %13e %13e %13e %8.5f %8.5f\n", p->id, p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2], p->h, - hydro_get_density(p), + hydro_get_comoving_density(p), #if defined(MINIMAL_SPH) || defined(SHADOWFAX_SPH) 0.f, #else p->density.div_v, #endif - hydro_get_entropy(p), hydro_get_internal_energy(p), + hydro_get_comoving_entropy(p), hydro_get_comoving_internal_energy(p), hydro_get_pressure(p), hydro_get_soundspeed(p), p->a_hydro[0], p->a_hydro[1], p->a_hydro[2], p->force.h_dt, #if defined(GADGET2_SPH) diff --git a/tests/testPeriodicBC.c b/tests/testPeriodicBC.c index 53337e499673a7ac92c1e7ce3e0da189e9e76f06..1987f24132ab5a57e688c29e95289811128b2435 100644 --- a/tests/testPeriodicBC.c +++ b/tests/testPeriodicBC.c @@ -236,7 +236,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, int i, int j, main_cell->parts[pid].x[1], main_cell->parts[pid].x[2], main_cell->parts[pid].v[0], main_cell->parts[pid].v[1], main_cell->parts[pid].v[2], - hydro_get_density(&main_cell->parts[pid]), + hydro_get_comoving_density(&main_cell->parts[pid]), #if defined(GIZMO_SPH) || defined(SHADOWFAX_SPH) 0.f, #else diff --git a/tests/testTimeIntegration.c b/tests/testTimeIntegration.c index 42a3d224f43d580e512119edc55051bd22719a3b..972e6f2323c0401c70de2990bcb088f95b3dfd83 100644 --- a/tests/testTimeIntegration.c +++ b/tests/testTimeIntegration.c @@ -95,8 +95,8 @@ int main() { run.e = ŋ eng.time = 0.; - eng.timeBegin = 0.; - eng.timeEnd = N_orbits * T; + eng.time_begin = 0.; + eng.time_end = N_orbits * T; eng.dt_min = dt; /* This forces the time-step to be dt */ eng.dt_max = dt; /* irrespective of the state of the particle */ @@ -104,7 +104,7 @@ int main() { for (i = 0; i < N; i++) { /* Move forward in time */ - eng.timeOld = eng.time; + eng.time_old = eng.time; eng.time += dt; /* Compute gravitational acceleration */