Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ModifierSplitPart.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
24
26
27 template<class Tvec>
29 using Tscal = shambase::VecComponent<Tvec>;
31
32 ShamrockCtx &context;
33
34 SetupNodePtr parent;
35
37 u64 n_split;
38 Tscal h_scaling;
39
40 public:
42 ShamrockCtx &context,
43 SetupNodePtr parent,
44 u64 n_split,
45 u64 seed,
46 Tscal h_scaling = 1. / 1.5)
47 : context(context), parent(parent), n_split(n_split), generator(seed),
48 h_scaling(h_scaling) {
49 if (n_split == 0) {
51 "n_split must be greater than 0");
52 }
53 }
54
55 bool is_done() override { return parent->is_done(); }
56
58
59 std::string get_name() override { return "ModifierSplitPart"; }
61 return ISPHSetupNode_Dot{get_name(), 2, {parent->get_dot_subgraph()}};
62 }
63 };
64} // namespace shammodels::sph::modules
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
A parallel generator that will spit the same sequence regardless of the number of ranks.
This class is an interface that all SPH setup nodes must implement. It describe an operation associat...
bool is_done() override
This function return true if the setup is done.
ISPHSetupNode_Dot get_dot_subgraph() override
Get a dot subgraph describing the node and its childrens (recursively)
shamrock::patch::PatchDataLayer next_n(u32 nmax) override
This function generate patchdata with at most nmax per MPI ranks This function is always assumed as c...
std::string get_name() override
Get the name of the node.
PatchDataLayer container class, the layout is described in patchdata_layout.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
namespace for the sph model modules
std::shared_ptr< ISPHSetupNode > SetupNodePtr
Alias for a shared pointer to an ISPHSetupNode.
This struct is used to generate a dot graph of the setup tree.