]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Generate particles on support or quadrature points on other grid 9073/head
authorLuca Heltai <luca.heltai@sissa.it>
Thu, 21 Nov 2019 18:57:16 +0000 (19:57 +0100)
committerBruno Blais <blais.bruno@gmail.com>
Tue, 7 Jan 2020 12:09:42 +0000 (07:09 -0500)
Functions that generates particles at the location of the support points of a
possibly non-matching grid or at the quadrature points of a possibly non-matching grid

The total number of particles that is added to the particle_handler
object is the number of dofs of the DoFHandler that is passed that are
within the triangulation and whose components are within the
ComponentMask.

Co-authored-by: Bruno Blais <blais.bruno@gmail.com>
Co-authored-by: Luca Heltai <luca.heltai@sissa.it>
include/deal.II/particles/generators.h
source/particles/generators.cc
source/particles/generators.inst.in
tests/particles/generators_07.cc [new file with mode: 0644]
tests/particles/generators_07.with_p4est=true.mpirun=1.output [new file with mode: 0644]
tests/particles/generators_07.with_p4est=true.mpirun=3.output [new file with mode: 0644]
tests/particles/generators_08.cc [new file with mode: 0644]
tests/particles/generators_08.with_p4est=true.mpirun=1.output [new file with mode: 0644]
tests/particles/generators_08.with_p4est=true.mpirun=3.output [new file with mode: 0644]

index bac34ab166b9d76948424c332531545ed457e44a..05f966d0ec0a988dfc2ec095b4799cd2620900ba 100644 (file)
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/function.h>
+#include <deal.II/base/quadrature.h>
 
 #include <deal.II/distributed/tria.h>
 
+#include <deal.II/dofs/dof_handler.h>
+
 #include <deal.II/fe/mapping.h>
 #include <deal.II/fe/mapping_q1.h>
 
@@ -162,6 +165,87 @@ namespace Particles
         StaticMappingQ1<dim, spacedim>::mapping,
       const unsigned int random_number_seed = 5432);
 
+
+    /**
+     * A function that generates particles at the locations of the support
+     * points of a DoFHandler, possibly based on a different Triangulation with
+     * respect to the one used to construct the ParticleHandler.
+     * The total number of particles that is added to the @p particle_handler object is
+     * the number of dofs of the DoFHandler that is passed that are within the
+     * triangulation and whose components are within the ComponentMask.
+     * This function uses insert_global_particles and consequently may induce
+     * considerable mpi communication overhead.
+     *
+     * @param[in] dof_handler A DOF handler that may live on another
+     * triangulation that is used to establsh the positions of the particles.
+     *
+     * @param[in] A vector that contains all the bounding boxes for all
+     * processors. This vector can be established by first using
+     * 'GridTools::compute_mesh_predicate_bounding_box()' and gathering all the
+     * bounding boxes using 'Utilities::MPI::all_gather().
+     *
+     * @param[in,out] particle_handler The particle handler that will take
+     * ownership of the generated particles. The particles that are generated
+     * will be appended to the particles currently owned by the particle
+     * handler.
+     *
+     * @param[in] mapping An optional mapping object that is used to map
+     * the DOF locations. If no mapping is provided a MappingQ1 is assumed.
+     *
+     * @param[in] components Component mask that decides which subset of the
+     * support points of the dof_handler are used to generate the particles.
+     *
+     * @author Bruno Blais, Luca Heltai, 2019
+     */
+    template <int dim, int spacedim = dim>
+    void
+    dof_support_points(const DoFHandler<dim, spacedim> &dof_handler,
+                       const std::vector<std::vector<BoundingBox<spacedim>>>
+                         &                             global_bounding_boxes,
+                       ParticleHandler<dim, spacedim> &particle_handler,
+                       const Mapping<dim, spacedim> &  mapping =
+                         StaticMappingQ1<dim, spacedim>::mapping,
+                       const ComponentMask &components = ComponentMask());
+
+    /**
+     * A function that generates particles at the locations of the quadrature
+     * points of a Triangulation. This Triangulation can be different
+     * from the one used to construct the ParticleHandler.
+     * The total number of particles that is added to the @p particle_handler object is the
+     * number of cells multiplied by the number of particle reference locations
+     * which are generally constructed using a quadrature.
+     * This function uses insert_global_particles and consequently may
+     * induce considerable mpi communication overhead.
+     *
+     * @param[in] triangulation The possibly non-matching triangulation which is
+     * used to insert the particles into the domain.
+     *
+     * @param[in] quadrature A quadrature whose reference location are used to
+     * insert the particles within the cells.
+     *
+     * @param[in] global_bounding_boxes A vector that contains all the bounding
+     * boxes for all processors. This vector can be established by first using
+     * 'GridTools::compute_mesh_predicate_bounding_box()' and gathering all the
+     * bounding boxes using 'Utilities::MPI::all_gather.
+     *
+     * @param[in,out] particle_handler The particle handler that will take
+     * ownership of the generated particles.
+     *
+     * @param[in] mapping An optional mapping object that is used to map
+     * the quadrature locations. If no mapping is provided a MappingQ1 is
+     * assumed.
+     *
+     * @author Bruno Blais, Luca Heltai, 2019
+     */
+    template <int dim, int spacedim = dim>
+    void
+    quadrature_points(const Triangulation<dim, spacedim> &particle_tria,
+                      const Quadrature<dim> &             quadrature,
+                      const std::vector<std::vector<BoundingBox<spacedim>>>
+                        &                             global_bounding_boxes,
+                      ParticleHandler<dim, spacedim> &particle_handler,
+                      const Mapping<dim, spacedim> &  mapping =
+                        StaticMappingQ1<dim, spacedim>::mapping);
   } // namespace Generators
 } // namespace Particles
 
index 9619fa0e25b63fb9b8fba8dbec280065f6d69581..1d3713b255af213d15457219f4a22c41d06e825a 100644 (file)
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/signaling_nan.h>
 
+#include <deal.II/dofs/dof_tools.h>
+
 #include <deal.II/fe/fe_nothing.h>
 #include <deal.II/fe/fe_values.h>
 
+#include <deal.II/grid/filtered_iterator.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/grid_tools_cache.h>
+
 #include <deal.II/particles/generators.h>
 
 DEAL_II_NAMESPACE_OPEN
@@ -391,6 +397,75 @@ namespace Particles
         particle_handler.insert_particles(particles);
       }
     }
+
+    template <int dim, int spacedim>
+    void
+    dof_support_points(const DoFHandler<dim, spacedim> &dof_handler,
+                       const std::vector<std::vector<BoundingBox<spacedim>>>
+                         &                             global_bounding_boxes,
+                       ParticleHandler<dim, spacedim> &particle_handler,
+                       const Mapping<dim, spacedim> &  mapping,
+                       const ComponentMask &           components)
+    {
+      const auto &fe = dof_handler.get_fe();
+
+      // Take care of components
+      const ComponentMask mask =
+        (components.size() == 0 ? ComponentMask(fe.n_components(), true) :
+                                  components);
+
+      std::map<types::global_dof_index, Point<spacedim>> support_points_map;
+
+      DoFTools::map_dofs_to_support_points(mapping,
+                                           dof_handler,
+                                           support_points_map,
+                                           mask);
+
+      // Generate the vector of points from the map
+      // Memory is reserved for efficiency reasons
+      std::vector<Point<spacedim>> support_points_vec;
+      support_points_vec.reserve(support_points_map.size());
+      for (auto const &element : support_points_map)
+        support_points_vec.push_back(element.second);
+
+      particle_handler.insert_global_particles(support_points_vec,
+                                               global_bounding_boxes);
+    }
+
+
+    template <int dim, int spacedim>
+    void
+    quadrature_points(
+      const Triangulation<dim, spacedim> &particle_tria,
+      const Quadrature<dim> &             quadrature,
+      // const std::vector<Point<dim>> &     particle_reference_locations,
+      const std::vector<std::vector<BoundingBox<spacedim>>>
+        &                             global_bounding_boxes,
+      ParticleHandler<dim, spacedim> &particle_handler,
+      const Mapping<dim, spacedim> &  mapping)
+    {
+      const std::vector<Point<dim>> &particle_reference_locations =
+        quadrature.get_points();
+      std::vector<Point<spacedim>> points_to_generate;
+
+      //       Loop through cells and gather gauss points
+      for (const auto &cell : particle_tria.active_cell_iterators())
+        {
+          if (cell->is_locally_owned())
+            {
+              for (const auto &reference_location :
+                   particle_reference_locations)
+                {
+                  const Point<spacedim> position_real =
+                    mapping.transform_unit_to_real_cell(cell,
+                                                        reference_location);
+                  points_to_generate.push_back(position_real);
+                }
+            }
+        }
+      particle_handler.insert_global_particles(points_to_generate,
+                                               global_bounding_boxes);
+    }
   } // namespace Generators
 } // namespace Particles
 
