|
|
void | create (size_type, bool non_destructive=false) override |
| |
|
void | alloc (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 |
| |
|
size_type | size () const override |
| |
|
size_type | packedSize (const size_type count) const override |
| |
|
void | resize (size_type n) |
| |
| void | realloc (size_type n) |
| | Reallocate the underlying view with a new size.
|
| |
|
void | print () |
| |
|
KOKKOS_INLINE_FUNCTION T & | operator() (const size_t i) const |
| |
|
view_type & | getView () |
| |
|
const view_type & | getView () const |
| |
|
host_mirror_type | 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 |
| |
template<typename T , class... Properties>
template<typename
Field , typename P2 >
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.
- Note
- This behavior exists to give the OPAL-X field solver the ablity to gather field data per "energy bin".
- Template Parameters
-
| Field | The type of the field. |
| P2 | The particle type for the position attribute. |
- Parameters
-
| 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. |
template<typename T , class... Properties>
Reallocate the underlying view with a new size.
This function reallocates the device view to a new size. Existing data is discarded and should not be relied upon after this call. Note that this function does not apply overallocation. For use from outside, call ParticleAttrib::alloc(size_type) instead.
- Parameters
-
| n | The new size to allocate in the internal view. |
template<typename T , class... Properties>
template<typename
Field , typename P2 , typename policy_type >
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.
- Note
- This custom iteration functionality is needed to support energy binning in the field solver of OPAL-X, allowing only particles within a specific bin to be scattered.
- Template Parameters
-
| 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. |
- Parameters
-
| 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. |