24 template<
typename Tvec>
27 auto edges = get_edges();
31 edges.part_ids_outside_sphere.ensure_allocated(pos_refs.
get_ids());
35 [](
const Tvec *__restrict pos,
u32 i, Tvec sphere_center, Tscal sphere_radius) {
36 return sycl::length(pos[i] - sphere_center) > sphere_radius;
41 edges.part_ids_outside_sphere.buffers.get(id_patch).
append(tmp);
45 template<
typename Tvec>
50 std::string tex = R
"tex(
51 Get particles outside of the sphere
54 {part_ids_outside_sphere} &= \{i \text{ where } \vert\vert{pos}_i - c\vert\vert > r\}\\
Declares the GetParticlesOutsideSphere module for removing particles.
shambase::DistributedData< PatchDataFieldRef< T > > DDPatchDataFieldRef
Alias for a DistributedData of PatchDataFieldRefs.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
sham::DeviceBuffer< u32 > get_ids_where(Lambdacd &&cd_true, Args... args) const
Same function as.
void append(const DeviceBuffer &other)
Append the content of another buffer to this one.
std::vector< u64 > get_ids() const
Returns a vector of all the ids of the objects in the collection.
void for_each(std::function< void(u64, T &)> &&f)
Applies a function to each object in the collection.
virtual std::string _impl_get_tex() const
get the tex of the node
void _impl_evaluate_internal()
evaluate the node
IEdge & get_rw_edge_base(int slot)
Get a reference to a read write edge and cast it to the type IEdge.
const IEdge & get_ro_edge_base(int slot)
Get a reference to a read only edge.
void replace_all(std::string &inout, std::string_view what, std::string_view with)
replace all occurence of a search string with another
namespace for the sph model modules
This file contains the definition for the stacktrace related functionality.
shambase::details::BasicStackEntry StackEntry
Alias for shambase::details::BasicStackEntry.