]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Address comments
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Tue, 14 Nov 2017 17:19:30 +0000 (10:19 -0700)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Wed, 15 Nov 2017 16:38:40 +0000 (09:38 -0700)
include/deal.II/particles/particle.h
include/deal.II/particles/particle_handler.h
source/particles/particle_handler.cc

index 0e9b80641ee6cb9119f433de79821b8551bbdcc2..61bffd17faff5c0305648ec07adcc417cc978eea 100644 (file)
@@ -24,9 +24,6 @@
 
 DEAL_II_NAMESPACE_OPEN
 
-/**
- * A namespace for all type definitions related to particles.
- */
 namespace types
 {
   /* Type definitions */
index 03b3ce2da7825bcde59626e309a63d60743b2704..c93c6d64d86a8d3436afc64a110a337172840fde 100644 (file)
@@ -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<dim,spacedim> &tria,
                     const Mapping<dim,spacedim> &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();
index ae6d927ba4bda06920a2c081a9023b0977af063e..fe7cfd4a3c21cea332e1264dbc135d36acbebefb 100644 (file)
@@ -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<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());
 
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.