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

Added function to compute a value to the power of inverse dimenstion effectively.

parent 8e4d5e73
No related branches found
No related tags found
1 merge request!714New ghost iteration scheme
......@@ -89,6 +89,34 @@ __attribute__((always_inline)) INLINE static float pow_dimension(float x) {
#endif
}
/**
* @brief Returns the argument to the power given by the inverse of the
* dimension
*
* Computes \f$x^{1/d}\f$.
*/
__attribute__((always_inline)) INLINE static float pow_inv_dimension(float x) {
#if defined(HYDRO_DIMENSION_3D)
return cbrtf(x);
#elif defined(HYDRO_DIMENSION_2D)
return sqrtf(x);
#elif defined(HYDRO_DIMENSION_1D)
return x;
#else
error("The dimension is not defined !");
return 0.f;
#endif
}
/**
* @brief Returns the argument to the power given by the dimension plus one
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment