Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
GetParticlesOutsideSphere.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
23
25
26 template<typename Tvec>
28
29 using Tscal = shambase::VecComponent<Tvec>;
30
31 Tvec sphere_center;
32 Tscal sphere_radius;
33
34 public:
35 GetParticlesOutsideSphere(const Tvec &sphere_center, Tscal sphere_radius)
36 : sphere_center(sphere_center), sphere_radius(sphere_radius) {}
37
38 struct Edges {
41 };
42
43 inline void set_edges(
44 std::shared_ptr<shamrock::solvergraph::IFieldRefs<Tvec>> pos,
46 part_ids_outside_sphere) {
48 __internal_set_rw_edges({part_ids_outside_sphere});
49 }
50
51 inline Edges get_edges() {
52 return Edges{
53 get_ro_edge<shamrock::solvergraph::IFieldRefs<Tvec>>(0),
55 }
56
58
59 inline virtual std::string _impl_get_label() const { return "GetParticlesOutsideSphere"; };
60
61 virtual std::string _impl_get_tex() const;
62 };
63} // namespace shammodels::sph::modules
Defines the DistributedBuffers class for managing distributed device buffers in a solver graph.
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
virtual std::string _impl_get_label() const
get the label of the node
virtual std::string _impl_get_tex() const
get the tex of the node
Interface for a solver graph edge representing a field as spans.
Interface for a solver graph edge representing a field as references to the underlying patch fields.
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition INode.hpp:30
T & get_rw_edge(int slot)
Get a read write edge and cast it to the type T.
Definition INode.hpp:86
void __internal_set_rw_edges(std::vector< std::shared_ptr< IEdge > > new_rw_edges)
Set the read write edges.
Definition INode.hpp:181
void __internal_set_ro_edges(std::vector< std::shared_ptr< IEdge > > new_ro_edges)
Set the read only edges.
Definition INode.hpp:171
namespace for the sph model modules