29namespace shammodels::common::modules {
33 using Tscal = shambase::VecComponent<Tvec>;
48 inline void set_edges(
59 inline Edges get_edges() {
61 get_ro_edge<shamrock::solvergraph::IDataEdge<Tscal>>(0),
63 get_ro_edge<shamrock::solvergraph::IFieldSpan<Tvec>>(2),
65 get_ro_edge<shamrock::solvergraph::Indexes<u32>>(4),
73 auto edges = get_edges();
75 edges.spans_positions.check_sizes(edges.sizes.indexes);
76 edges.spans_accel_ext.ensure_sizes(edges.sizes.indexes);
78 Tscal Omega_0 = edges.omega_0.data;
79 Tscal q = edges.q.data;
81 Tscal Omega_0_sq = Omega_0 * Omega_0;
84 shamsys::instance::get_compute_scheduler_ptr(),
86 edges.spans_positions.get_spans(), edges.spans_velocities.get_spans()},
89 [Omega_0, Omega_0_sq, q](
90 u32 gid,
const Tvec *xyz,
const Tvec *vxyz, Tvec *axyz_ext) {
93 axyz_ext[gid] += Tvec{
94 2 * Omega_0 * (q * Omega_0 * r_a.x() + v_a.y()),
95 -2 * Omega_0 * v_a.x(),
96 -Omega_0_sq * r_a.z()};
101 return "AddForceShearingBoxNonInertial";
Header file describing a Node Instance.
std::uint32_t u32
32 bit unsigned integer
virtual std::string _impl_get_label() const
get the label of the node
void _impl_evaluate_internal()
evaluate 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.
Inode is node between data edges, takes multiple inputs, multiple outputs.
T & get_rw_edge(int slot)
Get a read write edge and cast it to the type T.
void __internal_set_rw_edges(std::vector< std::shared_ptr< IEdge > > new_rw_edges)
Set the read write edges.
void __internal_set_ro_edges(std::vector< std::shared_ptr< IEdge > > new_ro_edges)
Set the read only edges.
const T & get_ro_edge(int slot)
Get a read only edge and cast it to the type T.
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.
#define __shamrock_stack_entry()
Macro to create a stack entry.
A variant of sham::MultiRef for distributed data.