16#ifndef IPPL_PARTICLE_ATTRIB_H
17#define IPPL_PARTICLE_ATTRIB_H
27 template <
typename T,
class... Properties>
30 ParticleAttrib<T, Properties...>,
31 sizeof(typename detail::ViewType<T, 1, Properties...>::view_type)> {
34 constexpr static unsigned dim = 1;
89 Kokkos::deep_copy(hview,
dview_m);
90 for (
size_type i = 0; i < *(this->localNum_mp); ++i) {
91 std::cout << hview(i) << std::endl;
103 void set_name(
const std::string & name_)
override { this->name_m = name_; }
105 std::string
get_name()
const override {
return this->name_m; }
120 template <
typename E,
size_t N>
151 template <
typename Field,
typename P2,
typename policy_type>
153 policy_type iteration_policy,
hash_type hash_array = {})
const;
173 template <
typename Field,
typename P2>
175 const bool addToAttribute =
false);
void serialize(const Kokkos::View< T *, ViewArgs... > &view, size_type nsends)
void deserialize(Kokkos::View< T *, ViewArgs... > &view, size_type nrecvs)
void destroy(const hash_type &deleteIndex, const hash_type &keepIndex, size_type invalidCount) override
HostMirror getHostMirror() const
typename view_type::memory_space memory_space
void create(size_type) override
void set_name(const std::string &name_) override
static constexpr unsigned dim
void unpack(size_type) override
void internalCopy(const hash_type &indices) override
Copy and create values of given indices.
virtual ~ParticleAttrib()=default
detail::size_type size_type
void scatter(Field &f, const ParticleAttrib< Vector< P2, Field::dim >, Properties... > &pp, policy_type iteration_policy, hash_type hash_array={}) const
Scatter particle attribute data onto a field.
size_type packedSize(const size_type count) const override
typename detail::ViewType< T, 1, Properties... >::view_type view_type
void gather(Field &f, const ParticleAttrib< Vector< P2, Field::dim >, Properties... > &pp, const bool addToAttribute=false)
Gather field data into the particle attribute.
const view_type & getView() const
void serialize(detail::Archive< memory_space > &ar, size_type nsends) override
typename view_type::execution_space execution_space
void deserialize(detail::Archive< memory_space > &ar, size_type nrecvs) override
KOKKOS_INLINE_FUNCTION T & operator()(const size_t i) const
typename Base::hash_type hash_type
void realloc(size_type n)
void pack(const hash_type &) override
std::string get_name() const override
typename view_type::host_mirror_type HostMirror
void applyPermutation(const hash_type &permutation) override
Sort the attribute according to a permutation.
typename detail::ParticleAttribBase<>::with_properties< Properties... > Base
ParticleAttrib< T, Properties... > & operator=(T x)
ParticleAttrib< T, Properties... > & operator=(detail::Expression< E, N > const &expr)
size_type size() const override
typename WithMemSpace< Properties... >::type with_properties