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
...@@ -293,7 +293,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration( ...@@ -293,7 +293,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
p->force.h_dt = 0.0f; p->force.h_dt = 0.0f;
/* Reset maximal signal velocity */ /* 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( ...@@ -279,7 +279,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
/* Reset the time derivatives. */ /* Reset the time derivatives. */
p->u_dt = 0.0f; p->u_dt = 0.0f;
p->force.h_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( ...@@ -308,7 +308,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
p->force.h_dt = 0.0f; p->force.h_dt = 0.0f;
/* Reset maximal signal velocity */ /* Reset maximal signal velocity */
p->force.v_sig = 0.0f; p->force.v_sig = p->force.soundspeed;
} }
/** /**
......
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