#include <deal.II/numerics/rtree.h>
-#include <boost/archive/binary_iarchive.hpp>
-#include <boost/archive/binary_oarchive.hpp>
-#include <boost/optional.hpp>
-#include <boost/serialization/array.hpp>
-#include <boost/serialization/vector.hpp>
-#include <boost/signals2.hpp>
-
#include <algorithm>
#include <utility>
// Testing in serial against the serial version
auto cell_qpoint_map = GridTools::compute_point_locations(cache, points);
- auto & serial_cells = std::get<0>(cell_qpoint_map);
- auto & serial_qpoints = std::get<1>(cell_qpoint_map);
+ const auto &serial_cells = std::get<0>(cell_qpoint_map);
+ const auto &serial_qpoints = std::get<1>(cell_qpoint_map);
+ const auto &serial_map = std::get<2>(cell_qpoint_map);
std::size_t n_cells = std::get<0>(output_tuple).size();
deallog << "Points found in " << n_cells << " cells" << std::endl;
// the serial one
for (unsigned int c = 0; c < n_cells; ++c)
{
- auto &cell = std::get<0>(output_tuple)[c];
- auto &quad = std::get<1>(output_tuple)[c];
- auto &local_map = std::get<2>(output_tuple)[c];
- auto &original_points = std::get<3>(output_tuple)[c];
- auto &ranks = std::get<4>(output_tuple)[c];
-
- auto pos_cell = std::find(serial_cells.begin(), serial_cells.end(), cell);
+ const auto &cell = std::get<0>(output_tuple)[c];
+ const auto &quad = std::get<1>(output_tuple)[c];
+ const auto &local_map = std::get<2>(output_tuple)[c];
+ const auto &original_points = std::get<3>(output_tuple)[c];
+ const auto &ranks = std::get<4>(output_tuple)[c];
+
+ const auto pos_cell =
+ std::find(serial_cells.begin(), serial_cells.end(), cell);
for (auto r : ranks)
if (r != 0)
deallog << "ERROR: rank is not 0 but " << std::to_string(r)
deallog << "ERROR: in the number of points for cell"
<< std::to_string(serial_cell_idx) << std::endl;
- unsigned int pt_num = 0;
+ unsigned int pt_num = 0;
+ const auto serial_local_map = serial_map[serial_cell_idx];
for (const auto &p_idx : local_map)
{
- auto serial_pt_pos =
- std::find(local_map.begin(), local_map.end(), p_idx);
- auto serial_pt_idx = serial_pt_pos - local_map.begin();
- if (serial_pt_pos == local_map.end())
+ auto serial_pt_pos = std::find(serial_local_map.begin(),
+ serial_local_map.end(),
+ p_idx);
+ auto serial_pt_idx = serial_pt_pos - serial_local_map.begin();
+ if (serial_pt_pos == serial_local_map.end())
deallog << "ERROR: point index not found for "
<< std::to_string(serial_pt_idx) << std::endl;
else
// Store the point only if it is inside a locally owned sphere cell
if (cell->subdomain_id() == my_rank)
loc_owned_points.emplace_back(center_pt);
- try
+ // Find the cube cell where center pt lies
+ auto my_pair = GridTools::find_active_cell_around_point(cache, center_pt);
+ // If it is inside a locally owned cell it shall be returned
+ // from distributed compute point locations
+ if (my_pair.first.state() == IteratorState::valid &&
+ my_pair.first->is_locally_owned())
{
- // Find the cube cell where center pt lies
- auto my_pair =
- GridTools::find_active_cell_around_point(cache, center_pt);
- // If it is inside a locally owned cell it shall be returned
- // from distributed compute point locations
- if (my_pair.first->is_locally_owned())
- {
- computed_pts++;
- auto cells_it = std::find(computed_cells.begin(),
- computed_cells.end(),
- my_pair.first);
+ computed_pts++;
+ auto cells_it = std::find(computed_cells.begin(),
+ computed_cells.end(),
+ my_pair.first);
- if (cells_it == computed_cells.end())
- {
- // Cell not found: adding a new cell
- computed_cells.emplace_back(my_pair.first);
- computed_qpoints.emplace_back(1, my_pair.second);
- computed_points.emplace_back(1, center_pt);
- computed_ranks.emplace_back(1, cell->subdomain_id());
- }
- else
- {
- // Cell found: just adding the point index and qpoint to the
- // list
- unsigned int current_cell = cells_it - computed_cells.begin();
- computed_qpoints[current_cell].emplace_back(my_pair.second);
- computed_points[current_cell].emplace_back(center_pt);
- computed_ranks[current_cell].emplace_back(
- cell->subdomain_id());
- }
+ if (cells_it == computed_cells.end())
+ {
+ // Cell not found: adding a new cell
+ computed_cells.emplace_back(my_pair.first);
+ computed_qpoints.emplace_back(1, my_pair.second);
+ computed_points.emplace_back(1, center_pt);
+ computed_ranks.emplace_back(1, cell->subdomain_id());
+ }
+ else
+ {
+ // Cell found: just adding the point index and qpoint to the
+ // list
+ unsigned int current_cell = cells_it - computed_cells.begin();
+ computed_qpoints[current_cell].emplace_back(my_pair.second);
+ computed_points[current_cell].emplace_back(center_pt);
+ computed_ranks[current_cell].emplace_back(cell->subdomain_id());
}
}
- catch (const GridTools::ExcPointNotFound<dim> &)
- {}
}
// Computing bounding boxes describing the locally owned part of the mesh
-
-DEAL:1::found on one processor
-
+DEAL:0::found on one processor
\ No newline at end of file
DEAL:2d/2d:: at location 0.850000 0.850000
DEAL:2d/2d:: at reference location 0.400000 0.400000
DEAL:2d/2d::OK
-DEAL:2d/3d::Particle number: 10
-DEAL:2d/3d::Particle id 2 is in cell 2.0
-DEAL:2d/3d:: at location 0.250000 0.250000 0.250000
-DEAL:2d/3d:: at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 1 is in cell 2.0
-DEAL:2d/3d:: at location 0.150000 0.150000 0.150000
-DEAL:2d/3d:: at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 0 is in cell 2.0
-DEAL:2d/3d:: at location 0.0500000 0.0500000 0.0500000
-DEAL:2d/3d:: at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 4 is in cell 2.3
-DEAL:2d/3d:: at location 0.450000 0.450000 0.450000
-DEAL:2d/3d:: at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 3 is in cell 2.3
-DEAL:2d/3d:: at location 0.350000 0.350000 0.350000
-DEAL:2d/3d:: at reference location 0.400000 0.400000
-DEAL:2d/3d::Particle id 7 is in cell 2.12
-DEAL:2d/3d:: at location 0.750000 0.750000 0.750000
-DEAL:2d/3d:: at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 6 is in cell 2.12
-DEAL:2d/3d:: at location 0.650000 0.650000 0.650000
-DEAL:2d/3d:: at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 5 is in cell 2.12
-DEAL:2d/3d:: at location 0.550000 0.550000 0.550000
-DEAL:2d/3d:: at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 9 is in cell 2.15
-DEAL:2d/3d:: at location 0.950000 0.950000 0.950000
-DEAL:2d/3d:: at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 8 is in cell 2.15
-DEAL:2d/3d:: at location 0.850000 0.850000 0.850000
-DEAL:2d/3d:: at reference location 0.400000 0.400000
+DEAL:2d/3d::Particle number: 0
DEAL:2d/3d::OK
DEAL:3d/3d::Particle number: 10
DEAL:3d/3d::Particle id 2 is in cell 2.0
DEAL:2d/2d:: at location 0.850000 0.850000
DEAL:2d/2d:: at reference location 0.400000 0.400000
DEAL:2d/2d::OK
-DEAL:2d/3d::Particle number: 10
-DEAL:2d/3d::Particle id 2 is in cell 2.0
-DEAL:2d/3d:: at location 0.250000 0.250000 0.250000
-DEAL:2d/3d:: at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 1 is in cell 2.0
-DEAL:2d/3d:: at location 0.150000 0.150000 0.150000
-DEAL:2d/3d:: at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 0 is in cell 2.0
-DEAL:2d/3d:: at location 0.0500000 0.0500000 0.0500000
-DEAL:2d/3d:: at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 4 is in cell 2.3
-DEAL:2d/3d:: at location 0.450000 0.450000 0.450000
-DEAL:2d/3d:: at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 3 is in cell 2.3
-DEAL:2d/3d:: at location 0.350000 0.350000 0.350000
-DEAL:2d/3d:: at reference location 0.400000 0.400000
-DEAL:2d/3d::Particle id 7 is in cell 2.12
-DEAL:2d/3d:: at location 0.750000 0.750000 0.750000
-DEAL:2d/3d:: at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 6 is in cell 2.12
-DEAL:2d/3d:: at location 0.650000 0.650000 0.650000
-DEAL:2d/3d:: at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 5 is in cell 2.12
-DEAL:2d/3d:: at location 0.550000 0.550000 0.550000
-DEAL:2d/3d:: at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 9 is in cell 2.15
-DEAL:2d/3d:: at location 0.950000 0.950000 0.950000
-DEAL:2d/3d:: at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 8 is in cell 2.15
-DEAL:2d/3d:: at location 0.850000 0.850000 0.850000
-DEAL:2d/3d:: at reference location 0.400000 0.400000
+DEAL:2d/3d::Particle number: 0
DEAL:2d/3d::OK
DEAL:3d/3d::Particle number: 10
DEAL:3d/3d::Particle id 2 is in cell 2.0