Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
e30f6b45
Commit
e30f6b45
authored
Mar 26, 2021
by
ESTERIE Pierre
Browse files
Fix problem with particle_type in container
parent
2194e395
Changes
3
Hide whitespace changes
Inline
Side-by-side
experimental/include/scalfmm/meta/traits.hpp
View file @
e30f6b45
...
...
@@ -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
{
...
...
experimental/include/scalfmm/meta/utils.hpp
View file @
e30f6b45
...
...
@@ -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
&&
{
...
...
experimental/include/scalfmm/tools/fma_loader.hpp
View file @
e30f6b45
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment