20namespace shamrock::sph {
23 inline flt rho_h(flt m, flt h, flt hfact) {
24 return m * (hfact / h) * (hfact / h) * (hfact / h);
27 template<
class flt, i32 dim = 3>
28 inline flt h_rho(flt m, flt rho, flt hfact) {
29 return hfact / sycl::rootn(rho / m, dim);
32 template<
class flt, i32 dim = 3>
33 inline flt newton_iterate_new_h(flt rho_ha, flt rho_sum, flt sumdWdh, flt h_a) {
34 flt f_iter = rho_sum - rho_ha;
35 flt df_iter = sumdWdh + dim * rho_ha / h_a;
40 return h_a - f_iter / df_iter;