Peano
Loading...
Searching...
No Matches
peano4.toolbox.particles.Particle.Particle Class Reference

Single particle. More...

Inheritance diagram for peano4.toolbox.particles.Particle.Particle:
Collaboration diagram for peano4.toolbox.particles.Particle.Particle:

Public Member Functions

 __init__ (self, name)
 Constructor.
 
- Public Member Functions inherited from peano4.datamodel.DaStGen2.DaStGen2
 configure (self, namespace, association, subdirectory="")
 Configure output.
 
 additional_load_and_store_arguments (self)
 
 additional_load_and_store_arguments (self, new_arguments)
 
 hosts_smart_pointer_attribute (self)
 Does class host a smart pointer attribute.
 
- Public Member Functions inherited from peano4.datamodel.DoF.DoF
 get_full_qualified_type (self)
 
 get_logical_type_name (self)
 What should the data type be called within the data repository, or within action sets.
 
 get_enumeration_type (self)
 What should the data type be called within the data repository.
 
 additional_load_and_store_arguments_for_other_dof (self, argument_name, use_dof_association=None)
 You can make Peano's store and load arguments of any DoF depend on other DoFs that you have loaded before.
 
 subnamespace (self)
 

Data Fields

 name
 
 partid
 
- Data Fields inherited from peano4.datamodel.DaStGen2.DaStGen2
 generator
 
 data
 
 peano4_mpi_and_storage_aspect
 
- Data Fields inherited from peano4.datamodel.DoF.DoF
 association
 
 name
 
 namespace
 
 subdirectory
 

Additional Inherited Members

- Static Public Attributes inherited from peano4.datamodel.DaStGen2.DaStGen2
str readme_descriptor
 
str readme_package_descriptor
 
- Protected Attributes inherited from peano4.datamodel.DaStGen2.DaStGen2
 _additional_load_and_store_arguments
 
- Protected Attributes inherited from peano4.datamodel.DoF.DoF
 _additional_load_and_store_arguments
 

Detailed Description

Single particle.

Represent a single particle. This is a DaStGen2 wrapper, i.e. I define a DaStGen object and add some particular fields that I always need to administer the particles.

Usage

If you use these particles, please do not add them to your use definitions of the actions/observers. For pidt, you need a second ParticleSet and this one is used by the observers.

You have to add the particle to your project though via

    my_project.add_global_object

If you want to attributes to a particle, use the data subattribute. An all-time classic is the call

   add_attribute( peano4.dastgen2.Peano4DoubleArray("v","Dimensions") )

Pre-defined fields

I actually need only very few fields in Peano's particle toolbox:

  • A position x. You can change this position in your code, but please invoke a particle re-sort once you change a particle's position. Usually, I employ the pidt (particle in dual tree) scheme, i.e. particles are always stored in the closest vertex. If you alter the position of a particle, you might destroy this association and have to re-assign the object to another vertex.
  • A search radius. Every particle in Peano has a search radius, i.e. a maximal interaction radius. As I only compare particles stored in one vertex to particles stored in a cell-connected vertex, the search radius also implicitly determines the tree grid level that I use to hold a particle. The bigger the search, the higher up in the mesh I have to store a particle.
  • A state. This state should not be manipulated by the user. A tree owns the particles that are contained within its local tree cells. Furthermore, a tree knows about the particles which are associated to a vertex that's adjacent to a local mesh. The latter particles are virtual. We effectively work with a halo of h/2 per mesh level.

The only action set that should alter the state is UpdateParallelState.

State updates

If a particle moves, we have to update its state, and we might have to update its vertex association. This discussion focuses on the state update.

Details can be found in UpdateParallelState.

Debug information

If any debug level is active, each particle carries a unique identifier.

Performance optimisation

Particles in Peano are typically stored in the vertex next to them. This is the pidt (paricle in dual tree) technique referenced in the Readme.md file that's automatically generated when you use the particle toolbox.

In the illustration below, the blue paricle is associated to the vertex left above it, the red one belongs to the vertex right of it.

The logical information where the "owning" vertex of a particle is is easy to compute at any time from the geometric context. However, we found that this recomputation is quickly becoming excessively expensive. Therefore, we add the field

self.data.add_attribute(
dastgen2.attributes.BooleanArray("containedInAdjacentCell", "TwoPowerD", compress=True)
)
Represent an array of boolean flags.

to the data model which encodes this information. It is to be set properly by the particle sorting algorithm in use.

In the example above, the bitfield would hold 010 (read from right to left) for the blue particle and 0100 for the red one. The code is read from the vertex's point of view: If we look at the centre vertex and study the position of particle, it is not in the left bottom adjacent cell. It is however in the right bottom adjacent cell. So we use a lexicographic enumeration of the adjacent cells.

As the position of a particle within cells is not unique if a particle resides exactly on the face between two cells, the bitfield can hold more than one entry.

Definition at line 10 of file Particle.py.

Constructor & Destructor Documentation

◆ __init__()

Field Documentation

◆ name

◆ partid

peano4.toolbox.particles.Particle.Particle.partid

Definition at line 128 of file Particle.py.


The documentation for this class was generated from the following file: