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>
27 template <
typename ExecSpace,
bool is_const = true>
struct DomainState
88 void update(std::span<const double> newliquid_volume,
89 std::span<const std::size_t> neighors_flat,
90 std::span<const double> out_flows,
91 std::span<const double> proba_flat);
115 template <class Archive>
123 template <
class Archive>
139 void setVolumes(std::span<double const> volumes_liq);
146 std::span<const size_t> flat_data);
170 return {
inner.neighbors,
171 inner.diag_transition,
172 inner.cumulative_probability,
174 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:131
DomainState< ComputeSpace, true > get_const_inner()
Definition domain.hpp:167
ReactorDomain & operator=(const ReactorDomain &)=delete
~ReactorDomain()=default
Default destructor.
Kokkos::View< uint64_t *, ComputeSpace > n_cells_view_type
Definition domain.hpp:57
void load(Archive &ar)
Definition domain.hpp:125
double getTotalVolume() const noexcept
Return total volume of domain.
Definition domain.hpp:161
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:123
size_t size
Number of compartment.
Definition domain.hpp:133
void save(Archive &ar) const
Return a const reference to neighbors.
Definition domain.hpp:117
void setVolumes(std::span< double const > volumes_liq)
Set volume of liquid and gas of each compartment.
Definition domain.cpp:14
void set_leaving_flow(std::size_t i, std::size_t i_flow, double flow, double volume) const
Definition domain.cpp:97
ReactorDomain(const ReactorDomain &)=delete
DomainState< ComputeSpace, false > inner
Definition domain.hpp:134
size_t getNumberCompartments() const noexcept
Return the number of compartment in the domain.
Definition domain.hpp:155
ReactorDomain(ReactorDomain &&other) noexcept=default
Move constructor.
Namespace that contains classes and structures related to Monte Carlo (MC) simulations.
Definition alias.hpp:16
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:206
std::conditional_t< is_const, Kokkos::View< const double *, ExecSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > >, Kokkos::View< double *, ExecSpace > > VolumeView
Definition alias.hpp:173
std::conditional_t< is_const, Kokkos::View< const LeavingFlow *, Kokkos::SharedHostPinnedSpace >, Kokkos::View< LeavingFlow *, Kokkos::SharedHostPinnedSpace > > LeavingFlowView
Definition alias.hpp:190
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:197
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:181
Structure to store information about domain needed during MC cycle data is likely to change between e...
Definition domain.hpp:28
VolumeView< ExecSpace, is_const > liquid_volume
Definition domain.hpp:33
MC::NeighborsView< ExecSpace, is_const > neighbors
Definition domain.hpp:29
DiagonalView< ExecSpace, is_const > diag_transition
Definition domain.hpp:30
LeavingFlowView< is_const > leaving_flow
Definition domain.hpp:32
CumulativeProbabilityView< ExecSpace, is_const > cumulative_probability
Definition domain.hpp:31
Store position and value of volumic flow at outlet.
Definition domain.hpp:18
std::size_t index
Definition domain.hpp:19
double volume
Definition domain.hpp:21
double flow
Definition domain.hpp:20