index bef4d7dc825c8f69ba846bdcc5faba1454801b0a..e1dfb5ec3d6e5c64f9c00d1cf690d6665ab2de06 100644 (file)
@@ -51,6 +51,29 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
             &particle_handler,
           const Mapping<deal_II_dimension, deal_II_space_dimension> &mapping,
           const unsigned int random_number_seed);
+
+        template void
+        dof_support_points<deal_II_dimension, deal_II_space_dimension>(
+          const DoFHandler<deal_II_dimension, deal_II_space_dimension>
+            &particle_dof_handler,
+          const std::vector<std::vector<BoundingBox<deal_II_space_dimension>>>
+            &global_bounding_boxes,
+          ParticleHandler<deal_II_dimension, deal_II_space_dimension>
+            &particle_handler,
+          const Mapping<deal_II_dimension, deal_II_space_dimension> &mapping,
+          const ComponentMask &components);
+
+        template void
+        quadrature_points<deal_II_dimension, deal_II_space_dimension>(
+          const Triangulation<deal_II_dimension, deal_II_space_dimension>
+            &                                  particle_tria,
+          const Quadrature<deal_II_dimension> &quadrature,
+          const std::vector<std::vector<BoundingBox<deal_II_space_dimension>>>
+            &global_bounding_boxes,
+          ParticleHandler<deal_II_dimension, deal_II_space_dimension>
+            &particle_handler,
+          const Mapping<deal_II_dimension, deal_II_space_dimension> &mapping);
+
       \}
     \}
 #endif
