From: Rene Gassmoeller Date: Tue, 14 Nov 2017 17:19:30 +0000 (-0700) Subject: Address comments X-Git-Tag: v9.0.0-rc1~763^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c83e00b20120df497f12de1ca18b4869c09fcc7;p=dealii.git Address comments --- diff --git a/include/deal.II/particles/particle.h b/include/deal.II/particles/particle.h index 0e9b80641e..61bffd17fa 100644 --- a/include/deal.II/particles/particle.h +++ b/include/deal.II/particles/particle.h @@ -24,9 +24,6 @@ DEAL_II_NAMESPACE_OPEN -/** - * A namespace for all type definitions related to particles. - */ namespace types { /* Type definitions */ diff --git a/include/deal.II/particles/particle_handler.h b/include/deal.II/particles/particle_handler.h index 03b3ce2da7..c93c6d64d8 100644 --- a/include/deal.II/particles/particle_handler.h +++ b/include/deal.II/particles/particle_handler.h @@ -70,6 +70,8 @@ namespace Particles * 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 &tria, const Mapping &mapping, @@ -132,22 +134,22 @@ namespace Particles 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(); @@ -197,8 +199,9 @@ namespace Particles * 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 @@ -293,9 +296,6 @@ namespace Particles * 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(); diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index ae6d927ba4..fe7cfd4a3c 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -290,7 +290,7 @@ namespace Particles 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 @@ -437,6 +437,14 @@ namespace Particles void ParticleHandler::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 particles_out_of_cell; particles_out_of_cell.reserve(n_locally_owned_particles()); @@ -465,10 +473,6 @@ namespace 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