* a given triangulation and mapping. Since particles are stored in
* respect to their surrounding cells this information is necessary to
* correctly organize the particle collection.
+ * This constructor is equivalent to calling the default constructor and
+ * the initialize function.
*/
ParticleHandler(const parallel::distributed::Triangulation<dim,spacedim> &tria,
const Mapping<dim,spacedim> &mapping,
particle_iterator end();
/**
- * Return an iterator to the first particle.
+ * Return an iterator to the first ghost particle.
*/
particle_iterator begin_ghost() const;
/**
- * Return an iterator to the first particle.
+ * Return an iterator to the first ghost particle.
*/
particle_iterator begin_ghost();
/**
- * Return an iterator past the end of the particles.
+ * Return an iterator past the end of the ghost particles.
*/
particle_iterator end_ghost() const;
/**
- * Return an iterator to the first particle.
+ * Return an iterator past the end of the ghost particles.
*/
particle_iterator end_ghost();
* Insert a number of particles into the collection of particles.
* This function takes a list of positions and creates a set of particles
* at these positions, which are then added to the local particle
- * collection. Note that this function assumes all positions are within
- * the local part of the triangulation, if one of them is not in the
+ * collection. Note that this function currently uses
+ * GridTools::compute_point_locations, which assumes all positions are within
+ * the local part of the triangulation. If one of them is not in the
* local domain this function will throw an exception.
*/
void
* After this function call every particle is either on its current
* process and in its current cell, or deleted (if it could not find
* its new process or cell).
- *
- * TODO: Extend this to allow keeping particles on other processes
- * around (with an invalid cell).
*/
void
sort_particles_into_subdomains_and_cells();
update_cached_numbers();
const types::particle_index local_next_particle_index = get_next_free_particle_index();
- const types::particle_index particles_to_add_locally = positions.size();
+ types::particle_index particles_to_add_locally = positions.size();
// Determine the starting particle index of this process, which
// is the highest currently existing particle index plus the sum
void
ParticleHandler<dim,spacedim>::sort_particles_into_subdomains_and_cells()
{
+ // TODO: The current algorithm only works for particles that are in
+ // the local domain or in ghost cells, because it only knows the
+ // subdomain_id of ghost cells, but not of artificial cells. This
+ // can be extended using the distributed version of compute point
+ // locations.
+ // TODO: Extend this function to allow keeping particles on other
+ // processes around (with an invalid cell).
+
std::vector<particle_iterator> particles_out_of_cell;
particles_out_of_cell.reserve(n_locally_owned_particles());
}
}
- // TODO: The current algorithm only works for CFL numbers <= 1.0,
- // because it only knows the subdomain_id of ghost cells, but not
- // of artificial cells.
-
// There are three reasons why a particle is not in its old cell:
// It moved to another cell, to another subdomain or it left the mesh.
// Particles that moved to another cell are updated and stored inside the