Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SGMMPlummer.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
20#include "shambase/integer.hpp"
23#include "shamcomm/logs.hpp"
29#include <sycl/sycl.hpp>
30
32
33 template<class Tvec, u32 mm_order>
35
36 using Tscal = shambase::VecComponent<Tvec>;
37
38 Tscal epsilon;
39 Tscal theta_crit;
40 u32 reduction_level;
41
42 public:
43 explicit SGMMPlummer(Tscal epsilon, Tscal theta_crit, u32 reduction_level)
44 : epsilon(epsilon), theta_crit(theta_crit), reduction_level(reduction_level) {}
45
53
54 inline void set_edges(
55 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> sizes,
56 std::shared_ptr<shamrock::solvergraph::IDataEdge<Tscal>> gpart_mass,
57 std::shared_ptr<shamrock::solvergraph::IDataEdge<Tscal>> constant_G,
58 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tvec>> field_xyz,
59 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tvec>> field_axyz_ext) {
60 __internal_set_ro_edges({sizes, gpart_mass, constant_G, field_xyz});
61 __internal_set_rw_edges({field_axyz_ext});
62 }
63
64 inline Edges get_edges() {
65 return Edges{
66 get_ro_edge<shamrock::solvergraph::Indexes<u32>>(0),
68 get_ro_edge<shamrock::solvergraph::IDataEdge<Tscal>>(2),
70 get_rw_edge<shamrock::solvergraph::FieldRefs<Tvec>>(0)};
71 }
72
73 inline std::string _impl_get_label() const override { return "SGMMPlummer"; }
74 std::string _impl_get_tex() const override { return "SG_{\\rm MM, Plummer}"; }
75
76 protected:
77 void _impl_evaluate_internal() override;
78 };
79
80} // namespace shammodels::sph::modules
std::uint32_t u32
32 bit unsigned integer
std::string _impl_get_label() const override
get the label of the node
std::string _impl_get_tex() const override
get the tex of the node
void _impl_evaluate_internal() override
evaluate the node
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition INode.hpp:30
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
const T & get_ro_edge(int slot)
Get a read only edge and cast it to the type T.
Definition INode.hpp:80
This header file contains utility functions related to exception handling in the code.
namespace for the sph model modules
This file contains the definition for the stacktrace related functionality.