31 auto edges = get_edges();
33 auto dev_sched = shamsys::instance::get_compute_scheduler_ptr();
35 edges.luminosity.ensure_sizes(edges.part_counts.indexes);
40 edges.xyz.get_spans(),
41 edges.hpart.get_spans(),
42 edges.omega.get_spans(),
44 edges.pressure.get_spans(),
45 edges.neigh_cache.neigh_cache},
47 edges.part_counts.indexes,
48 [part_mass = this->part_mass, alpha_u = this->alpha_u](
54 const Tscal *pressure,
55 const auto ploop_ptrs,
59 using namespace shamrock::sph;
61 Tscal h_a = hpart[id_a];
63 const Tscal u_a = u[id_a];
64 const Tscal omega_a = omega[id_a];
65 const Tscal rho_a = rho_h(part_mass, h_a, SPHKernel<Tscal>::hfactd);
66 const Tscal P_a = pressure[id_a];
67 Tscal omega_a_rho_a_inv = 1 / (omega_a * rho_a);
68 Tscal tmp_luminosity = 0;
70 particle_looper.for_each_object(id_a, [&](
u32 id_b) {
71 const Tscal u_b = u[id_b];
72 const Tscal h_b = hpart[id_b];
73 const Tscal omega_b = omega[id_b];
74 const Tscal P_b = pressure[id_b];
75 const Tscal rho_b = rho_h(part_mass, h_b, SPHKernel<Tscal>::hfactd);
76 Tvec dr = xyz_a - r[id_b];
77 Tscal rab2 = sycl::dot(dr, dr);
78 Tscal rab = sycl::sqrt(rab2);
80 Tscal vsigu = vsig_u(P_a, P_b, rho_a, rho_b);
81 Tscal Fab_a = SPHKernel<Tscal>::dW_3d(rab, h_a);
82 Tscal Fab_b = SPHKernel<Tscal>::dW_3d(rab, h_b);
84 tmp_luminosity += lambda_shock_conductivity(
89 Fab_a * omega_a_rho_a_inv,
90 Fab_b / (rho_b * omega_b));
93 luminosity[id_a] = tmp_luminosity;
100 auto xyz = get_ro_edge_base(0).get_tex_symbol();
101 auto hpart = get_ro_edge_base(1).get_tex_symbol();
102 auto omega = get_ro_edge_base(2).get_tex_symbol();
103 auto u = get_ro_edge_base(3).get_tex_symbol();
104 auto pressure = get_ro_edge_base(4).get_tex_symbol();
105 auto luminosity = get_rw_edge_base(0).get_tex_symbol();
107 std::string tex = R
"tex(
108 Compute idealized luminosity from shocks only: energy dissipated immidiately emitted
110 {luminosity}_i &= pmass * alpha_u * vsigu * u_ab * \frac{1}{2}
111 * (Fab_inv_omega_a_rho_a + Fab_inv_omega_b_rho_b)\\
112 &= pmass * alpha_u * \sqrt(\frac{\abs({pressure}_a - {pressure}_b)}{2 (rho_a + rho_b)}); * ({u}_a - {u}_b) * \frac{1}{2}
113 * (\frac{Fab_a}{{omega}_a * rho_a} + \frac{Fab_b}{{omega}_b * rho_b})
void distributed_data_kernel_call(sham::DeviceScheduler_ptr dev_sched, RefIn in, RefOut in_out, const shambase::DistributedData< index_t > &thread_counts, Functor &&func)
A variant of sham::kernel_call for distributed data.