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

Initialize the signal velocity to be the particle's sound-speed. Prevents...

Initialize the signal velocity to be the particle's sound-speed. Prevents divisions by zero in cases where a particle has 0 neighbours.
parent 1608ac8d
Branches
Tags
No related merge requests found
......@@ -293,7 +293,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
p->force.h_dt = 0.0f;
/* Reset maximal signal velocity */
p->force.v_sig = 0.0f;
p->force.v_sig = p->force.soundspeed;
}
/**
......
......@@ -279,7 +279,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
/* Reset the time derivatives. */
p->u_dt = 0.0f;
p->force.h_dt = 0.0f;
p->force.v_sig = 0.0f;
p->force.v_sig = p->force.soundspeed;
}
/**
......
......@@ -308,7 +308,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
p->force.h_dt = 0.0f;
/* Reset maximal signal velocity */
p->force.v_sig = 0.0f;
p->force.v_sig = p->force.soundspeed;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment