Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SGSFMMPlummer.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 bool leaf_lowering;
41 u32 reduction_level;
42
43 public:
44 explicit SGSFMMPlummer(
45 Tscal epsilon, Tscal theta_crit, bool leaf_lowering, u32 reduction_level)
46 : epsilon(epsilon), theta_crit(theta_crit), leaf_lowering(leaf_lowering),
47 reduction_level(reduction_level) {}
48
56
57 inline void set_edges(
58 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> sizes,
59 std::shared_ptr<shamrock::solvergraph::IDataEdge<Tscal>> gpart_mass,
60 std::shared_ptr<shamrock::solvergraph::IDataEdge<Tscal>> constant_G,
61 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tvec>> field_xyz,
62 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tvec>> field_axyz_ext) {
63 __internal_set_ro_edges({sizes, gpart_mass, constant_G, field_xyz});
64 __internal_set_rw_edges({field_axyz_ext});
65 }
66
67 inline Edges get_edges() {
68 return Edges{
69 get_ro_edge<shamrock::solvergraph::Indexes<u32>>(0),
71 get_ro_edge<shamrock::solvergraph::IDataEdge<Tscal>>(2),
73 get_rw_edge<shamrock::solvergraph::FieldRefs<Tvec>>(0)};
74 }
75
76 inline std::string _impl_get_label() const override { return "SGSFMMPlummer"; }
77 std::string _impl_get_tex() const override { return "TODO"; }
78
79 protected:
80 void _impl_evaluate_internal() override;
81 };
82
83} // 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
void _impl_evaluate_internal() override
evaluate the node
std::string _impl_get_tex() const override
get the tex of 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.