|
BioCMAMC-ST
|
Represents the spatial domain where Monte Carlo particles can exist. More...
#include <domain.hpp>
Public Types | |
| using | n_cells_view_type = Kokkos::View<uint64_t*, ComputeSpace> |
Public Member Functions | |
| ReactorDomain (const ReactorDomain &)=delete | |
| ReactorDomain & | operator= (const ReactorDomain &)=delete |
| ReactorDomain () | |
| Default constructor. | |
| ReactorDomain (ReactorDomain &&other) noexcept=default | |
| Move constructor. | |
| ReactorDomain (std::span< double > volumes) | |
| Main constructor. | |
| ReactorDomain (double total_volume, std::size_t size) | |
| ~ReactorDomain ()=default | |
| Default destructor. | |
| ReactorDomain & | operator= (ReactorDomain &&other) noexcept |
| Move assignment operator. | |
| void | update (std::span< const double > newliquid_volume, std::span< const std::size_t > neighors_flat, std::span< const double > out_flows, std::span< const double > proba_flat) |
| void | set_leaving_flow (std::size_t i, std::size_t i_flow, double flow, double volume) const |
| void | set_move_probability (double d_t) const |
| Refresh the per-compartment move probability for this time step. Must be called before the move kernel whenever d_t or the flowmap changes. | |
| void | init_inner (std::size_t n_flows) |
| DomainState< ComputeSpace, true > | get_const_inner () |
| size_t | getNumberCompartments () const noexcept |
| Return the number of compartment in the domain. | |
| double | getTotalVolume () const noexcept |
| Return total volume of domain. | |
| template<class Archive> | |
| void | save (Archive &ar) const |
| Return a const reference to neighbors. | |
| template<class Archive> | |
| void | load (Archive &ar) |
Private Member Functions | |
| void | setVolumes (std::span< double const > volumes_liq) |
| Set volume of liquid and gas of each compartment. | |
| void | setLiquidNeighbors (std::size_t e1, std::size_t e2, std::span< const size_t > flat_data) |
| Update neigbors of compartments. | |
Private Attributes | |
| double | _total_volume = 0. |
| Domain total volume. | |
| size_t | id = 0 |
| Domain ID. | |
| size_t | size = 0 |
| Number of compartment. | |
| DomainState< ComputeSpace, false > | inner |
| Kokkos::View< double *, HostSpace > | host_liquid_volume |
| Kokkos::View< double *, HostSpace > | host_diag_transition |
| Kokkos::View< double *, HostSpace > | host_move_probability |
Represents the spatial domain where Monte Carlo particles can exist.
The ReactorDomain class models a spatial domain using a compartment-based approach. Each compartment within the domain holds and manages its own state through an instance of ContainerState. The compartments collectively represent the entire spatial domain in which particles interact, move, and evolve according to Monte Carlo simulations.
The ReactorDomain class is responsible for maintaining the structure and state of the compartments, and for providing access to the compartments for simulation and modeling purposes.
| using MC::ReactorDomain::n_cells_view_type = Kokkos::View<uint64_t*, ComputeSpace> |
|
delete |
| MC::ReactorDomain::ReactorDomain | ( | ) |
Default constructor.
|
defaultnoexcept |
Move constructor.
|
explicit |
Main constructor.
| MC::ReactorDomain::ReactorDomain | ( | double | total_volume, |
| std::size_t | size ) |
|
default |
Default destructor.
|
inlinenodiscard |
|
inlinenodiscardnoexcept |
Return the number of compartment in the domain.
|
inlinenodiscardnoexcept |
Return total volume of domain.
| void MC::ReactorDomain::init_inner | ( | std::size_t | n_flows | ) |
|
inline |
|
delete |
|
noexcept |
Move assignment operator.
|
inline |
Return a const reference to neighbors.
| void MC::ReactorDomain::set_leaving_flow | ( | std::size_t | i, |
| std::size_t | i_flow, | ||
| double | flow, | ||
| double | volume ) const |
| void MC::ReactorDomain::set_move_probability | ( | double | d_t | ) | const |
Refresh the per-compartment move probability for this time step. Must be called before the move kernel whenever d_t or the flowmap changes.
|
private |
Update neigbors of compartments.
|
private |
Set volume of liquid and gas of each compartment.
| void MC::ReactorDomain::update | ( | std::span< const double > | newliquid_volume, |
| std::span< const std::size_t > | neighors_flat, | ||
| std::span< const double > | out_flows, | ||
| std::span< const double > | proba_flat ) |
|
private |
Domain total volume.
|
private |
|
private |
Host copies of the two inputs to the move probability. update() already receives both as host spans, so keeping them here makes the per-step refresh a serial loop plus one small copy: no kernel dispatch, and no device-to-host round trip.
|
private |
|
private |
Domain ID.
|
private |
|
private |
Number of compartment.