Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit e30f6b45 authored by ESTERIE Pierre's avatar ESTERIE Pierre
Browse files

Fix problem with particle_type in container

parent 2194e395
......@@ -11,15 +11,9 @@
#include <type_traits>
#include <scalfmm/meta/is_valid.hpp>
#include <scalfmm/meta/forward.hpp>
#include <xsimd/types/xsimd_base.hpp>
// forward declare particle
namespace scalfmm::container
{
template<typename PositionType, std::size_t PositionDim, typename InputsType, std::size_t NInputs,
typename OutputsType, std::size_t MOutputs, typename... Variables>
struct particle;
}
// Traits
namespace scalfmm::meta
{
......
......@@ -17,31 +17,7 @@
#include <type_traits>
#include <utility>
#include "scalfmm/meta/traits.hpp"
// Forward declaration for traits support
namespace scalfmm::container
{
template<typename Derived, typename... Containers>
struct variadic_adaptor;
template<typename Derived, template<typename U, typename Allocator> class Container, typename... Types>
struct unique_variadic_container;
template<typename Derived, typename... Types>
struct variadic_container;
template<typename Derived, typename Tuple>
struct variadic_container_tuple;
template<typename ValueType, std::size_t Dimension>
struct point_impl;
template<typename ValueType, std::size_t Dimension>
struct point_proxy;
template<typename ValueType, std::size_t Dimension, typename Enable>
struct point;
} // namespace scalfmm::container
#include "scalfmm/meta/forward.hpp"
namespace scalfmm::meta
{
......@@ -121,6 +97,13 @@ namespace scalfmm::meta
{
};
template<typename PositionType, std::size_t PositionDim, typename InputsType, std::size_t NInputs,
typename OutputsType, std::size_t MOutputs, typename... Variables>
struct tuple_size<scalfmm::container::particle<PositionType,PositionDim,InputsType,NInputs,OutputsType,MOutputs,Variables...>>
: std::integral_constant<std::size_t, PositionDim+NInputs+MOutputs+sizeof...(Variables)>
{
};
template<std::size_t I, typename T>
inline constexpr auto get(T&& t) noexcept -> auto&&
{
......
......@@ -739,12 +739,12 @@ namespace scalfmm::tools
const VALUE_T box_width)
{
// get the number of elements per particles in the container build with tuples.
// TODO : nb_elements via value_type stored in the container -> change value_type in particle container
constexpr int nb_elt_per_par = std::tuple_size<typename CONTAINER_T::value_type>::value;
using particle_type = typename CONTAINER_T::value_type;
constexpr int nb_elt_per_par = meta::tuple_size_v<particle_type>;
// Not good output_values are put in input_values
constexpr int nb_input_per_par = CONTAINER_T::particle_type::inputs_size;
constexpr int nb_input_per_par = particle_type::inputs_size;
/// @todo check for different input and output types (double versus complexe)
using data_type = typename CONTAINER_T::particle_type::outputs_value_type;
using data_type = typename particle_type::outputs_value_type;
//
using particles_t = std::array<data_type, nb_elt_per_par>;
std::vector<particles_t> particles(number_particles);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment