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"
10#include "mc/macros.hpp"
11#include "models/utils.hpp"
12#include <mc/prng/prng_extension.hpp>
13#include <mc/traits.hpp>
32 using Config = Kokkos::View<const FloatType*, ComputeSpace>;
41 static constexpr std::size_t
n_var
44 static constexpr std::size_t
n_c = 1;
46 static constexpr std::string_view
name =
"fixed-length";
76 std::size_t position_index,
79 KOKKOS_INLINE_FUNCTION
static void
86 KOKKOS_INLINE_FUNCTION
static double
92 static std::vector<std::string_view>
101 static std::vector<std::size_t>
108 CHECK_MODEL(FixedLength)
110 KOKKOS_INLINE_FUNCTION
void
116 auto gen = random_pool.get_state();
117 const auto linit = config(idx);
118 random_pool.free_state(gen);
130 const std::size_t position_index,
135 const auto s =
static_cast<FloatType>(GET_CONCENTRATION(0));
136 auto& c_phi_s = GET_CONTRIBS(0);
146 KOKKOS_INLINE_FUNCTION
void
161 = new_current_length;
Status
Definition alias.hpp:125
gen_pool_type< Kokkos::DefaultExecutionSpace > pool_type
Definition alias.hpp:100
KernelConcentrationType LocalConcentration
Definition alias.hpp:170
Kokkos::View< F *[Nc], ComputeSpace::array_layout, ComputeSpace, Kokkos::MemoryTraits< Kokkos::MemoryTraitsFlags::Restrict > > ParticlesContribs
Definition alias.hpp:66
Kokkos::View< F *[Nd], ComputeSpace::array_layout, ComputeSpace, Kokkos::MemoryTraits< Kokkos::MemoryTraitsFlags::Restrict > > ParticlesModel
Definition alias.hpp:52
Models definition.
Definition config_loader.hpp:9
KOKKOS_INLINE_FUNCTION MC::Status check_div(const T l, const T lc)
Definition utils.hpp:64
static F consteval _get_phi_s_max(F density, F dl, F glucose_to_biomass_yield=0.5)
Definition utils.hpp:45
KOKKOS_INLINE_FUNCTION consteval F c_linear_density(F rho, F d)
Definition utils.hpp:94
Definition fixed_length.hpp:27
MC::ParticlesModel< Self::n_var, Self::FloatType > SelfParticle
Definition fixed_length.hpp:47
FixedLength Self
Definition fixed_length.hpp:29
static constexpr std::string_view name
Definition fixed_length.hpp:46
particle_var
Definition fixed_length.hpp:35
@ length
Definition fixed_length.hpp:36
@ l_max
Definition fixed_length.hpp:37
@ __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:147
static constexpr std::size_t n_c
Definition fixed_length.hpp:44
MODEL_CONSTANT FloatType l_max_m
Definition fixed_length.hpp:51
static std::vector< std::size_t > get_number()
Definition fixed_length.hpp:102
MODEL_CONSTANT FloatType l_dot_max
Definition fixed_length.hpp:50
MODEL_CONSTANT FloatType l_min_m
Definition fixed_length.hpp:52
MODEL_CONSTANT FloatType d_m
Definition fixed_length.hpp:54
MODEL_CONSTANT FloatType phi_s_max
Definition fixed_length.hpp:59
MODEL_CONSTANT FloatType lin_density
Definition fixed_length.hpp:56
static std::vector< std::string_view > names()
Definition fixed_length.hpp:93
static MC::ContribIndexBounds get_bounds()
MODEL_CONSTANT FloatType k
Definition fixed_length.hpp:53
MC::ParticlesContribs< Self::n_c, Self::FloatType > SelfContribs
Definition fixed_length.hpp:48
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:13
static KOKKOS_INLINE_FUNCTION MC::Status update(const MC::pool_type &random_pool, FloatType d_t, std::size_t idx, const SelfParticle &arr, const SelfContribs &arr_contribs, std::size_t position_index, const MC::LocalConcentration &c)
Definition fixed_length.hpp:125
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:111
static KOKKOS_INLINE_FUNCTION double mass(std::size_t idx, const SelfParticle &arr)
Definition fixed_length.hpp:87
Kokkos::View< const FloatType *, ComputeSpace > Config
Definition fixed_length.hpp:32