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

Done with the minimal hydro implementation. Documentation to follow

parent 4b1b4db5
No related branches found
No related tags found
2 merge requests!136Master,!90Improved multi-timestep SPH
......@@ -1708,18 +1708,18 @@ void engine_init_particles(struct engine *e) {
message("Initialising particles");
engine_prepare(e);
/* Make sure all particles are ready to go */
/* i.e. clean-up any stupid state in the ICs */
space_map_cells_pre(s, 1, cell_init_parts, NULL);
engine_prepare(e);
engine_marktasks(e);
// printParticle(e->s->parts, 1000, e->s->nr_parts);
// printParticle(e->s->parts, 515050, e->s->nr_parts);
/* printParticle(e->s->parts, e->s->xparts, 1000, e->s->nr_parts); */
/* printParticle(e->s->parts, e->s->xparts, 515050, e->s->nr_parts); */
// message("\n0th DENSITY CALC\n");
/* message("\n0th DENSITY CALC\n"); */
/* Now do a density calculation */
TIMER_TIC;
......@@ -1825,8 +1825,6 @@ if ( e->nodeID == 0 )
/* printParticle(e->s->parts, e->s->xparts, 1000, e->s->nr_parts); */
/* printParticle(e->s->parts, e->s->xparts, 515050, e->s->nr_parts); */
// if(e->step == 2) exit(0);
/* message("\nACCELERATION AND KICK\n"); */
/* Re-distribute the particles amongst the nodes? */
......
......@@ -45,7 +45,7 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
* @param xp The extended particle data to act upon
*/
__attribute__((always_inline))
INLINE static void hydro_first_init_part(struct part* p, struct xpart* xp) {
INLINE static void hydro_first_init_part(struct part* p, struct xpart* xp) {
xp->u_full = p->u;
}
......@@ -175,9 +175,8 @@ __attribute__((always_inline))
* @param dt The time-step for this kick
* @param half_dt The half time-step for this kick
*/
__attribute__((always_inline))
INLINE static void hydro_kick_extra(struct part* p, struct xpart* xp,
float dt, float half_dt) {
__attribute__((always_inline)) INLINE static void hydro_kick_extra(
struct part* p, struct xpart* xp, float dt, float half_dt) {
/* Kick in momentum space */
xp->u_full += p->u_dt * dt;
......
......@@ -21,11 +21,13 @@ __attribute__((always_inline))
INLINE static void hydro_debug_particle(struct part* p, struct xpart* xp) {
printf(
"x=[%.3e,%.3e,%.3e], "
"v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e],\n "
"h=%.3e, "
"v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e], "
"u_full=%.3e, u=%.3e, du/dt=%.3e v_sig=%.3e, P=%.3e\n"
"h=%.3e, dh/dt=%.3e "
"wcount=%d, m=%.3e, dh_drho=%.3e, rho=%.3e, t_begin=%.3e, t_end=%.3e\n",
p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2], xp->v_full[0],
xp->v_full[1], xp->v_full[2], p->a_hydro[0], p->a_hydro[1], p->a_hydro[2],
p->h, (int)p->density.wcount, p->mass, p->rho_dh, p->rho, p->t_begin,
xp->u_full, p->u, p->u_dt, p->force.v_sig, p->force.pressure, p->h,
p->h_dt, (int)p->density.wcount, p->mass, p->rho_dh, p->rho, p->t_begin,
p->t_end);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment