2#ifndef __FIXED_LENGTH_MODEL_HPP__
3#define __FIXED_LENGTH_MODEL_HPP__
5#include "Kokkos_Core_fwd.hpp"
6#include "Kokkos_Macros.hpp"
7#include "common/common.hpp"
8#include "common/traits.hpp"
9#include "mc/macros.hpp"
10#include "models/utils.hpp"
11#include <mc/prng/prng_extension.hpp>
12#include <mc/traits.hpp>
17 template <FloatingPo
intType F>
20 F glucose_to_biomass_yield = 0.5)
23 return (dl * density) / glucose_to_biomass_yield;
31 using Config = Kokkos::View<const FloatType*, ComputeSpace>;
41 static constexpr std::size_t
n_var
44 static constexpr std::string_view
name =
"fixed-length";
74 KOKKOS_INLINE_FUNCTION
static void
81 KOKKOS_INLINE_FUNCTION
static double
87 static std::vector<std::string_view>
96 static std::vector<std::size_t>
103 CHECK_MODEL(FixedLength)
105 KOKKOS_INLINE_FUNCTION
void
111 auto gen = random_pool.get_state();
112 const auto linit = config(idx);
113 random_pool.free_state(gen);
126 const auto s =
static_cast<FloatType>(c(0));
142 KOKKOS_INLINE_FUNCTION
void
156 = new_current_length;
164 return { .begin = begin, .end = begin + 1 };
Kokkos::Subview< KernelConcentrationType, int, decltype(Kokkos::ALL)> LocalConcentration
Definition alias.hpp:95
Status
Definition alias.hpp:58
gen_pool_type< Kokkos::DefaultExecutionSpace > pool_type
Definition alias.hpp:39
Kokkos::View< F *[Nd], Kokkos::LayoutRight > ParticlesModel
Definition alias.hpp:19
Models definition.
Definition config_loader.hpp:9
KOKKOS_INLINE_FUNCTION MC::Status check_div(const T l, const T lc)
Definition utils.hpp:19
static F consteval _get_phi_s_max(F density, F dl, F glucose_to_biomass_yield=0.5)
Definition fixed_length.hpp:18
KOKKOS_INLINE_FUNCTION consteval F c_linear_density(F rho, F d)
Definition utils.hpp:49
Definition fixed_length.hpp:26
MC::ParticlesModel< Self::n_var, Self::FloatType > SelfParticle
Definition fixed_length.hpp:45
FixedLength Self
Definition fixed_length.hpp:28
static constexpr std::string_view name
Definition fixed_length.hpp:44
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:120
particle_var
Definition fixed_length.hpp:34
@ phi_s
Definition fixed_length.hpp:37
@ length
Definition fixed_length.hpp:35
@ l_max
Definition fixed_length.hpp:36
@ __COUNT__
Definition fixed_length.hpp:38
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:143
MODEL_CONSTANT FloatType l_max_m
Definition fixed_length.hpp:48
static std::vector< std::size_t > get_number()
Definition fixed_length.hpp:97
static MC::ContribIndexBounds get_bounds()
Definition fixed_length.hpp:161
MODEL_CONSTANT FloatType l_dot_max
Definition fixed_length.hpp:47
MODEL_CONSTANT FloatType l_min_m
Definition fixed_length.hpp:49
MODEL_CONSTANT FloatType d_m
Definition fixed_length.hpp:51
MODEL_CONSTANT FloatType phi_s_max
Definition fixed_length.hpp:56
MODEL_CONSTANT FloatType lin_density
Definition fixed_length.hpp:53
static std::vector< std::string_view > names()
Definition fixed_length.hpp:88
MODEL_CONSTANT FloatType k
Definition fixed_length.hpp:50
float FloatType
Definition fixed_length.hpp:29
std::true_type uniform_weight
Definition fixed_length.hpp:27
static Self::Config get_config(std::size_t n)
Definition config_loader.cpp:13
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:106
static KOKKOS_INLINE_FUNCTION double mass(std::size_t idx, const SelfParticle &arr)
Definition fixed_length.hpp:82
Kokkos::View< const FloatType *, ComputeSpace > Config
Definition fixed_length.hpp:31