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);
89 Fab_a * omega_a_rho_a_inv,
90 Fab_b / (rho_b * omega_b));
93 luminosity[id_a] = tmp_luminosity;
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.
Tscal lambda_shock_conductivity(const Tscal &pmass, const Tscal &alpha_u, const Tscal &vsig_u, const Tscal &u_ab, const Tscal &Fab_inv_omega_a_rho_a, const Tscal &Fab_inv_omega_b_rho_b)
phantom_2018 eq.42