Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shammodels
sph
include
shammodels
sph
modules
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
19
#include "
shamrock/solvergraph/DistributedBuffers.hpp
"
20
#include "
shamrock/solvergraph/IFieldRefs.hpp
"
21
#include "
shamrock/solvergraph/INode.hpp
"
22
#include "
shamrock/solvergraph/PatchDataLayerRefs.hpp
"
23
24
namespace
shammodels::sph::modules
{
25
26
template
<
typename
Tvec>
27
class
GetParticlesOutsideSphere
:
public
shamrock::solvergraph::INode
{
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
{
39
const
shamrock::solvergraph::IFieldRefs<Tvec>
&pos;
40
shamrock::solvergraph::DistributedBuffers<u32>
&part_ids_outside_sphere;
41
};
42
43
inline
void
set_edges(
44
std::shared_ptr<
shamrock::solvergraph::IFieldRefs<Tvec>
> pos,
45
std::shared_ptr<
shamrock::solvergraph::DistributedBuffers<u32>
>
46
part_ids_outside_sphere) {
47
__internal_set_ro_edges
({pos});
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),
54
get_rw_edge
<
shamrock::solvergraph::DistributedBuffers<u32>
>(0)};
55
}
56
57
void
_impl_evaluate_internal
();
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
DistributedBuffers.hpp
Defines the DistributedBuffers class for managing distributed device buffers in a solver graph.
IFieldRefs.hpp
INode.hpp
PatchDataLayerRefs.hpp
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
shammodels::sph::modules::GetParticlesOutsideSphere
Definition
GetParticlesOutsideSphere.hpp:27
shammodels::sph::modules::GetParticlesOutsideSphere::_impl_get_label
virtual std::string _impl_get_label() const
get the label of the node
Definition
GetParticlesOutsideSphere.hpp:59
shammodels::sph::modules::GetParticlesOutsideSphere::_impl_get_tex
virtual std::string _impl_get_tex() const
get the tex of the node
Definition
GetParticlesOutsideSphere.cpp:46
shammodels::sph::modules::GetParticlesOutsideSphere::_impl_evaluate_internal
void _impl_evaluate_internal()
evaluate the node
Definition
GetParticlesOutsideSphere.cpp:25
shamrock::solvergraph::DistributedBuffers
Interface for a solver graph edge representing a field as spans.
Definition
DistributedBuffers.hpp:39
shamrock::solvergraph::IFieldRefs
Interface for a solver graph edge representing a field as references to the underlying patch fields.
Definition
IFieldRefs.hpp:43
shamrock::solvergraph::INode
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition
INode.hpp:30
shamrock::solvergraph::INode::get_rw_edge
T & get_rw_edge(int slot)
Get a read write edge and cast it to the type T.
Definition
INode.hpp:86
shamrock::solvergraph::INode::__internal_set_rw_edges
void __internal_set_rw_edges(std::vector< std::shared_ptr< IEdge > > new_rw_edges)
Set the read write edges.
Definition
INode.hpp:181
shamrock::solvergraph::INode::__internal_set_ro_edges
void __internal_set_ro_edges(std::vector< std::shared_ptr< IEdge > > new_ro_edges)
Set the read only edges.
Definition
INode.hpp:171
shammodels::sph::modules
namespace for the sph model modules
Definition
AnalysisAngularMomentum.hpp:28
shammodels::sph::modules::GetParticlesOutsideSphere::Edges
Definition
GetParticlesOutsideSphere.hpp:38
Generated on Wed May 13 2026 13:21:49 for Shamrock by
1.9.8