30 using Tscal = shambase::VecComponent<Tvec>;
32 using Kernel = SPHKernel<Tscal>;
40 sycl::vec<Tscal, 3> pos;
41 sycl::vec<Tscal, 3> velocity;
57 std::function<Tscal(Tscal)> sigma_profile,
58 std::function<Tscal(Tscal)> H_profile,
59 std::function<Tscal(Tscal)> rot_profile,
60 std::function<Tscal(Tscal)> cs_profile,
61 std::mt19937_64 eng) {
82 std::function<Tscal(Tscal)> sigma_profile,
83 std::function<Tscal(Tscal)> H_profile,
84 std::function<Tscal(Tscal)> rot_profile,
85 std::function<Tscal(Tscal)> cs_profile,
88 : context(context), solver_config(solver_config), generator(make_generator(
98 init_h_factor(init_h_factor), pmass(part_mass) {}
104 std::string
get_name() {
return "GeneratorMCDisc"; }
114 u64 current_index = 0;
122 std::function<Tscal(Tscal)> sigma_profile;
123 std::function<Tscal(Tscal)> H_profile;
124 std::function<Tscal(Tscal)> rot_profile;
125 std::function<Tscal(Tscal)> cs_profile;
129 static constexpr Tscal _2pi = 2 * shambase::constants::pi<Tscal>;
131 Tscal f_func(Tscal r) {
return r * sigma_profile(r); }
133 DiscOutput next(
u64 seed);
141 std::function<Tscal(Tscal)> sigma_profile,
142 std::function<Tscal(Tscal)> H_profile,
143 std::function<Tscal(Tscal)> rot_profile,
144 std::function<Tscal(Tscal)> cs_profile,
156 disc_mass / part_mass) {}
163 std::function<Tscal(Tscal)> sigma_profile,
164 std::function<Tscal(Tscal)> H_profile,
165 std::function<Tscal(Tscal)> rot_profile,
166 std::function<Tscal(Tscal)> cs_profile,
169 : part_mass(part_mass), disc_mass(disc_mass), Npart(Npart), r_in(r_in), r_out(r_out),
170 sigma_profile(sigma_profile), H_profile(H_profile), rot_profile(rot_profile),
171 cs_profile(cs_profile), generator(eng, Npart), current_index(0) {
191 inline std::vector<DiscOutput>
next_n(
u64 nmax) {
192 std::vector<u64> seeds = generator.
next_n(nmax);
193 std::vector<DiscOutput> ret{};
194 for (
u64 seed : seeds) {
195 ret.push_back(next(seed));