![]() |
deal.II version 9.7.1
|
#include <deal.II/particles/particle_accessor.h>
Accessor class used by ParticleIterator to access particle data.
Definition at line 50 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 118 of file particle_accessor.h.
|
inlineprivate |
Construct an invalid accessor. Such an object is not usable.
Definition at line 552 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 561 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 611 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 574 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 645 of file particle_accessor.h.
|
inline |
Get read-access to the location of this particle.
Definition at line 656 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 667 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 678 of file particle_accessor.h.
|
inline |
Return the reference location of this particle in its current cell.
Definition at line 690 of file particle_accessor.h.
|
inline |
Set the ID number of this particle.
Definition at line 723 of file particle_accessor.h.
|
inline |
Return the ID number of this particle.
Definition at line 701 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 712 of file particle_accessor.h.
|
inline |
Return whether this particle has a valid property pool and a valid handle to properties.
Definition at line 734 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 752 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 765 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 792 of file particle_accessor.h.
|
inline |
Get write-access to properties of this particle.
Definition at line 335 of file particle_accessor.h.
|
inline |
Get read-access to properties of this particle.
Definition at line 811 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 841 of file particle_accessor.h.
|
inline |
Get a cell iterator to the cell surrounding the current particle.
Definition at line 822 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 530 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 496 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 860 of file particle_accessor.h.
|
inline |
Move the ParticleAccessor to the previous particle.
Definition at line 877 of file particle_accessor.h.
|
inline |
Inequality operator.
Definition at line 896 of file particle_accessor.h.
|
inline |
Equality operator.
Definition at line 906 of file particle_accessor.h.
|
inline |
Return the state of the accessor.
Definition at line 918 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 947 of file particle_accessor.h.
|
inlineprivate |
Non-const version of the function with the same name above.
Definition at line 938 of file particle_accessor.h.
Definition at line 486 of file particle_accessor.h.
Definition at line 488 of file particle_accessor.h.
|
private |
An iterator to the particles in the current cell within the particle_container object.
Definition at line 471 of file particle_accessor.h.
|
private |
A pointer to the property pool that stores the actual particle data.
Definition at line 476 of file particle_accessor.h.
|
private |
Local index of the particle within its current cell.
Definition at line 481 of file particle_accessor.h.