![]() |
deal.II version 9.8.0
|
#include <deal.II/particles/particle_accessor.h>
Accessor class used by ParticleIterator to access particle data.
Definition at line 48 of file particle_accessor.h.
Classes | |
| struct | ParticlesInCell |
Public Types | |
| using | particle_container = std::list<ParticlesInCell> |
Public Member Functions | |
| void * | write_particle_data_to_memory (void *data) const |
| const void * | read_particle_data_from_memory (const void *data) |
| void | set_location (const Point< spacedim > &new_location) |
| const Point< spacedim > & | get_location () const |
| Point< spacedim > & | get_location () |
| void | set_reference_location (const Point< dim > &new_reference_location) |
| const Point< dim > & | get_reference_location () const |
| void | set_id (const types::particle_index &new_id) |
| types::particle_index | get_id () const |
| types::particle_index | get_local_index () const |
| bool | has_properties () const |
| void | set_properties (const std::vector< double > &new_properties) |
| void | set_properties (const ArrayView< const double > &new_properties) |
| void | set_properties (const Tensor< 1, dim > &new_properties) |
| ArrayView< double > | get_properties () |
| ArrayView< const double > | get_properties () const |
| std::size_t | serialized_size_in_bytes () const |
| const Triangulation< dim, spacedim >::cell_iterator & | get_surrounding_cell () const |
| template<class Archive> | |
| void | save (Archive &ar, const unsigned int version) const |
| template<class Archive> | |
| void | load (Archive &ar, const unsigned int version) |
| template<class Archive> | |
| void | serialize (Archive &archive, const unsigned int version) |
| void | next () |
| void | prev () |
| bool | operator!= (const ParticleAccessor< dim, spacedim > &other) const |
| bool | operator== (const ParticleAccessor< dim, spacedim > &other) const |
| IteratorState::IteratorStates | state () const |
Private Member Functions | |
| ParticleAccessor () | |
| ParticleAccessor (const typename particle_container::iterator particles_in_cell, const PropertyPool< dim, spacedim > &property_pool, const unsigned int particle_index_within_cell) | |
| const PropertyPool< dim, spacedim >::Handle & | get_handle () const |
| PropertyPool< dim, spacedim >::Handle & | get_handle () |
Private Attributes | |
| particle_container::iterator | particles_in_cell |
| PropertyPool< dim, spacedim > * | property_pool |
| unsigned int | particle_index_within_cell |
Friends | |
| template<int, int> | |
| class | ParticleIterator |
| template<int, int> | |
| class | ParticleHandler |
| using Particles::ParticleAccessor< dim, spacedim >::particle_container = std::list<ParticlesInCell> |
A type for the storage container for particles.
Definition at line 116 of file particle_accessor.h.
|
inlineprivate |
Construct an invalid accessor. Such an object is not usable.
Definition at line 550 of file particle_accessor.h.
|
inlineprivate |
Construct an accessor from a reference to a container, an iterator to the current cell, and the particle index within that cell. This constructor is private so that it can only be accessed by friend classes.
Definition at line 559 of file particle_accessor.h.
|
inline |
Write particle data into a data array. The array is expected to be large enough to take the data, and the void pointer should point to the first entry of the array to which the data should be written. This function is meant for serializing all particle properties and later de-serializing the properties by calling the appropriate constructor Particle(void *&data, PropertyPool *property_pool = nullptr);
| [in] | data | The memory location to write particle data into. |
Definition at line 609 of file particle_accessor.h.
|
inline |
Update all of the data associated with a particle: id, location, reference location and, if any, properties by using a data array. The array is expected to be large enough to take the data, and the void pointer should point to the first entry of the array to which the data should be written. This function is meant for de-serializing the particle data without requiring that a new Particle class be built. This is used in the ParticleHandler to update the ghost particles without de-allocating and re-allocating memory.
| [in] | data | A pointer to a memory location from which to read the information that completely describes a particle. This class then de-serializes its data from this memory location. |
Definition at line 572 of file particle_accessor.h.
|
inline |
Set the location of this particle. Note that this does not check whether this is a valid location in the simulation domain.
| [in] | new_location | The new location for this particle. |
Definition at line 643 of file particle_accessor.h.
|
inline |
Get read-access to the location of this particle.
Definition at line 654 of file particle_accessor.h.
|
inline |
Get read- and write-access to the location of this particle. Note that changing the location does not check whether this is a valid location in the simulation domain.
Definition at line 665 of file particle_accessor.h.
|
inline |
Set the reference location of this particle.
| [in] | new_reference_location | The new reference location for this particle. |
Definition at line 676 of file particle_accessor.h.
|
inline |
Return the reference location of this particle in its current cell.
Definition at line 688 of file particle_accessor.h.
|
inline |
Set the ID number of this particle.
Definition at line 721 of file particle_accessor.h.
|
inline |
Return the ID number of this particle.
Definition at line 699 of file particle_accessor.h.
|
inline |
Return a particle ID number local to each MPI process. This number enables the direct array access (similar to LinearAlgebra::distributed::Vector::local_element()) to quantities used for local computations. Use ParticleHandler::get_max_local_particle_index() to query suitable array sizes.
Definition at line 710 of file particle_accessor.h.
|
inline |
Return whether this particle has a valid property pool and a valid handle to properties.
Definition at line 732 of file particle_accessor.h.
|
inline |
Set the properties of this particle.
| [in] | new_properties | A vector containing the new properties for this particle. |
Definition at line 750 of file particle_accessor.h.
|
inline |
Set the properties of this particle.
| [in] | new_properties | An ArrayView pointing to memory locations containing the new properties for this particle. |
Definition at line 763 of file particle_accessor.h.
|
inline |
Set the properties of this particle, assuming that the properties stored on this particle correspond to a rank-1 Tensor object. In particular, this means that the number of properties stored on the particle must equal dim.
| [in] | new_properties | A Tensor containing the new properties for this particle. |
Definition at line 790 of file particle_accessor.h.
|
inline |
Get write-access to properties of this particle.
Definition at line 333 of file particle_accessor.h.
|
inline |
Get read-access to properties of this particle.
Definition at line 809 of file particle_accessor.h.
|
inline |
Return the size in bytes this particle occupies if all of its data is serialized (i.e. the number of bytes that is written by the write_data function of this class).
Definition at line 839 of file particle_accessor.h.
|
inline |
Get a cell iterator to the cell surrounding the current particle.
Definition at line 820 of file particle_accessor.h.
|
inline |
Write the data of this object to a stream for the purpose of serialization using the BOOST serialization library.
Definition at line 528 of file particle_accessor.h.
|
inline |
Read the data of this object from a stream for the purpose of serialization using the BOOST serialization library.
Definition at line 494 of file particle_accessor.h.
| void Particles::ParticleAccessor< dim, spacedim >::serialize | ( | Archive & | archive, |
| const unsigned int | version ) |
Write and read the data of this object from a stream for the purpose of serialization using the BOOST serialization library.
|
inline |
Advance the ParticleAccessor to the next particle.
Definition at line 858 of file particle_accessor.h.
|
inline |
Move the ParticleAccessor to the previous particle.
Definition at line 875 of file particle_accessor.h.
|
inline |
Inequality operator.
Definition at line 894 of file particle_accessor.h.
|
inline |
Equality operator.
Definition at line 904 of file particle_accessor.h.
|
inline |
Return the state of the accessor.
Definition at line 916 of file particle_accessor.h.
|
inlineprivate |
Returns a reference to the current Particle. Because the internal structure may change this is not intended for public use and only a convenience function for internal purposes.
Definition at line 945 of file particle_accessor.h.
|
inlineprivate |
Non-const version of the function with the same name above.
Definition at line 936 of file particle_accessor.h.
Definition at line 484 of file particle_accessor.h.
Definition at line 486 of file particle_accessor.h.
|
private |
An iterator to the particles in the current cell within the particle_container object.
Definition at line 469 of file particle_accessor.h.
|
private |
A pointer to the property pool that stores the actual particle data.
Definition at line 474 of file particle_accessor.h.
|
private |
Local index of the particle within its current cell.
Definition at line 479 of file particle_accessor.h.