Commit b57dd387 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Minimal SPH also moved to integer timeline

parent 095b5eda
......@@ -116,10 +116,11 @@ __attribute__((always_inline))
*
* @param p The particle to act upon
* @param xp The extended particle data to act upon
* @param time The current time
* @param ti_current The current time (on the timeline)
* @param timeBase The minimal time-step size
*/
__attribute__((always_inline)) INLINE static void hydro_prepare_force(
struct part* p, struct xpart* xp, float time) {
struct part* p, struct xpart* xp, int ti_current, double timeBase) {
p->force.pressure = p->rho * p->u * (const_hydro_gamma - 1.f);
}
......@@ -154,11 +155,12 @@ __attribute__((always_inline))
*
* @param p The particle
* @param xp The extended data of the particle
* @param t0 The time at the start of the drift
* @param t1 The time at the end of the drift
* @param t0 The time at the start of the drift (on the timeline)
* @param t1 The time at the end of the drift (on the timeline)
* @param timeBase The minimal time-step size
*/
__attribute__((always_inline)) INLINE static void hydro_predict_extra(
struct part* p, struct xpart* xp, float t0, float t1) {
struct part* p, struct xpart* xp, int t0, int t1, double timeBase) {
const float dt = t1 - t0;
......
......@@ -24,10 +24,10 @@ __attribute__((always_inline))
"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",
"wcount=%d, m=%.3e, dh_drho=%.3e, rho=%.3e, t_begin=%d, t_end=%d\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],
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);
p->h_dt, (int)p->density.wcount, p->mass, p->rho_dh, p->rho, p->ti_begin,
p->ti_end);
}
......@@ -55,9 +55,9 @@ struct part {
float h_dt; /*!< Time derivative of smoothing length */
float t_begin; /*!< Time at the beginning of time-step. */
int ti_begin; /*!< Time at the beginning of time-step. */
float t_end; /*!< Time at the end of time-step. */
int ti_end; /*!< Time at the end of time-step. */
float u; /*!< Particle internal energy. */
......
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