32 auto edges = get_edges();
34 auto dev_sched = shamsys::instance::get_compute_scheduler_ptr();
36 auto &part_counts_with_ghosts = edges.part_counts_with_ghosts.indexes;
37 auto &part_counts = edges.part_counts.indexes;
39 edges.luminosity.ensure_sizes(edges.part_counts.indexes);
40 edges.omega.check_sizes(part_counts_with_ghosts);
45 edges.xyz.get_spans(),
46 edges.hpart.get_spans(),
47 edges.omega.get_spans(),
49 edges.pressure.get_spans(),
50 edges.neigh_cache.neigh_cache},
52 edges.part_counts.indexes,
53 [part_mass = this->part_mass, alpha_u = this->alpha_u](
59 const Tscal *pressure,
60 const auto ploop_ptrs,
64 using namespace shamrock::sph;
66 Tscal h_a = hpart[id_a];
68 const Tscal u_a = u[id_a];
69 const Tscal omega_a = omega[id_a];
70 const Tscal rho_a = rho_h(part_mass, h_a, SPHKernel<Tscal>::hfactd);
71 const Tscal P_a = pressure[id_a];
72 Tscal omega_a_rho_a_inv = 1 / (omega_a * rho_a);
73 Tscal tmp_luminosity = 0;
75 particle_looper.for_each_object(id_a, [&](
u32 id_b) {
76 const Tscal u_b = u[id_b];
77 const Tscal h_b = hpart[id_b];
78 const Tscal omega_b = omega[id_b];
79 const Tscal P_b = pressure[id_b];
80 const Tscal rho_b = rho_h(part_mass, h_b, SPHKernel<Tscal>::hfactd);
81 Tvec dr = xyz_a - r[id_b];
82 Tscal rab2 = sycl::dot(dr, dr);
83 Tscal rab = sycl::sqrt(rab2);
85 Tscal vsigu = vsig_u(P_a, P_b, rho_a, rho_b);
86 Tscal Fab_a = SPHKernel<Tscal>::dW_3d(rab, h_a);
87 Tscal Fab_b = SPHKernel<Tscal>::dW_3d(rab, h_b);
94 Fab_a * omega_a_rho_a_inv,
95 Fab_b / (rho_b * omega_b));
98 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