|
IPPL (Independent Parallel Particle Layer)
IPPL
|
#include <ParticleAttrib.h>
Public Types | |
| typedef T | value_type |
| using | Base = typename detail::ParticleAttribBase<>::with_properties<Properties...> |
| using | hash_type = typename Base::hash_type |
| using | view_type = typename detail::ViewType<T, 1, Properties...>::view_type |
| using | HostMirror = typename view_type::host_mirror_type |
| using | memory_space = typename view_type::memory_space |
| using | execution_space = typename view_type::execution_space |
| using | size_type = detail::size_type |
Public Member Functions | |
| void | create (size_type) override |
| void | destroy (const hash_type &deleteIndex, const hash_type &keepIndex, size_type invalidCount) override |
| void | pack (const hash_type &) override |
| void | unpack (size_type) override |
| void | serialize (detail::Archive< memory_space > &ar, size_type nsends) override |
| void | deserialize (detail::Archive< memory_space > &ar, size_type nrecvs) override |
| virtual | ~ParticleAttrib ()=default |
| size_type | size () const override |
| size_type | packedSize (const size_type count) const override |
| void | resize (size_type n) |
| void | realloc (size_type n) |
| void | print () |
| KOKKOS_INLINE_FUNCTION T & | operator() (const size_t i) const |
| view_type & | getView () |
| const view_type & | getView () const |
| HostMirror | getHostMirror () const |
| void | set_name (const std::string &name_) override |
| std::string | get_name () const override |
| ParticleAttrib< T, Properties... > & | operator= (T x) |
| template<typename E, size_t N> | |
| ParticleAttrib< T, Properties... > & | operator= (detail::Expression< E, N > const &expr) |
| template<typename Field, typename P2, typename policy_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. | |
| template<typename Field, typename P2> | |
| void | gather (Field &f, const ParticleAttrib< Vector< P2, Field::dim >, Properties... > &pp, const bool addToAttribute=false) |
| Gather field data into the particle attribute. | |
| T | sum () |
| T | max () |
| T | min () |
| T | prod () |
| void | applyPermutation (const hash_type &permutation) override |
| Sort the attribute according to a permutation. | |
| void | internalCopy (const hash_type &indices) override |
| Copy and create values of given indices. | |
| template<typename Field, class PT, typename policy_type> | |
| void | scatter (Field &f, const ParticleAttrib< Vector< PT, Field::dim >, Properties... > &pp, policy_type iteration_policy, hash_type hash_array) const |
| KOKKOS_INLINE_FUNCTION auto | operator[] (size_t i) const |
Static Public Attributes | |
| static constexpr unsigned | dim = 1 |
Private Attributes | |
| view_type | dview_m |
| view_type | buf_m |
Definition at line 28 of file ParticleAttrib.h.
| using ippl::ParticleAttrib< T, Properties >::Base = typename detail::ParticleAttribBase<>::with_properties<Properties...> |
Definition at line 36 of file ParticleAttrib.h.
| using ippl::ParticleAttrib< T, Properties >::execution_space = typename view_type::execution_space |
Definition at line 45 of file ParticleAttrib.h.
| using ippl::ParticleAttrib< T, Properties >::hash_type = typename Base::hash_type |
Definition at line 38 of file ParticleAttrib.h.
| using ippl::ParticleAttrib< T, Properties >::HostMirror = typename view_type::host_mirror_type |
Definition at line 42 of file ParticleAttrib.h.
| using ippl::ParticleAttrib< T, Properties >::memory_space = typename view_type::memory_space |
Definition at line 44 of file ParticleAttrib.h.
| using ippl::ParticleAttrib< T, Properties >::size_type = detail::size_type |
Definition at line 47 of file ParticleAttrib.h.
| typedef T ippl::ParticleAttrib< T, Properties >::value_type |
Definition at line 33 of file ParticleAttrib.h.
| using ippl::ParticleAttrib< T, Properties >::view_type = typename detail::ViewType<T, 1, Properties...>::view_type |
Definition at line 40 of file ParticleAttrib.h.
|
virtualdefault |
|
override |
Sort the attribute according to a permutation.
This function sorts the attribute according to a given permutation such that afterward attr(permutation(i)) = attr(i).
| permutation | The permutation to apply |
Definition at line 220 of file ParticleAttrib.hpp.
References getView(), and size().
|
override |
Definition at line 25 of file ParticleAttrib.hpp.
References ippl::Comm, realloc(), and size().
Referenced by internalCopy().
|
inlineoverride |
Definition at line 71 of file ParticleAttrib.h.
|
override |
Particle deletion function. Partition the particles into a valid region and an invalid region.
| deleteIndex | List of indices of invalid particles in the valid region |
| keepIndex | List of indices of valid particles in the invalid region |
| invalidCount | Number of invalid particles in the valid region |
Definition at line 34 of file ParticleAttrib.hpp.
References dview_m.
| void ippl::ParticleAttrib< T, Properties >::gather | ( | Field & | f, |
| const ParticleAttrib< Vector< P2, Field::dim >, Properties... > & | pp, | ||
| const bool | addToAttribute = false ) |
Gather field data into the particle attribute.
This function gathers data from the given field into the particle attribute by iterating over all particles. Depending on the parameter addToAttribute, the gathered field value is either added to the existing attribute value (using "+=") or used to overwrite the attribute value.
| Field | The type of the field. |
| P2 | The particle type for the position attribute. |
| f | The field from which data is gathered. |
| pp | The ParticleAttrib representing particle positions. |
| addToAttribute | If true, the gathered value is added to the current attribute value; otherwise, the attribute value is overwritten. |
Definition at line 167 of file ParticleAttrib.hpp.
References Dim, ippl::Field< T, Dim, Mesh_t< Dim >, Centering_t< Dim >, ViewArgs... >::dim, and IpplTimings::getTimer().
|
inlineoverride |
Definition at line 105 of file ParticleAttrib.h.
|
inline |
Definition at line 101 of file ParticleAttrib.h.
|
inline |
Definition at line 97 of file ParticleAttrib.h.
Referenced by ippl::detail::ParticleLayout< T, Dim, PositionProperties >::applyBC(), applyPermutation(), and internalCopy().
|
inline |
Definition at line 99 of file ParticleAttrib.h.
|
override |
Copy and create values of given indices.
This functions creates new particles with the values copied from the given indices. The values will be at the highest new indices.
| indices | The indices to copy. |
Definition at line 239 of file ParticleAttrib.hpp.
References create(), getView(), and size().
| T ippl::ParticleAttrib< T, Properties >::max | ( | ) |
| T ippl::ParticleAttrib< T, Properties >::min | ( | ) |
|
inline |
Definition at line 95 of file ParticleAttrib.h.
| ParticleAttrib< T, Properties... > & ippl::ParticleAttrib< T, Properties >::operator= | ( | detail::Expression< E, N > const & | expr | ) |
Assign an arbitrary particle attribute expression
| E | expression type |
| N | size of the expression, this is necessary for running on the device since otherwise it does not allocate enough memory |
| expr | is the expression |
Definition at line 92 of file ParticleAttrib.hpp.
References dview_m.
| ParticleAttrib< T, Properties... > & ippl::ParticleAttrib< T, Properties >::operator= | ( | T | x | ) |
Assign the same value to the whole attribute.
Definition at line 81 of file ParticleAttrib.hpp.
References dview_m.
|
inlineinherited |
Access single element of the expression
Definition at line 32 of file IpplExpressions.h.
|
override |
|
inlineoverride |
Definition at line 79 of file ParticleAttrib.h.
|
inline |
Definition at line 87 of file ParticleAttrib.h.
| T ippl::ParticleAttrib< T, Properties >::prod | ( | ) |
|
inline |
Definition at line 85 of file ParticleAttrib.h.
Referenced by create().
|
inline |
Definition at line 83 of file ParticleAttrib.h.
| void ippl::ParticleAttrib< T, Properties >::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.
This function scatters data from this attribute onto the given field, using the given position attribute. The function can be used together with a custom iteration policy to iterate over a specified range and, optionally, an ippl::hash_type array to remap iteration indices.
When a non-empty hash_array is provided, the function:
Checks that the iteration policy's range does not exceed the size of hash_array.
Maps the current index to the appropriate index using the hash_array.
Careful: access pattern optimization might be lost when using hash_array.
| Field | The type of the field. |
| P2 | The type for the position attribute. |
| policy_type | The type of the Kokkos iteration policy when using hash_array. |
| f | The field onto which the particle data is scattered. |
| pp | The ParticleAttrib representing particle positions. |
| iteration_policy | A custom Kokkos::range_policy defining the iteration range. |
| hash_array | An optional ippl::hash_type array for index mapping. If empty, no map is used. |
| void ippl::ParticleAttrib< T, Properties >::scatter | ( | Field & | f, |
| const ParticleAttrib< Vector< PT, Field::dim >, Properties... > & | pp, | ||
| policy_type | iteration_policy, | ||
| hash_type | hash_array ) const |
Definition at line 106 of file ParticleAttrib.hpp.
|
inlineoverride |
Definition at line 67 of file ParticleAttrib.h.
|
inlineoverride |
Definition at line 103 of file ParticleAttrib.h.
|
inlineoverride |
Definition at line 77 of file ParticleAttrib.h.
Referenced by applyPermutation(), create(), internalCopy(), and pack().
| T ippl::ParticleAttrib< T, Properties >::sum | ( | ) |
|
override |
Definition at line 63 of file ParticleAttrib.hpp.
|
private |
Definition at line 206 of file ParticleAttrib.h.
Referenced by pack().
|
staticconstexpr |
Definition at line 34 of file ParticleAttrib.h.
|
private |
Definition at line 205 of file ParticleAttrib.h.
Referenced by destroy(), ippl::ParticleAttrib< T >::operator()(), operator=(), and operator=().