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
21
namespace
MC
22
{
23
RuntimeParameters
load_tuning_constant
();
24
33
struct
MonteCarloUnit
34
{
35
36
EventContainer
events
;
37
ReactorDomain
38
domain
;
39
40
AutoGenerated::ContainerVariant
container
;
41
42
MC::KPRNG
rng
;
43
double
init_weight
{};
44
45
MonteCarloUnit
(
const
MonteCarloUnit
&) =
46
delete
;
47
MonteCarloUnit
&
operator=
(
const
MonteCarloUnit
&) =
48
delete
;
49
MonteCarloUnit
&
operator=
(
MonteCarloUnit
&&) noexcept =
50
default;
51
MonteCarloUnit
(
MonteCarloUnit
&&) noexcept =
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
{
64
ar(
init_weight
,
events
,
domain
,
container
);
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__
MC::KPRNG
Utilities and wrap around kokkos random generator.
Definition
prng.hpp:73
MC::ReactorDomain
Represents the spatial domain where Monte Carlo particles can exist.
Definition
domain.hpp:76
MC
Namespace that contains classes and structures related to Monte Carlo (MC) simulations.
Definition
alias.hpp:15
MC::load_tuning_constant
RuntimeParameters load_tuning_constant()
Definition
unit.cpp:287
MC::EventContainer
Use to count events that occurs during Monte-Carlo processing cycles.
Definition
events.hpp:44
MC::MonteCarloUnit::MonteCarloUnit
MonteCarloUnit(const MonteCarloUnit &)=delete
Prevent copying of the MonteCarloUnit.
MC::MonteCarloUnit::rng
MC::KPRNG rng
Random number generator used for Monte Carlo methods.
Definition
unit.hpp:42
MC::MonteCarloUnit::getRepartition
std::vector< uint64_t > getRepartition() const
Definition
unit.cpp:163
MC::MonteCarloUnit::domain
ReactorDomain domain
Represents the domain within which the simulation occurs.
Definition
unit.hpp:38
MC::MonteCarloUnit::init_weight
double init_weight
Initial weight or factor used in the simulation.
Definition
unit.hpp:43
MC::MonteCarloUnit::serialize
void serialize(Archive &ar)
Definition
unit.hpp:62
MC::MonteCarloUnit::n_particle
uint64_t n_particle() const
Definition
unit.cpp:156
MC::MonteCarloUnit::container
AutoGenerated::ContainerVariant container
Definition
unit.hpp:40
MC::MonteCarloUnit::operator=
MonteCarloUnit & operator=(const MonteCarloUnit &)=delete
Prevent copying of the MonteCarloUnit.
MC::MonteCarloUnit::events
EventContainer events
Container to manage and store simulation events.
Definition
unit.hpp:36
MC::MonteCarloUnit::operator=
MonteCarloUnit & operator=(MonteCarloUnit &&) noexcept=default
Allow moving of the MonteCarloUn.
MC::RuntimeParameters
Definition
particles_container.hpp:25
apps
libs
mc
public
mc
unit.hpp
Generated by
1.14.0