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>
26 template <
typename ExecSpace,
bool is_const = true>
struct DomainState
87 void update(std::span<const double> newliquid_volume,
88 std::span<const std::size_t> neighors_flat,
89 std::span<const double> out_flows,
90 std::span<const double> proba_flat);
111 template <class Archive>
119 template <
class Archive>
135 void setVolumes(std::span<double const> volumes_liq);
142 std::span<const size_t> flat_data);
165 return {
inner.neighbors,
166 inner.diag_transition,
167 inner.cumulative_probability,
169 inner.liquid_volume };
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:44
double _total_volume
Domain total volume.
Definition domain.hpp:127
DomainState< ComputeSpace, true > get_const_inner()
Definition domain.hpp:163
void set_leaving_flow(std::size_t i, std::size_t i_flow, double flow) const
Definition domain.cpp:97
ReactorDomain & operator=(const ReactorDomain &)=delete
~ReactorDomain()=default
Default destructor.
Kokkos::View< uint64_t *, ComputeSpace > n_cells_view_type
Definition domain.hpp:56
void load(Archive &ar)
Definition domain.hpp:121
double getTotalVolume() const noexcept
Return total volume of domain.
Definition domain.hpp:157
ReactorDomain()
Default constructor.
Definition domain.cpp:31
void setLiquidNeighbors(std::size_t e1, std::size_t e2, std::span< const size_t > flat_data)
Update neigbors of compartments.
Definition domain.cpp:77
void init_inner(std::size_t n_flows)
Definition domain.cpp:117
size_t size
Number of compartment.
Definition domain.hpp:129
void save(Archive &ar) const
Return a const reference to neighbors.
Definition domain.hpp:113
void setVolumes(std::span< double const > volumes_liq)
Set volume of liquid and gas of each compartment.
Definition domain.cpp:14
ReactorDomain(const ReactorDomain &)=delete
DomainState< ComputeSpace, false > inner
Definition domain.hpp:130
size_t getNumberCompartments() const noexcept
Return the number of compartment in the domain.
Definition domain.hpp:151
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:130
std::conditional_t< is_const, Kokkos::View< const double *, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< double *, ExecSpace > > VolumeView
Definition alias.hpp:98
std::conditional_t< is_const, Kokkos::View< const LeavingFlow *, Kokkos::SharedHostPinnedSpace >, Kokkos::View< LeavingFlow *, Kokkos::SharedHostPinnedSpace > > LeavingFlowView
Definition alias.hpp:115
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:121
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:106
Structure to store information about domain needed during MC cycle data is likely to change between e...
Definition domain.hpp:27
VolumeView< ExecSpace, is_const > liquid_volume
Definition domain.hpp:32
MC::NeighborsView< ExecSpace, is_const > neighbors
Definition domain.hpp:28
DiagonalView< ExecSpace, is_const > diag_transition
Definition domain.hpp:29
LeavingFlowView< is_const > leaving_flow
Definition domain.hpp:31
CumulativeProbabilityView< ExecSpace, is_const > cumulative_probability
Definition domain.hpp:30
Store position and value of volumic flow at outlet.
Definition domain.hpp:18
std::size_t index
Definition domain.hpp:19
double flow
Definition domain.hpp:20