1#ifndef __MODELS_TRAITS_HPP__
2#define __MODELS_TRAITS_HPP__
4#include <Kokkos_Core_fwd.hpp>
5#include <Kokkos_Random.hpp>
6#include <Kokkos_ScatterView.hpp>
7#include <common/common.hpp>
8#include <common/traits.hpp>
11#include <mc/alias.hpp>
12#include <mc/macros.hpp>
13#include <mc/prng/prng.hpp>
18template <std::
size_t N1, std::
size_t N2>
19constexpr std::array<std::string_view, N1 + N2>
20concat_arrays(
const std::array<std::string_view, N1>& arr1,
21 const std::array<std::string_view, N2>& arr2)
23 std::array<std::string_view, N1 + N2> result;
24 std::copy(arr1.begin(), arr1.end(), result.begin());
25 std::copy(arr2.begin(), arr2.end(), result.begin() + N1);
33 template <u
int64_t Nd, FloatingPo
intType F>
35 template <FloatingPo
intType F>
43 const std::size_t size,
46 const typename T::SelfParticle& arr,
47 const T::Config& config) {
48 { model.init(random_pool, idx, arr, config) } -> std::same_as<void>;
50 { model.get_config(size) } -> std::same_as<typename T::Config>;
57 const typename T::SelfParticle& arr) {
58 { model.init(random_pool, idx, arr) } -> std::same_as<void>;
60using NonConfigType = std::nullopt_t;
67template <
typename T,
typename ViewType>
73 const T::SelfParticle& arr,
74 const T::SelfParticle& buffer_arr,
79 const T::Config& config) {
82 } -> std::convertible_to<std::size_t>;
84 typename T::FloatType;
86 typename T::SelfParticle;
98 (std::is_same_v<typename T::Config, NonConfigType> &&
109 } -> std::same_as<double>;
112 T::update(random_pool, d_t, idx, arr, c)
113 } -> std::convertible_to<MC::Status>;
120 { T::get_bounds() } -> std::same_as<MC::ContribIndexBounds>;
123 T::division(random_pool, idx, idx2, arr, buffer_arr)
124 } -> std::same_as<void>;
158template <std::
size_t n,
typename T>
160 { T::names() } -> std::convertible_to<std::array<std::string_view, n>>;
166 { T::names() } -> std::convertible_to<std::array<std::string_view, T::n_var>>;
172 { T::names() } -> std::convertible_to<std::vector<std::string_view>>;
173 { T::get_number() } -> std::convertible_to<std::vector<std::size_t>>;
183template <
typename T,
typename =
void>
Kokkos::Random_XorShift1024_Pool< Kokkos::DefaultExecutionSpace > pool_type
Definition prng.hpp:33
Concept to define a correct Model.
Definition traits.hpp:68
Definition traits.hpp:154
Concept to check if a model type has uniform_weight
Definition traits.hpp:196
SFNIAE wau to declare a model with number of internal properties not known at compile time Alows to p...
Definition traits.hpp:142
SFNIAE way to declare a model with number of internal properties known at compile time.
Definition traits.hpp:134
SFNIAE way to check whether model allow all value saving.
Definition traits.hpp:165
SFNIAE way to check whether model allow partial value saving.
Definition traits.hpp:171
Model that can export properties.
Definition traits.hpp:178
Model type.
Definition traits.hpp:148
Definition traits.hpp:151
Concept to check if a model type has uniform_weight
Definition traits.hpp:200
SFNIAE way to check whether model allow internal value saving or not.
Definition traits.hpp:159
Namespace that contains classes and structures related to Monte Carlo (MC) simulations.
Definition alias.hpp:9
decltype(Kokkos::Experimental::create_scatter_view(kernelContribution())) ContributionView
Definition alias.hpp:64
Kokkos::Subview< KernelConcentrationType, int, decltype(Kokkos::ALL)> LocalConcentration
Definition alias.hpp:72
Kokkos::View< F *[Nd], Kokkos::LayoutRight > ParticlesModel
Definition traits.hpp:34
Kokkos::View< F **, Kokkos::LayoutRight > DynParticlesModel
Definition traits.hpp:36