2#ifndef __FIXED_LENGTH_MODEL_HPP__
3#define __FIXED_LENGTH_MODEL_HPP__
5#include "common/traits.hpp"
6#include "mc/macros.hpp"
7#include "models/utils.hpp"
8#include <mc/prng/prng_extension.hpp>
9#include <mc/traits.hpp>
15 template <FloatingPo
intType F>
18 F glucose_to_biomass_yield = 0.5)
21 return (dl * density) / glucose_to_biomass_yield;
39 static constexpr std::string_view
name =
"fixed-length";
53 KOKKOS_INLINE_FUNCTION
static void
65 KOKKOS_INLINE_FUNCTION
static void
72 KOKKOS_INLINE_FUNCTION
static void
79 KOKKOS_INLINE_FUNCTION
static double mass(std::size_t idx,
84 static std::vector<std::string_view>
names()
97 CHECK_MODEL(FixedLength)
99 KOKKOS_INLINE_FUNCTION
void
116 auto gen = random_pool.get_state();
117 auto linit = l_initial_dist.draw(
119 random_pool.free_state(gen);
158 KOKKOS_INLINE_FUNCTION
void
190 KOKKOS_INLINE_FUNCTION
void
192 std::size_t position,
197 auto access = contributions.access();
198 access(position, 0) +=
Kokkos::Random_XorShift1024_Pool< Kokkos::DefaultExecutionSpace > pool_type
Definition prng.hpp:17
Kokkos::Subview< KernelConcentrationType, int, decltype(Kokkos::ALL)> LocalConcentration
Definition alias.hpp:42
Kokkos::Experimental::ScatterView< double **, Kokkos::LayoutRight > ContributionView
Definition alias.hpp:31
Kokkos::View< F *[Nd]> ParticlesModel
Definition traits.hpp:34
Status
Definition alias.hpp:11
@ Division
Definition alias.hpp:13
@ Idle
Definition alias.hpp:12
Models definition.
Definition config_loader.hpp:8
static F consteval _get_phi_s_max(F density, F dl, F glucose_to_biomass_yield=0.5)
Definition fixed_length.hpp:16
KOKKOS_INLINE_FUNCTION consteval F c_linear_density(F rho, F d)
Definition utils.hpp:40
Represents a TruncatedNormal (Gaussian) probability distribution.
Definition prng_extension.hpp:263
Definition fixed_length.hpp:24
MC::ParticlesModel< Self::n_var, Self::FloatType > SelfParticle
Definition fixed_length.hpp:40
FixedLength Self
Definition fixed_length.hpp:26
static constexpr std::string_view name
Definition fixed_length.hpp:39
static KOKKOS_INLINE_FUNCTION void contribution(std::size_t idx, std::size_t position, double weight, const SelfParticle &arr, const MC::ContributionView &contributions)
Definition fixed_length.hpp:191
particle_var
Definition fixed_length.hpp:31
@ phi_s
Definition fixed_length.hpp:34
@ length
Definition fixed_length.hpp:32
@ COUNT
Definition fixed_length.hpp:35
@ l_max
Definition fixed_length.hpp:33
MODEL_CONSTANT FloatType l_max_m
Definition fixed_length.hpp:43
static std::vector< std::size_t > get_number()
Definition fixed_length.hpp:91
MODEL_CONSTANT FloatType l_dot_max
Definition fixed_length.hpp:42
MODEL_CONSTANT FloatType l_min_m
Definition fixed_length.hpp:44
static KOKKOS_INLINE_FUNCTION MC::Status update(const MC::KPRNG::pool_type &random_pool, FloatType d_t, std::size_t idx, const SelfParticle &arr, const MC::LocalConcentration &c)
Definition fixed_length.hpp:140
MODEL_CONSTANT FloatType d_m
Definition fixed_length.hpp:46
MODEL_CONSTANT FloatType phi_s_max
Definition fixed_length.hpp:50
MODEL_CONSTANT FloatType lin_density
Definition fixed_length.hpp:47
static std::vector< std::string_view > names()
Definition fixed_length.hpp:84
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 fixed_length.hpp:159
MODEL_CONSTANT FloatType k
Definition fixed_length.hpp:45
float FloatType
Definition fixed_length.hpp:27
static KOKKOS_INLINE_FUNCTION void init(const MC::KPRNG::pool_type &random_pool, std::size_t idx, const SelfParticle &arr)
Definition fixed_length.hpp:100
std::true_type uniform_weight
Definition fixed_length.hpp:25
std::nullopt_t Config
Definition fixed_length.hpp:28
static constexpr std::size_t n_var
Definition fixed_length.hpp:38
static KOKKOS_INLINE_FUNCTION double mass(std::size_t idx, const SelfParticle &arr)
Definition fixed_length.hpp:79