BioCMAMC-ST
unit.hpp
1#ifndef __MC_UNIT_HPP__
2#define __MC_UNIT_HPP__
3
4#include <mc/domain.hpp>
5#include <mc/events.hpp>
6#include <mc/particles_container.hpp>
7#include <mc/prng/prng.hpp>
8#include <mc/traits.hpp>
9#include <variant>
10#include <variant_model.hpp>
11
21namespace MC
22{
24
34 {
35
39
40 AutoGenerated::ContainerVariant container;
41
43 double init_weight{};
44
46 delete;
48 delete;
50 default;
52 default;
53
54 MonteCarloUnit() = default;
55
56 ~MonteCarloUnit() = default;
57
58 [[nodiscard]] uint64_t n_particle() const;
59
60 [[nodiscard]] std::vector<uint64_t> getRepartition() const;
61
62 template <class Archive> void serialize(Archive& ar)
63 {
65
66 std::visit(
67 [&ar](auto& _container)
68 {
69 ar(_container);
70 _container.change_runtime(load_tuning_constant());
71 },
72 container);
73 }
74 };
75
76} // namespace MC
77
78#endif //__MC_UNIT_HPP__
Utilities and wrap around kokkos random generator.
Definition prng.hpp:73
Represents the spatial domain where Monte Carlo particles can exist.
Definition domain.hpp:76
Namespace that contains classes and structures related to Monte Carlo (MC) simulations.
Definition alias.hpp:15
RuntimeParameters load_tuning_constant()
Definition unit.cpp:287
Use to count events that occurs during Monte-Carlo processing cycles.
Definition events.hpp:44
MonteCarloUnit(const MonteCarloUnit &)=delete
Prevent copying of the MonteCarloUnit.
MC::KPRNG rng
Random number generator used for Monte Carlo methods.
Definition unit.hpp:42
std::vector< uint64_t > getRepartition() const
Definition unit.cpp:163
ReactorDomain domain
Represents the domain within which the simulation occurs.
Definition unit.hpp:38
double init_weight
Initial weight or factor used in the simulation.
Definition unit.hpp:43
void serialize(Archive &ar)
Definition unit.hpp:62
uint64_t n_particle() const
Definition unit.cpp:156
AutoGenerated::ContainerVariant container
Definition unit.hpp:40
MonteCarloUnit & operator=(const MonteCarloUnit &)=delete
Prevent copying of the MonteCarloUnit.
EventContainer events
Container to manage and store simulation events.
Definition unit.hpp:36
MonteCarloUnit & operator=(MonteCarloUnit &&) noexcept=default
Allow moving of the MonteCarloUn.
Definition particles_container.hpp:25