1#ifndef __MC_REACTORDOMAIN_HPP__
2#define __MC_REACTORDOMAIN_HPP__
4#include <Kokkos_Core.hpp>
6#include <common/common.hpp>
10#include <mc/traits.hpp>
23 template <
typename ExecSpace,
bool is_const = true>
struct MoveInfo
112 void update(std::span<const double> newliquid_volume,
113 std::span<const std::size_t> neighors_flat,
114 std::span<const double> out_flows,
115 std::span<const double> proba_flat);
117 void set_leaving_flow(std::size_t i, std::size_t i_flow,
double flow)
const;
123 return {
inner.neighbors,
124 inner.diag_transition,
125 inner.cumulative_probability,
127 inner.liquid_volume};
145 template <class Archive>
void save(Archive& ar)
const
151 template <
class Archive>
void load(Archive& ar)
165 void setVolumes(std::span<double const> volumes_liq);
173 std::span<const size_t> flat_data);
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)
Definition domain.cpp:45
double _total_volume
Domain total volume.
Definition domain.hpp:158
void set_leaving_flow(std::size_t i, std::size_t i_flow, double flow) const
Definition domain.cpp:96
ReactorDomain & operator=(const ReactorDomain &)=delete
~ReactorDomain()=default
Default destructor.
Kokkos::View< uint64_t *, ComputeSpace > n_cells_view_type
Definition domain.hpp:78
void load(Archive &ar)
Definition domain.hpp:151
MoveInfo< ComputeSpace, true > get_const_inner()
Definition domain.hpp:121
double getTotalVolume() const noexcept
Return total volume of domain.
Definition domain.hpp:186
ReactorDomain()
Default constructor.
Definition domain.cpp:30
void setLiquidNeighbors(std::size_t e1, std::size_t e2, std::span< const size_t > flat_data)
Update neigbors of compartments.
Definition domain.cpp:79
size_t size
Number of compartment.
Definition domain.hpp:160
void save(Archive &ar) const
Return a const reference to neighbors.
Definition domain.hpp:145
MoveInfo< ComputeSpace, false > inner
Definition domain.hpp:155
void setVolumes(std::span< double const > volumes_liq)
Set volume of liquid and gas of each compartment.
Definition domain.cpp:12
ReactorDomain(const ReactorDomain &)=delete
size_t getNumberCompartments() const noexcept
Return the number of compartment in the domain.
Definition domain.hpp:181
void init_inner(const std::size_t n_flows)
Definition domain.cpp:114
ReactorDomain(ReactorDomain &&other) noexcept=default
Move constructor.
Namespace that contains classes and structures related to Monte Carlo (MC) simulations.
Definition alias.hpp:15
std::conditional_t< is_const, Kokkos::View< const std::size_t **, Kokkos::LayoutRight, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< std::size_t **, Kokkos::LayoutRight, ExecSpace > > NeighborsView
Definition alias.hpp:142
std::conditional_t< is_const, Kokkos::View< const double *, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< double *, ExecSpace > > VolumeView
Definition alias.hpp:110
std::conditional_t< is_const, Kokkos::View< const LeavingFlow *, Kokkos::SharedHostPinnedSpace >, Kokkos::View< LeavingFlow *, Kokkos::SharedHostPinnedSpace > > LeavingFlowView
Definition alias.hpp:127
std::conditional_t< is_const, Kokkos::View< const double **, Kokkos::LayoutRight, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< double **, Kokkos::LayoutRight, ExecSpace > > CumulativeProbabilityView
Definition alias.hpp:133
std::conditional_t< is_const, Kokkos::View< const double *, Kokkos::LayoutLeft, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< double *, Kokkos::LayoutLeft, ExecSpace > > DiagonalView
Definition alias.hpp:118
std::size_t index
Definition domain.hpp:19
double flow
Definition domain.hpp:20
DiagonalView< ExecSpace, is_const > diag_transition
Definition domain.hpp:27
VolumeView< ExecSpace, is_const > liquid_volume
Definition domain.hpp:30
MC::NeighborsView< ExecSpace, is_const > neighbors
Definition domain.hpp:26
CumulativeProbabilityView< ExecSpace, is_const > cumulative_probability
Definition domain.hpp:28
LeavingFlowView< is_const > leaving_flow
Definition domain.hpp:29