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

Add error message in the case of invalid type of gpart in gravity_get_softening()

parent 84eaf4c9
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
/* Local includes. */ /* Local includes. */
#include "cosmology.h" #include "cosmology.h"
#include "error.h"
#include "gravity_properties.h" #include "gravity_properties.h"
#include "kernel_gravity.h" #include "kernel_gravity.h"
#include "minmax.h" #include "minmax.h"
...@@ -60,6 +61,9 @@ __attribute__((always_inline)) INLINE static float gravity_get_softening( ...@@ -60,6 +61,9 @@ __attribute__((always_inline)) INLINE static float gravity_get_softening(
case swift_type_dark_matter_background: case swift_type_dark_matter_background:
return grav_props->epsilon_background_fac * cbrtf(gp->mass); return grav_props->epsilon_background_fac * cbrtf(gp->mass);
default: default:
#ifdef SWIFT_DEBUG_CHECKS
error("Invalid gpart type!");
#endif
return 0.f; return 0.f;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment