2#ifndef __FIXED_LENGTH_MODEL_HPP__
3#define __FIXED_LENGTH_MODEL_HPP__
5#include "Kokkos_Clamp.hpp"
6#include "Kokkos_Core_fwd.hpp"
7#include "Kokkos_Macros.hpp"
8#include "common/common.hpp"
9#include "common/traits.hpp"
10#include "mc/macros.hpp"
11#include "models/utils.hpp"
12#include <mc/prng/prng_extension.hpp>
13#include <mc/traits.hpp>
18 template <FloatingPo
intType F>
21 F glucose_to_biomass_yield = 0.5)
24 return (dl * density) / glucose_to_biomass_yield;
32 using Config = Kokkos::View<const FloatType*, ComputeSpace>;
43 static constexpr std::string_view
name =
"fixed-length";
73 KOKKOS_INLINE_FUNCTION
static void
80 KOKKOS_INLINE_FUNCTION
static double mass(std::size_t idx,
86 static std::vector<std::string_view>
names()
100 CHECK_MODEL(FixedLength)
102 KOKKOS_INLINE_FUNCTION
void
108 auto gen = random_pool.get_state();
109 const auto linit = config(idx);
110 random_pool.free_state(gen);
123 const auto s =
static_cast<FloatType>(c(0));
139 KOKKOS_INLINE_FUNCTION
void
160 return {.begin = begin, .end = begin + 1};
Status
Definition alias.hpp:57
gen_pool_type< Kokkos::DefaultExecutionSpace > pool_type
Definition alias.hpp:38
Kokkos::Subview< KernelConcentrationType, int, decltype(Kokkos::ALL)> LocalConcentration
Definition alias.hpp:95
Kokkos::View< F *[Nd], Kokkos::LayoutRight > ParticlesModel
Definition alias.hpp:18
Models definition.
Definition config_loader.hpp:9
KOKKOS_INLINE_FUNCTION MC::Status check_div(const T l, const T lc)
Definition utils.hpp:18
static F consteval _get_phi_s_max(F density, F dl, F glucose_to_biomass_yield=0.5)
Definition fixed_length.hpp:19
KOKKOS_INLINE_FUNCTION consteval F c_linear_density(F rho, F d)
Definition utils.hpp:47
Definition fixed_length.hpp:27
MC::ParticlesModel< Self::n_var, Self::FloatType > SelfParticle
Definition fixed_length.hpp:44
FixedLength Self
Definition fixed_length.hpp:29
static constexpr std::string_view name
Definition fixed_length.hpp:43
static KOKKOS_INLINE_FUNCTION MC::Status update(const MC::pool_type &random_pool, FloatType d_t, std::size_t idx, const SelfParticle &arr, const MC::LocalConcentration &c)
Definition fixed_length.hpp:117
particle_var
Definition fixed_length.hpp:35
@ phi_s
Definition fixed_length.hpp:38
@ length
Definition fixed_length.hpp:36
@ COUNT
Definition fixed_length.hpp:39
@ l_max
Definition fixed_length.hpp:37
static KOKKOS_INLINE_FUNCTION void division(const MC::pool_type &random_pool, std::size_t idx, std::size_t idx2, const SelfParticle &arr, const SelfParticle &buffer_arr)
Definition fixed_length.hpp:140
MODEL_CONSTANT FloatType l_max_m
Definition fixed_length.hpp:47
static std::vector< std::size_t > get_number()
Definition fixed_length.hpp:94
static MC::ContribIndexBounds get_bounds()
Definition fixed_length.hpp:157
MODEL_CONSTANT FloatType l_dot_max
Definition fixed_length.hpp:46
MODEL_CONSTANT FloatType l_min_m
Definition fixed_length.hpp:48
MODEL_CONSTANT FloatType d_m
Definition fixed_length.hpp:50
MODEL_CONSTANT FloatType phi_s_max
Definition fixed_length.hpp:54
MODEL_CONSTANT FloatType lin_density
Definition fixed_length.hpp:51
static std::vector< std::string_view > names()
Definition fixed_length.hpp:86
MODEL_CONSTANT FloatType k
Definition fixed_length.hpp:49
float FloatType
Definition fixed_length.hpp:30
std::true_type uniform_weight
Definition fixed_length.hpp:28
static Self::Config get_config(std::size_t n)
Definition config_loader.cpp:12
static constexpr std::size_t n_var
Definition fixed_length.hpp:42
static KOKKOS_INLINE_FUNCTION void init(const MC::pool_type &random_pool, std::size_t idx, const SelfParticle &arr, const Config ¶ms)
Definition fixed_length.hpp:103
static KOKKOS_INLINE_FUNCTION double mass(std::size_t idx, const SelfParticle &arr)
Definition fixed_length.hpp:80
Kokkos::View< const FloatType *, ComputeSpace > Config
Definition fixed_length.hpp:32