diff --git a/tests/particles/generators_07.cc b/tests/particles/generators_07.cc
new file mode 100644 (file)
index 0000000..018dd35
--- /dev/null
@@ -0,0 +1,124 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2019 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+// Insert particles within an hyper_cube triangulation using the degrees of
+// freedom associated with a non-matching hyper_cube triangulation and then
+// check if the particles are correctly positioned
+
+#include <deal.II/base/bounding_box.h>
+#include <deal.II/base/function_lib.h>
+
+#include <deal.II/distributed/tria.h>
+
+#include <deal.II/dofs/dof_handler.h>
+
+#include <deal.II/fe/fe_nothing.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/mapping_q.h>
+
+#include <deal.II/grid/filtered_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_tools.h>
+
+#include <deal.II/particles/generators.h>
+#include <deal.II/particles/particle_handler.h>
+
+#include "../tests.h"
+
+template <int dim, int spacedim>
+void
+test()
+{
+  parallel::distributed::Triangulation<dim, spacedim> tr(MPI_COMM_WORLD);
+
+  GridGenerator::hyper_cube(tr);
+  tr.refine_global(2);
+
+  DoFHandler<dim, spacedim>       dof_handler(tr);
+  const FE_Nothing<dim, spacedim> fe_nothing;
+  dof_handler.distribute_dofs(fe_nothing);
+
+  const MappingQ<dim, spacedim> mapping(1);
+
+  Particles::ParticleHandler<dim, spacedim> particle_handler(tr, mapping);
+
+  parallel::distributed::Triangulation<dim, spacedim> particles_tr(
+    MPI_COMM_WORLD);
+  GridGenerator::hyper_cube(particles_tr, 0.1, 0.9);
+
+  // Generate the necessary bounding boxes for the generator
+  const auto my_bounding_box = GridTools::compute_mesh_predicate_bounding_box(
+    tr, IteratorFilters::LocallyOwnedCell());
+  const auto global_bounding_boxes =
+    Utilities::MPI::all_gather(MPI_COMM_WORLD, my_bounding_box);
+
+  DoFHandler<dim, spacedim> particles_dof_handler(particles_tr);
+  const FE_Q<dim, spacedim> particles_fe(1);
+  particles_dof_handler.distribute_dofs(particles_fe);
+
+
+  Particles::Generators::dof_support_points(particles_dof_handler,
+                                            global_bounding_boxes,
+                                            particle_handler);
+
+
+  {
+    deallog << "Locally owned active cells: "
+            << tr.n_locally_owned_active_cells() << std::endl;
+
+    deallog << "Global particles: " << particle_handler.n_global_particles()
+            << std::endl;
+
+    for (const auto &cell : tr.active_cell_iterators())
+      {
+        if (cell->is_locally_owned())
+          {
+            deallog << "Cell " << cell << " has "
+                    << particle_handler.n_particles_in_cell(cell)
+                    << " particles." << std::endl;
+          }
+      }
+
+    for (const auto &particle : particle_handler)
+      {
+        deallog << "Particle index " << particle.get_id() << " is in cell "
+                << particle.get_surrounding_cell(tr) << std::endl;
+        deallog << "Particle location: " << particle.get_location()
+                << std::endl;
+      }
+  }
+  deallog << "OK" << std::endl;
+}
+
+
+
+int
+main(int argc, char *argv[])
+{
+  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
+
+  MPILogInitAll init;
+
+  deallog.push("2d/2d");
+  test<2, 2>();
+  deallog.pop();
+  deallog.push("2d/3d");
+  test<2, 3>();
+  deallog.pop();
+  deallog.push("3d/3d");
+  test<3, 3>();
+  deallog.pop();
+}
diff --git a/tests/particles/generators_07.with_p4est=true.mpirun=1.output b/tests/particles/generators_07.with_p4est=true.mpirun=1.output
new file mode 100644 (file)
index 0000000..7e79cff
--- /dev/null
@@ -0,0 +1,138 @@
+
+DEAL:0:2d/2d::Locally owned active cells: 16
+DEAL:0:2d/2d::Global particles: 4
+DEAL:0:2d/2d::Cell 2.0 has 1 particles.
+DEAL:0:2d/2d::Cell 2.1 has 0 particles.
+DEAL:0:2d/2d::Cell 2.2 has 0 particles.
+DEAL:0:2d/2d::Cell 2.3 has 0 particles.
+DEAL:0:2d/2d::Cell 2.4 has 0 particles.
+DEAL:0:2d/2d::Cell 2.5 has 1 particles.
+DEAL:0:2d/2d::Cell 2.6 has 0 particles.
+DEAL:0:2d/2d::Cell 2.7 has 0 particles.
+DEAL:0:2d/2d::Cell 2.8 has 0 particles.
+DEAL:0:2d/2d::Cell 2.9 has 0 particles.
+DEAL:0:2d/2d::Cell 2.10 has 1 particles.
+DEAL:0:2d/2d::Cell 2.11 has 0 particles.
+DEAL:0:2d/2d::Cell 2.12 has 0 particles.
+DEAL:0:2d/2d::Cell 2.13 has 0 particles.
+DEAL:0:2d/2d::Cell 2.14 has 0 particles.
+DEAL:0:2d/2d::Cell 2.15 has 1 particles.
+DEAL:0:2d/2d::Particle index 0 is in cell 2.0
+DEAL:0:2d/2d::Particle location: 0.100000 0.100000
+DEAL:0:2d/2d::Particle index 1 is in cell 2.5
+DEAL:0:2d/2d::Particle location: 0.900000 0.100000
+DEAL:0:2d/2d::Particle index 2 is in cell 2.10
+DEAL:0:2d/2d::Particle location: 0.100000 0.900000
+DEAL:0:2d/2d::Particle index 3 is in cell 2.15
+DEAL:0:2d/2d::Particle location: 0.900000 0.900000
+DEAL:0:2d/2d::OK
+DEAL:0:2d/3d::Locally owned active cells: 16
+DEAL:0:2d/3d::Global particles: 4
+DEAL:0:2d/3d::Cell 2.0 has 1 particles.
+DEAL:0:2d/3d::Cell 2.1 has 0 particles.
+DEAL:0:2d/3d::Cell 2.2 has 0 particles.
+DEAL:0:2d/3d::Cell 2.3 has 0 particles.
+DEAL:0:2d/3d::Cell 2.4 has 0 particles.
+DEAL:0:2d/3d::Cell 2.5 has 1 particles.
+DEAL:0:2d/3d::Cell 2.6 has 0 particles.
+DEAL:0:2d/3d::Cell 2.7 has 0 particles.
+DEAL:0:2d/3d::Cell 2.8 has 0 particles.
+DEAL:0:2d/3d::Cell 2.9 has 0 particles.
+DEAL:0:2d/3d::Cell 2.10 has 1 particles.
+DEAL:0:2d/3d::Cell 2.11 has 0 particles.
+DEAL:0:2d/3d::Cell 2.12 has 0 particles.
+DEAL:0:2d/3d::Cell 2.13 has 0 particles.
+DEAL:0:2d/3d::Cell 2.14 has 0 particles.
+DEAL:0:2d/3d::Cell 2.15 has 1 particles.
+DEAL:0:2d/3d::Particle index 0 is in cell 2.0
+DEAL:0:2d/3d::Particle location: 0.100000 0.100000 0.00000
+DEAL:0:2d/3d::Particle index 1 is in cell 2.5
+DEAL:0:2d/3d::Particle location: 0.900000 0.100000 0.00000
+DEAL:0:2d/3d::Particle index 2 is in cell 2.10
+DEAL:0:2d/3d::Particle location: 0.100000 0.900000 0.00000
+DEAL:0:2d/3d::Particle index 3 is in cell 2.15
+DEAL:0:2d/3d::Particle location: 0.900000 0.900000 0.00000
+DEAL:0:2d/3d::OK
+DEAL:0:3d/3d::Locally owned active cells: 64
+DEAL:0:3d/3d::Global particles: 8
+DEAL:0:3d/3d::Cell 2.0 has 1 particles.
+DEAL:0:3d/3d::Cell 2.1 has 0 particles.
+DEAL:0:3d/3d::Cell 2.2 has 0 particles.
+DEAL:0:3d/3d::Cell 2.3 has 0 particles.
+DEAL:0:3d/3d::Cell 2.4 has 0 particles.
+DEAL:0:3d/3d::Cell 2.5 has 0 particles.
+DEAL:0:3d/3d::Cell 2.6 has 0 particles.
+DEAL:0:3d/3d::Cell 2.7 has 0 particles.
+DEAL:0:3d/3d::Cell 2.8 has 0 particles.
+DEAL:0:3d/3d::Cell 2.9 has 1 particles.
+DEAL:0:3d/3d::Cell 2.10 has 0 particles.
+DEAL:0:3d/3d::Cell 2.11 has 0 particles.
+DEAL:0:3d/3d::Cell 2.12 has 0 particles.
+DEAL:0:3d/3d::Cell 2.13 has 0 particles.
+DEAL:0:3d/3d::Cell 2.14 has 0 particles.
+DEAL:0:3d/3d::Cell 2.15 has 0 particles.
+DEAL:0:3d/3d::Cell 2.16 has 0 particles.
+DEAL:0:3d/3d::Cell 2.17 has 0 particles.
+DEAL:0:3d/3d::Cell 2.18 has 1 particles.
+DEAL:0:3d/3d::Cell 2.19 has 0 particles.
+DEAL:0:3d/3d::Cell 2.20 has 0 particles.
+DEAL:0:3d/3d::Cell 2.21 has 0 particles.
+DEAL:0:3d/3d::Cell 2.22 has 0 particles.
+DEAL:0:3d/3d::Cell 2.23 has 0 particles.
+DEAL:0:3d/3d::Cell 2.24 has 0 particles.
+DEAL:0:3d/3d::Cell 2.25 has 0 particles.
+DEAL:0:3d/3d::Cell 2.26 has 0 particles.
+DEAL:0:3d/3d::Cell 2.27 has 1 particles.
+DEAL:0:3d/3d::Cell 2.28 has 0 particles.
+DEAL:0:3d/3d::Cell 2.29 has 0 particles.
+DEAL:0:3d/3d::Cell 2.30 has 0 particles.
+DEAL:0:3d/3d::Cell 2.31 has 0 particles.
+DEAL:0:3d/3d::Cell 2.32 has 0 particles.
+DEAL:0:3d/3d::Cell 2.33 has 0 particles.
+DEAL:0:3d/3d::Cell 2.34 has 0 particles.
+DEAL:0:3d/3d::Cell 2.35 has 0 particles.
+DEAL:0:3d/3d::Cell 2.36 has 1 particles.
+DEAL:0:3d/3d::Cell 2.37 has 0 particles.
+DEAL:0:3d/3d::Cell 2.38 has 0 particles.
+DEAL:0:3d/3d::Cell 2.39 has 0 particles.
+DEAL:0:3d/3d::Cell 2.40 has 0 particles.
+DEAL:0:3d/3d::Cell 2.41 has 0 particles.
+DEAL:0:3d/3d::Cell 2.42 has 0 particles.
+DEAL:0:3d/3d::Cell 2.43 has 0 particles.
+DEAL:0:3d/3d::Cell 2.44 has 0 particles.
+DEAL:0:3d/3d::Cell 2.45 has 1 particles.
+DEAL:0:3d/3d::Cell 2.46 has 0 particles.
+DEAL:0:3d/3d::Cell 2.47 has 0 particles.
+DEAL:0:3d/3d::Cell 2.48 has 0 particles.
+DEAL:0:3d/3d::Cell 2.49 has 0 particles.
+DEAL:0:3d/3d::Cell 2.50 has 0 particles.
+DEAL:0:3d/3d::Cell 2.51 has 0 particles.
+DEAL:0:3d/3d::Cell 2.52 has 0 particles.
+DEAL:0:3d/3d::Cell 2.53 has 0 particles.
+DEAL:0:3d/3d::Cell 2.54 has 1 particles.
+DEAL:0:3d/3d::Cell 2.55 has 0 particles.
+DEAL:0:3d/3d::Cell 2.56 has 0 particles.
+DEAL:0:3d/3d::Cell 2.57 has 0 particles.
+DEAL:0:3d/3d::Cell 2.58 has 0 particles.
+DEAL:0:3d/3d::Cell 2.59 has 0 particles.
+DEAL:0:3d/3d::Cell 2.60 has 0 particles.
+DEAL:0:3d/3d::Cell 2.61 has 0 particles.
+DEAL:0:3d/3d::Cell 2.62 has 0 particles.
+DEAL:0:3d/3d::Cell 2.63 has 1 particles.
+DEAL:0:3d/3d::Particle index 0 is in cell 2.0
+DEAL:0:3d/3d::Particle location: 0.100000 0.100000 0.100000
+DEAL:0:3d/3d::Particle index 1 is in cell 2.9
+DEAL:0:3d/3d::Particle location: 0.900000 0.100000 0.100000
+DEAL:0:3d/3d::Particle index 2 is in cell 2.18
+DEAL:0:3d/3d::Particle location: 0.100000 0.900000 0.100000
+DEAL:0:3d/3d::Particle index 3 is in cell 2.27
+DEAL:0:3d/3d::Particle location: 0.900000 0.900000 0.100000
+DEAL:0:3d/3d::Particle index 4 is in cell 2.36
+DEAL:0:3d/3d::Particle location: 0.100000 0.100000 0.900000
+DEAL:0:3d/3d::Particle index 5 is in cell 2.45
+DEAL:0:3d/3d::Particle location: 0.900000 0.100000 0.900000
+DEAL:0:3d/3d::Particle index 6 is in cell 2.54
+DEAL:0:3d/3d::Particle location: 0.100000 0.900000 0.900000
+DEAL:0:3d/3d::Particle index 7 is in cell 2.63
+DEAL:0:3d/3d::Particle location: 0.900000 0.900000 0.900000
+DEAL:0:3d/3d::OK
diff --git a/tests/particles/generators_07.with_p4est=true.mpirun=3.output b/tests/particles/generators_07.with_p4est=true.mpirun=3.output
new file mode 100644 (file)
index 0000000..b652c2d
--- /dev/null
@@ -0,0 +1,160 @@
+
+DEAL:0:2d/2d::Locally owned active cells: 4
+DEAL:0:2d/2d::Global particles: 4
+DEAL:0:2d/2d::Cell 2.0 has 1 particles.
+DEAL:0:2d/2d::Cell 2.1 has 0 particles.
+DEAL:0:2d/2d::Cell 2.2 has 0 particles.
+DEAL:0:2d/2d::Cell 2.3 has 0 particles.
+DEAL:0:2d/2d::Particle index 0 is in cell 2.0
+DEAL:0:2d/2d::Particle location: 0.100000 0.100000
+DEAL:0:2d/2d::OK
+DEAL:0:2d/3d::Locally owned active cells: 4
+DEAL:0:2d/3d::Global particles: 4
+DEAL:0:2d/3d::Cell 2.0 has 1 particles.
+DEAL:0:2d/3d::Cell 2.1 has 0 particles.
+DEAL:0:2d/3d::Cell 2.2 has 0 particles.
+DEAL:0:2d/3d::Cell 2.3 has 0 particles.
+DEAL:0:2d/3d::Particle index 0 is in cell 2.0
+DEAL:0:2d/3d::Particle location: 0.100000 0.100000 0.00000
+DEAL:0:2d/3d::OK
+DEAL:0:3d/3d::Locally owned active cells: 24
+DEAL:0:3d/3d::Global particles: 8
+DEAL:0:3d/3d::Cell 2.0 has 1 particles.
+DEAL:0:3d/3d::Cell 2.1 has 0 particles.
+DEAL:0:3d/3d::Cell 2.2 has 0 particles.
+DEAL:0:3d/3d::Cell 2.3 has 0 particles.
+DEAL:0:3d/3d::Cell 2.4 has 0 particles.
+DEAL:0:3d/3d::Cell 2.5 has 0 particles.
+DEAL:0:3d/3d::Cell 2.6 has 0 particles.
+DEAL:0:3d/3d::Cell 2.7 has 0 particles.
+DEAL:0:3d/3d::Cell 2.8 has 0 particles.
+DEAL:0:3d/3d::Cell 2.9 has 1 particles.
+DEAL:0:3d/3d::Cell 2.10 has 0 particles.
+DEAL:0:3d/3d::Cell 2.11 has 0 particles.
+DEAL:0:3d/3d::Cell 2.12 has 0 particles.
+DEAL:0:3d/3d::Cell 2.13 has 0 particles.
+DEAL:0:3d/3d::Cell 2.14 has 0 particles.
+DEAL:0:3d/3d::Cell 2.15 has 0 particles.
+DEAL:0:3d/3d::Cell 2.16 has 0 particles.
+DEAL:0:3d/3d::Cell 2.17 has 0 particles.
+DEAL:0:3d/3d::Cell 2.18 has 1 particles.
+DEAL:0:3d/3d::Cell 2.19 has 0 particles.
+DEAL:0:3d/3d::Cell 2.20 has 0 particles.
+DEAL:0:3d/3d::Cell 2.21 has 0 particles.
+DEAL:0:3d/3d::Cell 2.22 has 0 particles.
+DEAL:0:3d/3d::Cell 2.23 has 0 particles.
+DEAL:0:3d/3d::Particle index 0 is in cell 2.0
+DEAL:0:3d/3d::Particle location: 0.100000 0.100000 0.100000
+DEAL:0:3d/3d::Particle index 1 is in cell 2.9
+DEAL:0:3d/3d::Particle location: 0.900000 0.100000 0.100000
+DEAL:0:3d/3d::Particle index 2 is in cell 2.18
+DEAL:0:3d/3d::Particle location: 0.100000 0.900000 0.100000
+DEAL:0:3d/3d::OK
+
+DEAL:1:2d/2d::Locally owned active cells: 8
+DEAL:1:2d/2d::Global particles: 4
+DEAL:1:2d/2d::Cell 2.4 has 0 particles.
+DEAL:1:2d/2d::Cell 2.5 has 1 particles.
+DEAL:1:2d/2d::Cell 2.6 has 0 particles.
+DEAL:1:2d/2d::Cell 2.7 has 0 particles.
+DEAL:1:2d/2d::Cell 2.8 has 0 particles.
+DEAL:1:2d/2d::Cell 2.9 has 0 particles.
+DEAL:1:2d/2d::Cell 2.10 has 1 particles.
+DEAL:1:2d/2d::Cell 2.11 has 0 particles.
+DEAL:1:2d/2d::Particle index 1 is in cell 2.5
+DEAL:1:2d/2d::Particle location: 0.900000 0.100000
+DEAL:1:2d/2d::Particle index 2 is in cell 2.10
+DEAL:1:2d/2d::Particle location: 0.100000 0.900000
+DEAL:1:2d/2d::OK
+DEAL:1:2d/3d::Locally owned active cells: 8
+DEAL:1:2d/3d::Global particles: 4
+DEAL:1:2d/3d::Cell 2.4 has 0 particles.
+DEAL:1:2d/3d::Cell 2.5 has 1 particles.
+DEAL:1:2d/3d::Cell 2.6 has 0 particles.
+DEAL:1:2d/3d::Cell 2.7 has 0 particles.
+DEAL:1:2d/3d::Cell 2.8 has 0 particles.
+DEAL:1:2d/3d::Cell 2.9 has 0 particles.
+DEAL:1:2d/3d::Cell 2.10 has 1 particles.
+DEAL:1:2d/3d::Cell 2.11 has 0 particles.
+DEAL:1:2d/3d::Particle index 1 is in cell 2.5
+DEAL:1:2d/3d::Particle location: 0.900000 0.100000 0.00000
+DEAL:1:2d/3d::Particle index 2 is in cell 2.10
+DEAL:1:2d/3d::Particle location: 0.100000 0.900000 0.00000
+DEAL:1:2d/3d::OK
+DEAL:1:3d/3d::Locally owned active cells: 16
+DEAL:1:3d/3d::Global particles: 8
+DEAL:1:3d/3d::Cell 2.24 has 0 particles.
+DEAL:1:3d/3d::Cell 2.25 has 0 particles.
+DEAL:1:3d/3d::Cell 2.26 has 0 particles.
+DEAL:1:3d/3d::Cell 2.27 has 1 particles.
+DEAL:1:3d/3d::Cell 2.28 has 0 particles.
+DEAL:1:3d/3d::Cell 2.29 has 0 particles.
+DEAL:1:3d/3d::Cell 2.30 has 0 particles.
+DEAL:1:3d/3d::Cell 2.31 has 0 particles.
+DEAL:1:3d/3d::Cell 2.32 has 0 particles.
+DEAL:1:3d/3d::Cell 2.33 has 0 particles.
+DEAL:1:3d/3d::Cell 2.34 has 0 particles.
+DEAL:1:3d/3d::Cell 2.35 has 0 particles.
+DEAL:1:3d/3d::Cell 2.36 has 1 particles.
+DEAL:1:3d/3d::Cell 2.37 has 0 particles.
+DEAL:1:3d/3d::Cell 2.38 has 0 particles.
+DEAL:1:3d/3d::Cell 2.39 has 0 particles.
+DEAL:1:3d/3d::Particle index 3 is in cell 2.27
+DEAL:1:3d/3d::Particle location: 0.900000 0.900000 0.100000
+DEAL:1:3d/3d::Particle index 4 is in cell 2.36
+DEAL:1:3d/3d::Particle location: 0.100000 0.100000 0.900000
+DEAL:1:3d/3d::OK
+
+
+DEAL:2:2d/2d::Locally owned active cells: 4
+DEAL:2:2d/2d::Global particles: 4
+DEAL:2:2d/2d::Cell 2.12 has 0 particles.
+DEAL:2:2d/2d::Cell 2.13 has 0 particles.
+DEAL:2:2d/2d::Cell 2.14 has 0 particles.
+DEAL:2:2d/2d::Cell 2.15 has 1 particles.
+DEAL:2:2d/2d::Particle index 3 is in cell 2.15
+DEAL:2:2d/2d::Particle location: 0.900000 0.900000
+DEAL:2:2d/2d::OK
+DEAL:2:2d/3d::Locally owned active cells: 4
+DEAL:2:2d/3d::Global particles: 4
+DEAL:2:2d/3d::Cell 2.12 has 0 particles.
+DEAL:2:2d/3d::Cell 2.13 has 0 particles.
+DEAL:2:2d/3d::Cell 2.14 has 0 particles.
+DEAL:2:2d/3d::Cell 2.15 has 1 particles.
+DEAL:2:2d/3d::Particle index 3 is in cell 2.15
+DEAL:2:2d/3d::Particle location: 0.900000 0.900000 0.00000
+DEAL:2:2d/3d::OK
+DEAL:2:3d/3d::Locally owned active cells: 24
+DEAL:2:3d/3d::Global particles: 8
+DEAL:2:3d/3d::Cell 2.40 has 0 particles.
+DEAL:2:3d/3d::Cell 2.41 has 0 particles.
+DEAL:2:3d/3d::Cell 2.42 has 0 particles.
+DEAL:2:3d/3d::Cell 2.43 has 0 particles.
+DEAL:2:3d/3d::Cell 2.44 has 0 particles.
+DEAL:2:3d/3d::Cell 2.45 has 1 particles.
+DEAL:2:3d/3d::Cell 2.46 has 0 particles.
+DEAL:2:3d/3d::Cell 2.47 has 0 particles.
+DEAL:2:3d/3d::Cell 2.48 has 0 particles.
+DEAL:2:3d/3d::Cell 2.49 has 0 particles.
+DEAL:2:3d/3d::Cell 2.50 has 0 particles.
+DEAL:2:3d/3d::Cell 2.51 has 0 particles.
+DEAL:2:3d/3d::Cell 2.52 has 0 particles.
+DEAL:2:3d/3d::Cell 2.53 has 0 particles.
+DEAL:2:3d/3d::Cell 2.54 has 1 particles.
+DEAL:2:3d/3d::Cell 2.55 has 0 particles.
+DEAL:2:3d/3d::Cell 2.56 has 0 particles.
+DEAL:2:3d/3d::Cell 2.57 has 0 particles.
+DEAL:2:3d/3d::Cell 2.58 has 0 particles.
+DEAL:2:3d/3d::Cell 2.59 has 0 particles.
+DEAL:2:3d/3d::Cell 2.60 has 0 particles.
+DEAL:2:3d/3d::Cell 2.61 has 0 particles.
+DEAL:2:3d/3d::Cell 2.62 has 0 particles.
+DEAL:2:3d/3d::Cell 2.63 has 1 particles.
+DEAL:2:3d/3d::Particle index 5 is in cell 2.45
+DEAL:2:3d/3d::Particle location: 0.900000 0.100000 0.900000
+DEAL:2:3d/3d::Particle index 6 is in cell 2.54
+DEAL:2:3d/3d::Particle location: 0.100000 0.900000 0.900000
+DEAL:2:3d/3d::Particle index 7 is in cell 2.63
+DEAL:2:3d/3d::Particle location: 0.900000 0.900000 0.900000
+DEAL:2:3d/3d::OK
+
diff --git a/tests/particles/generators_08.cc b/tests/particles/generators_08.cc
new file mode 100644 (file)
index 0000000..8f03763
--- /dev/null
@@ -0,0 +1,121 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2019 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+// Insert particles within an hyper_cube triangulation using a Q1 quadrature
+// defined on a non-matching hyper_cube triangulation and then check if the
+// particles are correctly positioned
+
+
+#include <deal.II/base/function_lib.h>
+
+#include <deal.II/distributed/tria.h>
+
+#include <deal.II/dofs/dof_handler.h>
+
+#include <deal.II/fe/fe_nothing.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/mapping_q.h>
+
+#include <deal.II/grid/filtered_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_tools.h>
+
+#include <deal.II/particles/generators.h>
+#include <deal.II/particles/particle_handler.h>
+
+#include "../tests.h"
+
+template <int dim, int spacedim>
+void
+test()
+{
+  parallel::distributed::Triangulation<dim, spacedim> tr(MPI_COMM_WORLD);
+
+  GridGenerator::hyper_cube(tr);
+  tr.refine_global(2);
+
+  DoFHandler<dim, spacedim>       dof_handler(tr);
+  const FE_Nothing<dim, spacedim> fe_nothing;
+  dof_handler.distribute_dofs(fe_nothing);
+
+  const MappingQ<dim, spacedim> mapping(1);
+
+  Particles::ParticleHandler<dim, spacedim> particle_handler(tr, mapping);
+
+  parallel::distributed::Triangulation<dim, spacedim> particles_tr(
+    MPI_COMM_WORLD);
+  GridGenerator::hyper_cube(particles_tr, 0.1, 0.9);
+
+  const QGauss<dim> quadrature(2);
+
+  // Generate the necessary bounding boxes for the generator
+  const auto my_bounding_box = GridTools::compute_mesh_predicate_bounding_box(
+    tr, IteratorFilters::LocallyOwnedCell());
+  const auto global_bounding_boxes =
+    Utilities::MPI::all_gather(MPI_COMM_WORLD, my_bounding_box);
+
+  Particles::Generators::quadrature_points(particles_tr,
+                                           quadrature,
+                                           global_bounding_boxes,
+                                           particle_handler);
+
+  {
+    deallog << "Locally owned active cells: "
+            << tr.n_locally_owned_active_cells() << std::endl;
+
+    deallog << "Global particles: " << particle_handler.n_global_particles()
+            << std::endl;
+
+    for (const auto &cell : tr.active_cell_iterators())
+      {
+        if (cell->is_locally_owned())
+          {
+            deallog << "Cell " << cell << " has "
+                    << particle_handler.n_particles_in_cell(cell)
+                    << " particles." << std::endl;
+          }
+      }
+
+    for (const auto &particle : particle_handler)
+      {
+        deallog << "Particle index " << particle.get_id() << " is in cell "
+                << particle.get_surrounding_cell(tr) << std::endl;
+        deallog << "Particle location: " << particle.get_location()
+                << std::endl;
+      }
+  }
+  deallog << "OK" << std::endl;
+}
+
+
+
+int
+main(int argc, char *argv[])
+{
+  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
+
+  MPILogInitAll init;
+
+  deallog.push("2d/2d");
+  test<2, 2>();
+  deallog.pop();
+  deallog.push("2d/3d");
+  test<2, 3>();
+  deallog.pop();
+  deallog.push("3d/3d");
+  test<3, 3>();
+  deallog.pop();
+}
diff --git a/tests/particles/generators_08.with_p4est=true.mpirun=1.output b/tests/particles/generators_08.with_p4est=true.mpirun=1.output
new file mode 100644 (file)
index 0000000..d81a723
--- /dev/null
@@ -0,0 +1,138 @@
+
+DEAL:0:2d/2d::Locally owned active cells: 16
+DEAL:0:2d/2d::Global particles: 4
+DEAL:0:2d/2d::Cell 2.0 has 0 particles.
+DEAL:0:2d/2d::Cell 2.1 has 0 particles.
+DEAL:0:2d/2d::Cell 2.2 has 0 particles.
+DEAL:0:2d/2d::Cell 2.3 has 1 particles.
+DEAL:0:2d/2d::Cell 2.4 has 0 particles.
+DEAL:0:2d/2d::Cell 2.5 has 0 particles.
+DEAL:0:2d/2d::Cell 2.6 has 1 particles.
+DEAL:0:2d/2d::Cell 2.7 has 0 particles.
+DEAL:0:2d/2d::Cell 2.8 has 0 particles.
+DEAL:0:2d/2d::Cell 2.9 has 1 particles.
+DEAL:0:2d/2d::Cell 2.10 has 0 particles.
+DEAL:0:2d/2d::Cell 2.11 has 0 particles.
+DEAL:0:2d/2d::Cell 2.12 has 1 particles.
+DEAL:0:2d/2d::Cell 2.13 has 0 particles.
+DEAL:0:2d/2d::Cell 2.14 has 0 particles.
+DEAL:0:2d/2d::Cell 2.15 has 0 particles.
+DEAL:0:2d/2d::Particle index 0 is in cell 2.3
+DEAL:0:2d/2d::Particle location: 0.269060 0.269060
+DEAL:0:2d/2d::Particle index 1 is in cell 2.6
+DEAL:0:2d/2d::Particle location: 0.730940 0.269060
+DEAL:0:2d/2d::Particle index 2 is in cell 2.9
+DEAL:0:2d/2d::Particle location: 0.269060 0.730940
+DEAL:0:2d/2d::Particle index 3 is in cell 2.12
+DEAL:0:2d/2d::Particle location: 0.730940 0.730940
+DEAL:0:2d/2d::OK
+DEAL:0:2d/3d::Locally owned active cells: 16
+DEAL:0:2d/3d::Global particles: 4
+DEAL:0:2d/3d::Cell 2.0 has 0 particles.
+DEAL:0:2d/3d::Cell 2.1 has 0 particles.
+DEAL:0:2d/3d::Cell 2.2 has 0 particles.
+DEAL:0:2d/3d::Cell 2.3 has 1 particles.
+DEAL:0:2d/3d::Cell 2.4 has 0 particles.
+DEAL:0:2d/3d::Cell 2.5 has 0 particles.
+DEAL:0:2d/3d::Cell 2.6 has 1 particles.
+DEAL:0:2d/3d::Cell 2.7 has 0 particles.
+DEAL:0:2d/3d::Cell 2.8 has 0 particles.
+DEAL:0:2d/3d::Cell 2.9 has 1 particles.
+DEAL:0:2d/3d::Cell 2.10 has 0 particles.
+DEAL:0:2d/3d::Cell 2.11 has 0 particles.
+DEAL:0:2d/3d::Cell 2.12 has 1 particles.
+DEAL:0:2d/3d::Cell 2.13 has 0 particles.
+DEAL:0:2d/3d::Cell 2.14 has 0 particles.
+DEAL:0:2d/3d::Cell 2.15 has 0 particles.
+DEAL:0:2d/3d::Particle index 0 is in cell 2.3
+DEAL:0:2d/3d::Particle location: 0.269060 0.269060 0.00000
+DEAL:0:2d/3d::Particle index 1 is in cell 2.6
+DEAL:0:2d/3d::Particle location: 0.730940 0.269060 0.00000
+DEAL:0:2d/3d::Particle index 2 is in cell 2.9
+DEAL:0:2d/3d::Particle location: 0.269060 0.730940 0.00000
+DEAL:0:2d/3d::Particle index 3 is in cell 2.12
+DEAL:0:2d/3d::Particle location: 0.730940 0.730940 0.00000
+DEAL:0:2d/3d::OK
+DEAL:0:3d/3d::Locally owned active cells: 64
+DEAL:0:3d/3d::Global particles: 8
+DEAL:0:3d/3d::Cell 2.0 has 0 particles.
+DEAL:0:3d/3d::Cell 2.1 has 0 particles.
+DEAL:0:3d/3d::Cell 2.2 has 0 particles.
+DEAL:0:3d/3d::Cell 2.3 has 0 particles.
+DEAL:0:3d/3d::Cell 2.4 has 0 particles.
+DEAL:0:3d/3d::Cell 2.5 has 0 particles.
+DEAL:0:3d/3d::Cell 2.6 has 0 particles.
+DEAL:0:3d/3d::Cell 2.7 has 1 particles.
+DEAL:0:3d/3d::Cell 2.8 has 0 particles.
+DEAL:0:3d/3d::Cell 2.9 has 0 particles.
+DEAL:0:3d/3d::Cell 2.10 has 0 particles.
+DEAL:0:3d/3d::Cell 2.11 has 0 particles.
+DEAL:0:3d/3d::Cell 2.12 has 0 particles.
+DEAL:0:3d/3d::Cell 2.13 has 0 particles.
+DEAL:0:3d/3d::Cell 2.14 has 1 particles.
+DEAL:0:3d/3d::Cell 2.15 has 0 particles.
+DEAL:0:3d/3d::Cell 2.16 has 0 particles.
+DEAL:0:3d/3d::Cell 2.17 has 0 particles.
+DEAL:0:3d/3d::Cell 2.18 has 0 particles.
+DEAL:0:3d/3d::Cell 2.19 has 0 particles.
+DEAL:0:3d/3d::Cell 2.20 has 0 particles.
+DEAL:0:3d/3d::Cell 2.21 has 1 particles.
+DEAL:0:3d/3d::Cell 2.22 has 0 particles.
+DEAL:0:3d/3d::Cell 2.23 has 0 particles.
+DEAL:0:3d/3d::Cell 2.24 has 0 particles.
+DEAL:0:3d/3d::Cell 2.25 has 0 particles.
+DEAL:0:3d/3d::Cell 2.26 has 0 particles.
+DEAL:0:3d/3d::Cell 2.27 has 0 particles.
+DEAL:0:3d/3d::Cell 2.28 has 1 particles.
+DEAL:0:3d/3d::Cell 2.29 has 0 particles.
+DEAL:0:3d/3d::Cell 2.30 has 0 particles.
+DEAL:0:3d/3d::Cell 2.31 has 0 particles.
+DEAL:0:3d/3d::Cell 2.32 has 0 particles.
+DEAL:0:3d/3d::Cell 2.33 has 0 particles.
+DEAL:0:3d/3d::Cell 2.34 has 0 particles.
+DEAL:0:3d/3d::Cell 2.35 has 1 particles.
+DEAL:0:3d/3d::Cell 2.36 has 0 particles.
+DEAL:0:3d/3d::Cell 2.37 has 0 particles.
+DEAL:0:3d/3d::Cell 2.38 has 0 particles.
+DEAL:0:3d/3d::Cell 2.39 has 0 particles.
+DEAL:0:3d/3d::Cell 2.40 has 0 particles.
+DEAL:0:3d/3d::Cell 2.41 has 0 particles.
+DEAL:0:3d/3d::Cell 2.42 has 1 particles.
+DEAL:0:3d/3d::Cell 2.43 has 0 particles.
+DEAL:0:3d/3d::Cell 2.44 has 0 particles.
+DEAL:0:3d/3d::Cell 2.45 has 0 particles.
+DEAL:0:3d/3d::Cell 2.46 has 0 particles.
+DEAL:0:3d/3d::Cell 2.47 has 0 particles.
+DEAL:0:3d/3d::Cell 2.48 has 0 particles.
+DEAL:0:3d/3d::Cell 2.49 has 1 particles.
+DEAL:0:3d/3d::Cell 2.50 has 0 particles.
+DEAL:0:3d/3d::Cell 2.51 has 0 particles.
+DEAL:0:3d/3d::Cell 2.52 has 0 particles.
+DEAL:0:3d/3d::Cell 2.53 has 0 particles.
+DEAL:0:3d/3d::Cell 2.54 has 0 particles.
+DEAL:0:3d/3d::Cell 2.55 has 0 particles.
+DEAL:0:3d/3d::Cell 2.56 has 1 particles.
+DEAL:0:3d/3d::Cell 2.57 has 0 particles.
+DEAL:0:3d/3d::Cell 2.58 has 0 particles.
+DEAL:0:3d/3d::Cell 2.59 has 0 particles.
+DEAL:0:3d/3d::Cell 2.60 has 0 particles.
+DEAL:0:3d/3d::Cell 2.61 has 0 particles.
+DEAL:0:3d/3d::Cell 2.62 has 0 particles.
+DEAL:0:3d/3d::Cell 2.63 has 0 particles.
+DEAL:0:3d/3d::Particle index 0 is in cell 2.7
+DEAL:0:3d/3d::Particle location: 0.269060 0.269060 0.269060
+DEAL:0:3d/3d::Particle index 1 is in cell 2.14
+DEAL:0:3d/3d::Particle location: 0.730940 0.269060 0.269060
+DEAL:0:3d/3d::Particle index 2 is in cell 2.21
+DEAL:0:3d/3d::Particle location: 0.269060 0.730940 0.269060
+DEAL:0:3d/3d::Particle index 3 is in cell 2.28
+DEAL:0:3d/3d::Particle location: 0.730940 0.730940 0.269060
+DEAL:0:3d/3d::Particle index 4 is in cell 2.35
+DEAL:0:3d/3d::Particle location: 0.269060 0.269060 0.730940
+DEAL:0:3d/3d::Particle index 5 is in cell 2.42
+DEAL:0:3d/3d::Particle location: 0.730940 0.269060 0.730940
+DEAL:0:3d/3d::Particle index 6 is in cell 2.49
+DEAL:0:3d/3d::Particle location: 0.269060 0.730940 0.730940
+DEAL:0:3d/3d::Particle index 7 is in cell 2.56
+DEAL:0:3d/3d::Particle location: 0.730940 0.730940 0.730940
+DEAL:0:3d/3d::OK
diff --git a/tests/particles/generators_08.with_p4est=true.mpirun=3.output b/tests/particles/generators_08.with_p4est=true.mpirun=3.output
new file mode 100644 (file)
index 0000000..770b7ca
--- /dev/null
@@ -0,0 +1,160 @@
+
+DEAL:0:2d/2d::Locally owned active cells: 4
+DEAL:0:2d/2d::Global particles: 4
+DEAL:0:2d/2d::Cell 2.0 has 0 particles.
+DEAL:0:2d/2d::Cell 2.1 has 0 particles.
+DEAL:0:2d/2d::Cell 2.2 has 0 particles.
+DEAL:0:2d/2d::Cell 2.3 has 1 particles.
+DEAL:0:2d/2d::Particle index 0 is in cell 2.3
+DEAL:0:2d/2d::Particle location: 0.269060 0.269060
+DEAL:0:2d/2d::OK
+DEAL:0:2d/3d::Locally owned active cells: 4
+DEAL:0:2d/3d::Global particles: 4
+DEAL:0:2d/3d::Cell 2.0 has 0 particles.
+DEAL:0:2d/3d::Cell 2.1 has 0 particles.
+DEAL:0:2d/3d::Cell 2.2 has 0 particles.
+DEAL:0:2d/3d::Cell 2.3 has 1 particles.
+DEAL:0:2d/3d::Particle index 0 is in cell 2.3
+DEAL:0:2d/3d::Particle location: 0.269060 0.269060 0.00000
+DEAL:0:2d/3d::OK
+DEAL:0:3d/3d::Locally owned active cells: 24
+DEAL:0:3d/3d::Global particles: 8
+DEAL:0:3d/3d::Cell 2.0 has 0 particles.
+DEAL:0:3d/3d::Cell 2.1 has 0 particles.
+DEAL:0:3d/3d::Cell 2.2 has 0 particles.
+DEAL:0:3d/3d::Cell 2.3 has 0 particles.
+DEAL:0:3d/3d::Cell 2.4 has 0 particles.
+DEAL:0:3d/3d::Cell 2.5 has 0 particles.
+DEAL:0:3d/3d::Cell 2.6 has 0 particles.
+DEAL:0:3d/3d::Cell 2.7 has 1 particles.
+DEAL:0:3d/3d::Cell 2.8 has 0 particles.
+DEAL:0:3d/3d::Cell 2.9 has 0 particles.
+DEAL:0:3d/3d::Cell 2.10 has 0 particles.
+DEAL:0:3d/3d::Cell 2.11 has 0 particles.
+DEAL:0:3d/3d::Cell 2.12 has 0 particles.
+DEAL:0:3d/3d::Cell 2.13 has 0 particles.
+DEAL:0:3d/3d::Cell 2.14 has 1 particles.
+DEAL:0:3d/3d::Cell 2.15 has 0 particles.
+DEAL:0:3d/3d::Cell 2.16 has 0 particles.
+DEAL:0:3d/3d::Cell 2.17 has 0 particles.
+DEAL:0:3d/3d::Cell 2.18 has 0 particles.
+DEAL:0:3d/3d::Cell 2.19 has 0 particles.
+DEAL:0:3d/3d::Cell 2.20 has 0 particles.
+DEAL:0:3d/3d::Cell 2.21 has 1 particles.
+DEAL:0:3d/3d::Cell 2.22 has 0 particles.
+DEAL:0:3d/3d::Cell 2.23 has 0 particles.
+DEAL:0:3d/3d::Particle index 0 is in cell 2.7
+DEAL:0:3d/3d::Particle location: 0.269060 0.269060 0.269060
+DEAL:0:3d/3d::Particle index 1 is in cell 2.14
+DEAL:0:3d/3d::Particle location: 0.730940 0.269060 0.269060
+DEAL:0:3d/3d::Particle index 2 is in cell 2.21
+DEAL:0:3d/3d::Particle location: 0.269060 0.730940 0.269060
+DEAL:0:3d/3d::OK
+
+DEAL:1:2d/2d::Locally owned active cells: 8
+DEAL:1:2d/2d::Global particles: 4
+DEAL:1:2d/2d::Cell 2.4 has 0 particles.
+DEAL:1:2d/2d::Cell 2.5 has 0 particles.
+DEAL:1:2d/2d::Cell 2.6 has 1 particles.
+DEAL:1:2d/2d::Cell 2.7 has 0 particles.
+DEAL:1:2d/2d::Cell 2.8 has 0 particles.
+DEAL:1:2d/2d::Cell 2.9 has 1 particles.
+DEAL:1:2d/2d::Cell 2.10 has 0 particles.
+DEAL:1:2d/2d::Cell 2.11 has 0 particles.
+DEAL:1:2d/2d::Particle index 1 is in cell 2.6
+DEAL:1:2d/2d::Particle location: 0.730940 0.269060
+DEAL:1:2d/2d::Particle index 2 is in cell 2.9
+DEAL:1:2d/2d::Particle location: 0.269060 0.730940
+DEAL:1:2d/2d::OK
+DEAL:1:2d/3d::Locally owned active cells: 8
+DEAL:1:2d/3d::Global particles: 4
+DEAL:1:2d/3d::Cell 2.4 has 0 particles.
+DEAL:1:2d/3d::Cell 2.5 has 0 particles.
+DEAL:1:2d/3d::Cell 2.6 has 1 particles.
+DEAL:1:2d/3d::Cell 2.7 has 0 particles.
+DEAL:1:2d/3d::Cell 2.8 has 0 particles.
+DEAL:1:2d/3d::Cell 2.9 has 1 particles.
+DEAL:1:2d/3d::Cell 2.10 has 0 particles.
+DEAL:1:2d/3d::Cell 2.11 has 0 particles.
+DEAL:1:2d/3d::Particle index 1 is in cell 2.6
+DEAL:1:2d/3d::Particle location: 0.730940 0.269060 0.00000
+DEAL:1:2d/3d::Particle index 2 is in cell 2.9
+DEAL:1:2d/3d::Particle location: 0.269060 0.730940 0.00000
+DEAL:1:2d/3d::OK
+DEAL:1:3d/3d::Locally owned active cells: 16
+DEAL:1:3d/3d::Global particles: 8
+DEAL:1:3d/3d::Cell 2.24 has 0 particles.
+DEAL:1:3d/3d::Cell 2.25 has 0 particles.
+DEAL:1:3d/3d::Cell 2.26 has 0 particles.
+DEAL:1:3d/3d::Cell 2.27 has 0 particles.
+DEAL:1:3d/3d::Cell 2.28 has 1 particles.
+DEAL:1:3d/3d::Cell 2.29 has 0 particles.
+DEAL:1:3d/3d::Cell 2.30 has 0 particles.
+DEAL:1:3d/3d::Cell 2.31 has 0 particles.
+DEAL:1:3d/3d::Cell 2.32 has 0 particles.
+DEAL:1:3d/3d::Cell 2.33 has 0 particles.
+DEAL:1:3d/3d::Cell 2.34 has 0 particles.
+DEAL:1:3d/3d::Cell 2.35 has 1 particles.
+DEAL:1:3d/3d::Cell 2.36 has 0 particles.
+DEAL:1:3d/3d::Cell 2.37 has 0 particles.
+DEAL:1:3d/3d::Cell 2.38 has 0 particles.
+DEAL:1:3d/3d::Cell 2.39 has 0 particles.
+DEAL:1:3d/3d::Particle index 3 is in cell 2.28
+DEAL:1:3d/3d::Particle location: 0.730940 0.730940 0.269060
+DEAL:1:3d/3d::Particle index 4 is in cell 2.35
+DEAL:1:3d/3d::Particle location: 0.269060 0.269060 0.730940
+DEAL:1:3d/3d::OK
+
+
+DEAL:2:2d/2d::Locally owned active cells: 4
+DEAL:2:2d/2d::Global particles: 4
+DEAL:2:2d/2d::Cell 2.12 has 1 particles.
+DEAL:2:2d/2d::Cell 2.13 has 0 particles.
+DEAL:2:2d/2d::Cell 2.14 has 0 particles.
+DEAL:2:2d/2d::Cell 2.15 has 0 particles.
+DEAL:2:2d/2d::Particle index 3 is in cell 2.12
+DEAL:2:2d/2d::Particle location: 0.730940 0.730940
+DEAL:2:2d/2d::OK
+DEAL:2:2d/3d::Locally owned active cells: 4
+DEAL:2:2d/3d::Global particles: 4
+DEAL:2:2d/3d::Cell 2.12 has 1 particles.
+DEAL:2:2d/3d::Cell 2.13 has 0 particles.
+DEAL:2:2d/3d::Cell 2.14 has 0 particles.
+DEAL:2:2d/3d::Cell 2.15 has 0 particles.
+DEAL:2:2d/3d::Particle index 3 is in cell 2.12
+DEAL:2:2d/3d::Particle location: 0.730940 0.730940 0.00000
+DEAL:2:2d/3d::OK
+DEAL:2:3d/3d::Locally owned active cells: 24
+DEAL:2:3d/3d::Global particles: 8
+DEAL:2:3d/3d::Cell 2.40 has 0 particles.
+DEAL:2:3d/3d::Cell 2.41 has 0 particles.
+DEAL:2:3d/3d::Cell 2.42 has 1 particles.
+DEAL:2:3d/3d::Cell 2.43 has 0 particles.
+DEAL:2:3d/3d::Cell 2.44 has 0 particles.
+DEAL:2:3d/3d::Cell 2.45 has 0 particles.
+DEAL:2:3d/3d::Cell 2.46 has 0 particles.
+DEAL:2:3d/3d::Cell 2.47 has 0 particles.
+DEAL:2:3d/3d::Cell 2.48 has 0 particles.
+DEAL:2:3d/3d::Cell 2.49 has 1 particles.
+DEAL:2:3d/3d::Cell 2.50 has 0 particles.
+DEAL:2:3d/3d::Cell 2.51 has 0 particles.
+DEAL:2:3d/3d::Cell 2.52 has 0 particles.
+DEAL:2:3d/3d::Cell 2.53 has 0 particles.
+DEAL:2:3d/3d::Cell 2.54 has 0 particles.
+DEAL:2:3d/3d::Cell 2.55 has 0 particles.
+DEAL:2:3d/3d::Cell 2.56 has 1 particles.
+DEAL:2:3d/3d::Cell 2.57 has 0 particles.
+DEAL:2:3d/3d::Cell 2.58 has 0 particles.
+DEAL:2:3d/3d::Cell 2.59 has 0 particles.
+DEAL:2:3d/3d::Cell 2.60 has 0 particles.
+DEAL:2:3d/3d::Cell 2.61 has 0 particles.
+DEAL:2:3d/3d::Cell 2.62 has 0 particles.
+DEAL:2:3d/3d::Cell 2.63 has 0 particles.
+DEAL:2:3d/3d::Particle index 5 is in cell 2.42
+DEAL:2:3d/3d::Particle location: 0.730940 0.269060 0.730940
+DEAL:2:3d/3d::Particle index 6 is in cell 2.49
+DEAL:2:3d/3d::Particle location: 0.269060 0.730940 0.730940
+DEAL:2:3d/3d::Particle index 7 is in cell 2.56
+DEAL:2:3d/3d::Particle location: 0.730940 0.730940 0.730940
+DEAL:2:3d/3d::OK
+

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.