8#ifndef OPENFPM_NUMERICS_SRC_VECTOR_VECTOR_UTIL_HPP_
9#define OPENFPM_NUMERICS_SRC_VECTOR_VECTOR_UTIL_HPP_
11#include "Grid/grid_dist_key.hpp"
12#include "Space/Shape/HyperCube.hpp"
13#include "util/mul_array_extents.hpp"
23template<
typename copy_type,
typename T,
typename Ev,
typename Eqs_sys,
int sa>
40 grid_dst.template get<T::value>(key) = x(lin_id * Eqs_sys::nvar + base_id);
53template<
typename copy_type,
typename T,
typename Ev,
typename Eqs_sys>
70 for (
size_t i = 0 ; i < std::extent<copy_type>::value ; i++)
72 grid_dst.template get<T::value>(key)[i] = x(lin_id * Eqs_sys::nvar + base_id + i);
90template<
typename Eqs_sys,
typename S,
typename Ev>
135 {std::cerr <<
"Error: " <<__FILE__ <<
":" << __LINE__ <<
" Passing a temporal object";};
147 typedef typename boost::mpl::at_c<typename S::value_type::type,T::value>::type copy_type;
Grid key for a distributed grid.
Struct that give functionalities on array extensions.
static void copy(Grid &grid_dst, const grid_dist_key_dx< Eqs_sys::dims > &key, const Ev &x, size_t lin_id, size_t base_id, size_t gs_size)
Constructor.
static void copy(Grid &grid_dst, const grid_dist_key_dx< Eqs_sys::dims > &key, const Ev &x, size_t lin_id, size_t base_id, size_t gs_size)
Constructor.
this class is a functor for "for_each" algorithm
S & grid_dst
destination grid
copy_ele(const grid_dist_key_dx< Eqs_sys::dims > &key, S &grid_dst, const Ev &x, size_t lin_id, size_t gs_size)
Constructor.
const grid_dist_key_dx< Eqs_sys::dims > key
destination grid element
const Ev & x
source vector
size_t lin_id
source element inside the vector
void operator()(T &t)
It call the copy function for each property.
size_t gs_size
It is basically the number of grid points the vector has inside.