1#ifndef __MODELS_UPTAKES_HPP__
2#define __MODELS_UPTAKES_HPP__
4#include "mc/prng/prng_extension.hpp"
6#include <mc/traits.hpp>
8#define MONOD_RATIO(__c1__, __x1__, __k1__) ((__c1__) * (__x1__) / ((__x1__) + (__k1__)))
21 template <FloatingPo
intType F>
consteval F
freq(F tau)
30 static constexpr std::string_view
name =
"uptake";
52 static KOKKOS_INLINE_FUNCTION
constexpr FloatType
66 KOKKOS_INLINE_FUNCTION
static void
71 auto gen = random_pool.get_state();
87 random_pool.free_state(gen);
120 const FloatType gamma_PTS_S = phi_s_pts / phi_pts_max;
126 d_t * apts_frequency *
131 ((aperm_frequency_au * gamma_PTS_S + aperm_frequency_ad * (
FloatType(1) - gamma_PTS_S)) *
136 (MONOD_RATIO(n_perm_frequence_new,
k_pts, s) +
137 MONOD_RATIO(n_perm_frequence_rm, s,
k_pts)) *
181 auto generator = random_pool.get_state();
201 random_pool.free_state(generator);
204 [[maybe_unused]] KOKKOS_INLINE_FUNCTION
static void
206 [[maybe_unused]] std::size_t position,
207 [[maybe_unused]]
double weight,
220 inline constexpr static std::array<std::string_view, n_var>
names()
222 constexpr std::array<std::string_view, n_var> _names = {
"a_pts",
"a_permease",
"n_permease"};
223 static_assert(_names.size() ==
n_var);
Kokkos::Random_XorShift1024_Pool< Kokkos::DefaultExecutionSpace > pool_type
Definition prng.hpp:17
Kokkos::Subview< KernelConcentrationType, int, decltype(Kokkos::ALL)> LocalConcentration
Definition alias.hpp:41
Kokkos::Experimental::ScatterView< double **, Kokkos::LayoutRight > ContributionView
Definition alias.hpp:30
Kokkos::View< F *[Nd]> ParticlesModel
Definition traits.hpp:33
Models definition.
Definition simple_model.hpp:12
Uptakeparticle_var
Definition uptake.hpp:13
@ a_permease
Definition uptake.hpp:15
@ a_pts
Definition uptake.hpp:14
@ n_permease
Definition uptake.hpp:16
@ COUNT
Definition uptake.hpp:17
consteval F freq(F tau)
Definition uptake.hpp:21
static KOKKOS_INLINE_FUNCTION F draw_from(Kokkos::Random_XorShift1024< DeviceType > &gen, F mu, F sigma, F lower, F upper)
Definition prng_extension.hpp:285
MODEL_CONSTANT double tau_Au
Definition uptake.hpp:44
static KOKKOS_INLINE_FUNCTION void init(const MC::KPRNG::pool_type &random_pool, std::size_t idx, const SelfParticle &arr)
Definition uptake.hpp:67
MODEL_CONSTANT FloatType NPermease_max
Definition uptake.hpp:37
MODEL_CONSTANT FloatType kppermease
Definition uptake.hpp:39
MODEL_CONSTANT FloatType NPermease_init
Definition uptake.hpp:36
static KOKKOS_INLINE_FUNCTION void contribution(std::size_t idx, std::size_t position, double weight, const SelfParticle &arr, const MC::ContributionView &contributions)
Definition uptake.hpp:205
static KOKKOS_INLINE_FUNCTION constexpr FloatType phi_permease(FloatType phi_permease_specific, FloatType n_permease, FloatType a_permease, FloatType S)
Definition uptake.hpp:58
static KOKKOS_INLINE_FUNCTION FloatType uptake_step(FloatType phi_pts_max, FloatType phi_permease_specific, FloatType d_t, std::size_t idx, const SelfParticle &arr, const MC::LocalConcentration &c)
Definition uptake.hpp:104
static KOKKOS_INLINE_FUNCTION constexpr FloatType _k_pts()
Definition uptake.hpp:47
static KOKKOS_INLINE_FUNCTION double mass(std::size_t idx, const SelfParticle &arr)
Definition uptake.hpp:213
MC::ParticlesModel< M::n_var, Self::FloatType > SelfParticle
Definition uptake.hpp:34
static KOKKOS_INLINE_FUNCTION void division(const MC::KPRNG::pool_type &random_pool, std::size_t idx, std::size_t idx2, const SelfParticle &arr, const SelfParticle &buffer_arr)
Definition uptake.hpp:173
MODEL_CONSTANT double tau_new_permease
Definition uptake.hpp:41
MODEL_CONSTANT double tau_rm_perm
Definition uptake.hpp:42
static KOKKOS_INLINE_FUNCTION FloatType uptake(FloatType phi_pts_max, FloatType phi_permease_specific, std::size_t idx, const SelfParticle &arr, const MC::LocalConcentration &c)
Definition uptake.hpp:90
static constexpr std::size_t n_var
Definition uptake.hpp:29
static constexpr std::string_view name
Definition uptake.hpp:30
M::FloatType FloatType
Definition uptake.hpp:33
MODEL_CONSTANT double tau_Ad
Definition uptake.hpp:45
MODEL_CONSTANT FloatType k_pts
Definition uptake.hpp:38
static KOKKOS_INLINE_FUNCTION constexpr FloatType phi_pts(const FloatType phi_pts_max, const FloatType a_pts, const FloatType S)
Definition uptake.hpp:53
MODEL_CONSTANT double tau_pts
Definition uptake.hpp:43
static constexpr std::array< std::string_view, n_var > names()
Definition uptake.hpp:220
std::true_type uniform_weight
Definition uptake.hpp:31