33 template <
int dim,
int spacedim>
39 if (particles.size() == 0)
42 buffer.resize(particles.size() *
43 particles.front()->serialized_size_in_bytes());
46 for (
const auto &
particle : particles)
57 template <
int dim,
int spacedim>
62 , global_number_of_particles(0)
63 , number_of_locally_owned_particles(0)
64 , global_max_particles_per_cell(0)
65 , next_free_particle_index(0)
69 , handle(
numbers::invalid_unsigned_int)
77 template <
int dim,
int spacedim>
81 const unsigned int n_properties)
84 , property_pool(
std::make_unique<
PropertyPool<dim, spacedim>>(n_properties))
85 , cells_to_particle_cache(
triangulation.n_active_cells(), particles.end())
86 , global_number_of_particles(0)
87 , number_of_locally_owned_particles(0)
88 , global_max_particles_per_cell(0)
89 , next_free_particle_index(0)
93 , handle(
numbers::invalid_unsigned_int)
94 , triangulation_cache(
105 template <
int dim,
int spacedim>
110 for (
const auto &connection : tria_listeners)
111 connection.disconnect();
116 template <
int dim,
int spacedim>
121 const unsigned int n_properties)
128 reset_particle_container(particles);
131 property_pool = std::make_unique<PropertyPool<dim, spacedim>>(n_properties);
135 triangulation_cache =
139 cells_to_particle_cache.resize(
triangulation->n_active_cells(),
142 connect_to_triangulation_signals();
147 template <
int dim,
int spacedim>
152 const unsigned int n_properties =
158 property_pool = std::make_unique<PropertyPool<dim, spacedim>>(
163 number_of_locally_owned_particles =
166 global_max_particles_per_cell =
172 particles.insert(particle_container_owned_end(),
175 particles.insert(particle_container_ghost_end(),
181 cells_to_particle_cache[
it->cell->active_cell_index()] =
it;
183 ghost_particles_cache.ghost_particles_by_domain =
190 template <
int dim,
int spacedim>
195 global_number_of_particles = 0;
196 number_of_locally_owned_particles = 0;
197 next_free_particle_index = 0;
198 global_max_particles_per_cell = 0;
203 template <
int dim,
int spacedim>
207 for (
auto &particles_in_cell : particles)
208 for (
auto &
particle : particles_in_cell.particles)
210 property_pool->deregister_particle(
particle);
212 cells_to_particle_cache.clear();
213 reset_particle_container(particles);
215 cells_to_particle_cache.resize(
triangulation->n_active_cells(),
220 property_pool->clear();
225 template <
int dim,
int spacedim>
234 template <
int dim,
int spacedim>
248 for (
unsigned int i = 0; i < 3; ++i)
254 const_cast<typename particle_container::iterator &
>(owned_particles_end) =
260 template <
int dim,
int spacedim>
267 auto previous = particle_container_owned_begin();
268 for (
auto next =
previous; next != particle_container_owned_end(); ++next)
298 for (
const auto &cell :
triangulation->active_cell_iterators())
299 if (!cell->is_artificial())
300 if (cells_to_particle_cache[cell->active_cell_index()] !=
308 cell->is_locally_owned() ? particle_container_owned_end() :
310 typename particle_container::iterator
new_entry =
315 std::move(cells_to_particle_cache[cell->active_cell_index()]
321 cells_to_particle_cache.clear();
322 cells_to_particle_cache.resize(
triangulation->n_active_cells(),
326 cells_to_particle_cache[
it->cell->active_cell_index()] =
it;
332 particles.front().particles.empty() &&
334 particles.back().particles.empty() &&
336 owned_particles_end->particles.empty(),
342 for (
const auto &
it : cells_to_particle_cache)
344 it != --(particles.end()),
349 for (
auto it = particle_container_owned_begin();
350 it != particle_container_owned_end();
355 std::vector<typename particle_container::iterator>
verify_cache(
367 number_of_locally_owned_particles = 0;
370 for (
const auto &particles_in_cell : particles)
373 particles_in_cell.particles.size();
379 if (n_particles_in_cell > 0 &&
380 particles_in_cell.cell->is_locally_owned())
381 number_of_locally_owned_particles += n_particles_in_cell;
384 for (
const auto &
particle : particles_in_cell.particles)
388 global_number_of_particles =
392 if (global_number_of_particles == 0)
394 next_free_particle_index = 0;
395 global_max_particles_per_cell = 0;
401 next_free_particle_index =
result[1] + 1;
402 global_max_particles_per_cell =
result[0];
408 template <
int dim,
int spacedim>
414 if (cells_to_particle_cache.size() == 0)
417 if (cell->is_artificial() ==
false)
419 return cells_to_particle_cache[cell->active_cell_index()] !=
421 cells_to_particle_cache[cell->active_cell_index()]
427 ExcMessage(
"You can't ask for the particles on an artificial "
428 "cell since we don't know what exists on these "
436 template <
int dim,
int spacedim>
443 ->particles_in_cell(cell);
448 template <
int dim,
int spacedim>
453 const unsigned int active_cell_index = cell->active_cell_index();
455 if (cell->is_artificial() ==
false)
457 if (cells_to_particle_cache[active_cell_index] == particles.end())
459 return boost::make_iterator_range(
465 const typename particle_container::iterator
467 cells_to_particle_cache[active_cell_index];
471 return boost::make_iterator_range(
478 ExcMessage(
"You can't ask for the particles on an artificial "
479 "cell since we don't know what exists on these "
487 template <
int dim,
int spacedim>
497 auto handle =
particle->get_handle();
499 property_pool->deregister_particle(handle);
504 const auto cell =
particle->get_surrounding_cell();
505 const bool owned_cell = cell->is_locally_owned();
507 --number_of_locally_owned_particles;
517 particles.erase(
particle->particles_in_cell);
518 cells_to_particle_cache[cell->active_cell_index()] = particles.
end();
524 template <
int dim,
int spacedim>
536 return a->particles_in_cell->cell > b->particles_in_cell->cell ||
537 (a->particles_in_cell->cell == b->particles_in_cell->cell &&
538 a->particle_index_within_cell > b->particle_index_within_cell);
558 remove_particle(*
it);
562 std::vector<ParticleHandler<dim, spacedim>::particle_iterator>
572 update_cached_numbers();
577 template <
int dim,
int spacedim>
583 return insert_particle(
particle.get_location(),
592 template <
int dim,
int spacedim>
598 const unsigned int active_cell_index = cell->active_cell_index();
599 typename particle_container::iterator &cache =
600 cells_to_particle_cache[active_cell_index];
601 if (cache == particles.end())
604 cell->is_locally_owned() ? particle_container_owned_end() :
605 particle_container_ghost_end();
606 cache = particles.emplace(
613 cache->particles.push_back(handle);
618 cache->particles.size() - 1);
623 template <
int dim,
int spacedim>
632 Assert(cell->is_locally_owned(),
633 ExcMessage(
"You tried to insert particles into a cell that is not "
634 "locally owned. This is not supported."));
637 insert_particle(property_pool->register_particle(), cell);
639 data =
particle_it->read_particle_data_from_memory(data);
641 ++number_of_locally_owned_particles;
648 template <
int dim,
int spacedim>
661 Assert(cell->is_locally_owned(),
662 ExcMessage(
"You tried to insert particles into a cell that is not "
663 "locally owned. This is not supported."));
666 insert_particle(property_pool->register_particle(), cell);
672 if (properties.
size() != 0)
675 ++number_of_locally_owned_particles;
682 template <
int dim,
int spacedim>
693 update_cached_numbers();
698 template <
int dim,
int spacedim>
705 update_cached_numbers();
713 get_next_free_particle_index();
716#ifdef DEAL_II_WITH_MPI
750 for (
unsigned int i = 0; i < cells.size(); ++i)
752 insert_particle(
positions[index_map[i][p]],
757 update_cached_numbers();
762 template <
int dim,
int spacedim>
763 std::map<unsigned int, IndexSet>
768 const std::vector<std::vector<double>> & properties,
769 const std::vector<types::particle_index> &ids)
771 if (!properties.empty())
775 for (
const auto &p : properties)
833 std::map<unsigned int, std::vector<unsigned int>>
835 for (
unsigned int i_cell = 0;
872 std::map<unsigned int, std::vector<std::vector<double>>>
880 std::map<unsigned int, std::vector<types::particle_index>>
893 std::map<unsigned int, std::vector<std::vector<double>>>
900 std::vector<double>(n_properties_per_particle()));
901 unsigned int index = 0;
902 for (
const auto el :
it.second)
920 std::map<unsigned int, std::vector<types::particle_index>>
926 unsigned int index = 0;
927 for (
const auto el :
it.second)
943 for (
unsigned int i_cell = 0;
957 const unsigned int index_within_set =
983 update_cached_numbers();
990 template <
int dim,
int spacedim>
991 std::map<unsigned int, IndexSet>
1000 std::vector<std::vector<double>> properties;
1001 std::vector<types::particle_index> ids;
1003 ids.resize(particles.size());
1004 if (n_properties_per_particle() > 0)
1005 properties.resize(particles.size(),
1006 std::vector<double>(n_properties_per_particle()));
1009 for (
const auto &p : particles)
1012 ids[i] = p.get_id();
1013 if (p.has_properties())
1014 properties[i] = {p.get_properties().
begin(),
1015 p.get_properties().end()};
1019 return insert_global_particles(
positions,
1027 template <
int dim,
int spacedim>
1031 return global_number_of_particles;
1036 template <
int dim,
int spacedim>
1040 return global_max_particles_per_cell;
1045 template <
int dim,
int spacedim>
1049 return number_of_locally_owned_particles;
1054 template <
int dim,
int spacedim>
1058 return property_pool->n_properties_per_slot();
1063 template <
int dim,
int spacedim>
1067 return next_free_particle_index;
1072 template <
int dim,
int spacedim>
1076 IndexSet set(get_next_free_particle_index());
1077 std::vector<types::particle_index> indices;
1078 indices.reserve(n_locally_owned_particles());
1079 for (
const auto &p : *
this)
1080 indices.push_back(p.get_id());
1081 set.add_indices(indices.begin(), indices.end());
1088 template <
int dim,
int spacedim>
1092 return property_pool->n_slots();
1097 template <
int dim,
int spacedim>
1107 for (
auto it = begin();
it != end(); ++
it, ++i)
1118 template <
int dim,
int spacedim>
1128 for (
auto it = begin();
it != end(); ++
it, ++i)
1135 sort_particles_into_subdomains_and_cells();
1140 template <
int dim,
int spacedim>
1156 for (
unsigned int d = 0; d < spacedim; ++d)
1159 for (
unsigned int d = 0; d < spacedim; ++d)
1163 sort_particles_into_subdomains_and_cells();
1168 template <
int dim,
int spacedim>
1172 return *property_pool;
1191 const unsigned int a,
1192 const unsigned int b,
1208 template <
int dim,
int spacedim>
1233 std::vector<Point<dim>> reference_locations;
1235 reference_locations.reserve(global_max_particles_per_cell);
1237 for (
const auto &cell :
triangulation->active_cell_iterators())
1244 if (cell->is_locally_owned() ==
false)
1249 const unsigned int n_pic = n_particles_in_cell(cell);
1250 auto pic = particles_in_cell(cell);
1256 reference_locations.resize(
n_pic);
1257 mapping->transform_points_real_to_unit_cell(cell,
1259 reference_locations);
1262 for (
const auto &
p_unit : reference_locations)
1280 std::map<types::subdomain_id, std::vector<particle_iterator>>
1284 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>>
1292 using vector_size =
typename std::vector<particle_iterator>::size_type;
1294 std::set<types::subdomain_id> ghost_owners;
1311 std::set<typename Triangulation<dim, spacedim>::active_cell_iterator>>
1312 &vertex_to_cells = triangulation_cache->get_vertex_to_cell_map();
1316 const std::vector<std::vector<Tensor<1, spacedim>>>
1317 &vertex_to_cell_centers =
1318 triangulation_cache->get_vertex_to_cell_centers_directions();
1347 GridTools::find_closest_vertex_of_cell<dim, spacedim>(
1367 const unsigned int b) {
1368 return compare_particle_association(a,
1378 typename std::set<typename Triangulation<dim, spacedim>
::
1383 mapping->transform_points_real_to_unit_cell(*cell,
1385 reference_locations);
1388 reference_locations[0]))
1403#if defined(DEAL_II_WITH_BOOST_BUNDLED) || \
1404 !(defined(__clang_major__) && __clang_major__ >= 16) || \
1405 BOOST_VERSION >= 108100
1409 std::vector<std::pair<Point<spacedim>,
unsigned int>>
1411 triangulation_cache->get_used_vertices_rtree().query(
1412 boost::geometry::index::nearest(
out_particle->get_location(),
1429 for (
const auto &cell :
1432 mapping->transform_points_real_to_unit_cell(
1436 reference_locations[0]))
1457 out_particle->set_reference_location(reference_locations[0]);
1484#ifdef DEAL_II_WITH_MPI
1499 std::vector<typename PropertyPool<dim, spacedim>::Handle>
unsorted_handles;
1503 for (
auto &particles_in_cell : particles)
1504 for (
auto &
particle : particles_in_cell.particles)
1516 template <
int dim,
int spacedim>
1534#ifndef DEAL_II_WITH_MPI
1538 for (
const auto &cell :
triangulation->active_cell_iterators())
1539 if (cell->is_ghost() &&
1540 cells_to_particle_cache[cell->active_cell_index()] != particles.end())
1542 Assert(cells_to_particle_cache[cell->active_cell_index()]->cell ==
1547 cells_to_particle_cache[cell->active_cell_index()]->particles)
1551 particles.erase(cells_to_particle_cache[cell->active_cell_index()]);
1552 cells_to_particle_cache[cell->active_cell_index()] = particles.end();
1556 ghost_particles_cache.ghost_particles_by_domain.clear();
1557 ghost_particles_cache.valid =
false;
1564 const std::map<unsigned int, std::set<types::subdomain_id>>
1566 triangulation_cache->get_vertices_with_ghost_neighbors();
1568 const std::set<types::subdomain_id> ghost_owners =
1571 ghost_particles_cache.ghost_particles_by_domain[
ghost_owner].reserve(
1572 n_locally_owned_particles() / 4);
1574 const std::vector<std::set<unsigned int>> vertex_to_neighbor_subdomain =
1575 triangulation_cache->get_vertex_to_neighbor_subdomain();
1577 for (
const auto &cell :
triangulation->active_cell_iterators())
1579 if (cell->is_locally_owned())
1582 for (
const unsigned int v : cell->vertex_indices())
1598 particles_in_cell(cell);
1602 for (
typename particle_iterator_range::iterator
particle =
1606 ghost_particles_cache.ghost_particles_by_domain[
domain]
1613 send_recv_particles(
1614 ghost_particles_cache.ghost_particles_by_domain,
1625 template <
int dim,
int spacedim>
1641#ifdef DEAL_II_WITH_MPI
1644 Assert(ghost_particles_cache.valid,
1646 "Ghost particles cannot be updated if they first have not been "
1647 "exchanged at least once with the cache enabled"));
1650 send_recv_particles_properties_and_location(
1651 ghost_particles_cache.ghost_particles_by_domain);
1657#ifdef DEAL_II_WITH_MPI
1658 template <
int dim,
int spacedim>
1679 ExcMessage(
"This function is only implemented for "
1680 "parallel::TriangulationBase objects."));
1683 const std::set<types::subdomain_id> ghost_owners =
1685 const std::vector<types::subdomain_id> neighbors(ghost_owners.begin(),
1686 ghost_owners.end());
1718 std::vector<char> send_data;
1725 (size_callback ? size_callback() : 0);
1739 void *data =
static_cast<void *
>(&send_data.front());
1744 send_offsets[i] =
reinterpret_cast<std::size_t
>(data) -
1745 reinterpret_cast<std::size_t
>(&send_data.front());
1752 static_cast<std::size_t
>(
1755 ExcMessage(
"Overflow when trying to send particle "
1766 ->get_surrounding_cell();
1776 ->write_particle_data_to_memory(data);
1835 std::vector<MPI_Request> requests(2 *
n_neighbors);
1878 const void *
recv_data_it =
static_cast<const void *
>(recv_data.data());
1881 auto &ghost_particles_iterators =
1882 ghost_particles_cache.ghost_particles_iterators;
1886 ghost_particles_iterators.clear();
1904 ghost_particles_cache.neighbors = neighbors;
1906 ghost_particles_cache.send_data.resize(
1907 ghost_particles_cache.send_pointers.back());
1908 ghost_particles_cache.recv_data.resize(
1909 ghost_particles_cache.recv_pointers.back());
1913 reinterpret_cast<std::size_t
>(recv_data.data()) <
1924 insert_particle(property_pool->register_particle(), cell);
1925 const typename particle_container::iterator &cache =
1926 cells_to_particle_cache[cell->active_cell_index()];
1931 cache->particles.size() - 1);
1945 "The amount of data that was read into new particles "
1946 "does not match the amount of data sent around."));
1952#ifdef DEAL_II_WITH_MPI
1953 template <
int dim,
int spacedim>
1965 "This function is only implemented for parallel::TriangulationBase "
1968 const auto &neighbors = ghost_particles_cache.neighbors;
1969 const auto &send_pointers = ghost_particles_cache.send_pointers;
1970 const auto &recv_pointers = ghost_particles_cache.recv_pointers;
1972 std::vector<char> &send_data = ghost_particles_cache.send_data;
1975 if (send_pointers.back() > 0)
1977 void *data =
static_cast<void *
>(&send_data.front());
1980 for (
const auto i : neighbors)
1983 data = p->write_particle_data_to_memory(data);
1985 data = store_callback(p, data);
1989 std::vector<char> &recv_data = ghost_particles_cache.recv_data;
1993 std::vector<MPI_Request> requests(2 * neighbors.size());
2000 for (
unsigned int i = 0; i < neighbors.size(); ++i)
2001 if ((recv_pointers[i + 1] - recv_pointers[i]) > 0)
2004 MPI_Irecv(recv_data.data() + recv_pointers[i],
2005 recv_pointers[i + 1] - recv_pointers[i],
2015 for (
unsigned int i = 0; i < neighbors.size(); ++i)
2016 if ((send_pointers[i + 1] - send_pointers[i]) > 0)
2019 MPI_Isend(send_data.data() + send_pointers[i],
2020 send_pointers[i + 1] - send_pointers[i],
2036 const void *
recv_data_it =
static_cast<const void *
>(recv_data.data());
2039 auto &ghost_particles_iterators =
2040 ghost_particles_cache.ghost_particles_iterators;
2062 "The amount of data that was read into new particles "
2063 "does not match the amount of data sent around."));
2067 template <
int dim,
int spacedim>
2070 const std::function<std::size_t()> &
size_callb,
2081 template <
int dim,
int spacedim>
2086 for (
const auto &connection : tria_listeners)
2087 connection.disconnect();
2089 tria_listeners.clear();
2091 tria_listeners.push_back(
triangulation->signals.create.connect([&]() {
2092 this->initialize(*(this->triangulation),
2094 this->property_pool->n_properties_per_slot());
2097 this->tria_listeners.push_back(
2098 this->
triangulation->signals.clear.connect([&]() { this->clear(); }));
2104 tria_listeners.push_back(
2106 [&]() { this->post_mesh_change_action(); }));
2107 tria_listeners.push_back(
2108 triangulation->signals.post_distributed_repartition.connect(
2109 [&]() { this->post_mesh_change_action(); }));
2110 tria_listeners.push_back(
2112 [&]() { this->post_mesh_change_action(); }));
2116 tria_listeners.push_back(
triangulation->signals.post_refinement.connect(
2117 [&]() { this->post_mesh_change_action(); }));
2123 template <
int dim,
int spacedim>
2132 &(*triangulation)) !=
nullptr;
2138 "Mesh refinement in a non-distributed triangulation is not supported "
2139 "by the ParticleHandler class. Either insert particles after mesh "
2140 "creation, or use a distributed triangulation."));
2144 if (number_of_locally_owned_particles == 0)
2145 cells_to_particle_cache.resize(
triangulation->n_active_cells(),
2151 template <
int dim,
int spacedim>
2155 register_data_attach();
2160 template <
int dim,
int spacedim>
2164 register_data_attach();
2169 template <
int dim,
int spacedim>
2173 register_data_attach();
2178 template <
int dim,
int spacedim>
2186 *
>(&(*triangulation)));
2192 "Mesh refinement in a non-distributed triangulation is not supported "
2193 "by the ParticleHandler class. Either insert particles after mesh "
2194 "creation and do not refine afterwards, or use a distributed triangulation."));
2196#ifdef DEAL_II_WITH_P4EST
2202 return this->pack_callback(cell_iterator,
cell_status);
2212 template <
int dim,
int spacedim>
2222 template <
int dim,
int spacedim>
2231 template <
int dim,
int spacedim>
2241 template <
int dim,
int spacedim>
2250 *
>(&(*triangulation)));
2256 "Mesh refinement in a non-distributed triangulation is not supported "
2257 "by the ParticleHandler class. Either insert particles after mesh "
2258 "creation and do not refine afterwards, or use a distributed triangulation."));
2263#ifdef DEAL_II_WITH_P4EST
2269 register_data_attach();
2279 const boost::iterator_range<std::vector<char>::const_iterator>
2289 update_cached_numbers();
2298 template <
int dim,
int spacedim>
2313 const unsigned int n_particles = n_particles_in_cell(cell);
2318 cells_to_particle_cache[cell->active_cell_index()],
2328 for (
const auto &child : cell->child_iterators())
2330 const unsigned int n_particles = n_particles_in_cell(child);
2335 const typename particle_container::iterator &cache =
2336 cells_to_particle_cache[child->active_cell_index()];
2354 template <
int dim,
int spacedim>
2359 const boost::iterator_range<std::vector<char>::const_iterator> &
data_range)
2373 const void *end =
static_cast<const void *
>(
2381 "The particle data could not be deserialized successfully. "
2382 "Check that when deserializing the particles you expect "
2383 "the same number of properties that were serialized."));
2415 typename particle_container::iterator &cache =
2417 ->active_cell_index()];
2425 for (
unsigned int i = 0; i < cache->particles.size();)
2429 for (
unsigned int child_index = 0;
2434 child = cell->child(child_index);
2440 mapping->transform_real_to_unit_cell(
2451 if (child_index != 0)
2453 insert_particle(cache->particles[i], child);
2455 cache->particles[i] = cache->particles.back();
2456 cache->particles.resize(
2457 cache->particles.size() - 1);
2482 cache->particles[i] = cache->particles.back();
2483 cache->particles.resize(cache->particles.size() - 1);
2487 if (cache->particles.empty())
2489 particles.erase(cache);
2490 cache = particles.
end();
2502#include "particle_handler.inst"
value_type * data() const noexcept
std::array< unsigned int, 4 > binary_type
Abstract base class for mapping classes.
void register_additional_store_load_functions(const std::function< std::size_t()> &size_callback, const std::function< void *(const particle_iterator &, void *)> &store_callback, const std::function< const void *(const particle_iterator &, const void *)> &load_callback)
void exchange_ghost_particles(const bool enable_ghost_cache=false)
types::particle_index n_global_particles() const
void unpack_after_coarsening_and_refinement()
void register_data_attach()
void prepare_for_serialization()
unsigned int n_properties_per_particle() const
void get_particle_positions(VectorType &output_vector, const bool add_to_output_vector=false)
void update_cached_numbers()
void prepare_for_coarsening_and_refinement()
boost::iterator_range< particle_iterator > particle_iterator_range
void post_mesh_change_action()
void send_recv_particles(const std::map< types::subdomain_id, std::vector< particle_iterator > > &particles_to_send, const std::map< types::subdomain_id, std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > > &new_cells_for_particles=std::map< types::subdomain_id, std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > >(), const bool enable_cache=false)
void send_recv_particles_properties_and_location(const std::map< types::subdomain_id, std::vector< particle_iterator > > &particles_to_send)
PropertyPool< dim, spacedim > & get_property_pool() const
void initialize(const Triangulation< dim, spacedim > &tria, const Mapping< dim, spacedim > &mapping, const unsigned int n_properties=0)
types::particle_index get_max_local_particle_index() const
void reserve(const std::size_t n_particles)
std::map< unsigned int, IndexSet > insert_global_particles(const std::vector< Point< spacedim > > &positions, const std::vector< std::vector< BoundingBox< spacedim > > > &global_bounding_boxes, const std::vector< std::vector< double > > &properties={}, const std::vector< types::particle_index > &ids={})
void notify_ready_to_unpack(const bool serialization)
void connect_to_triangulation_signals()
void register_load_callback_function(const bool serialization)
std::enable_if_t< std::is_convertible< VectorType *, Function< spacedim > * >::value==false > set_particle_positions(const VectorType &input_vector, const bool displace_particles=true)
void insert_particles(const std::multimap< typename Triangulation< dim, spacedim >::active_cell_iterator, Particle< dim, spacedim > > &particles)
void unpack_callback(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const typename Triangulation< dim, spacedim >::CellStatus status, const boost::iterator_range< std::vector< char >::const_iterator > &data_range)
void register_store_callback_function()
void remove_particle(const particle_iterator &particle)
types::particle_index n_locally_owned_particles() const
void reset_particle_container(particle_container &particles)
types::particle_index n_particles_in_cell(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell) const
void update_ghost_particles()
typename ParticleAccessor< dim, spacedim >::particle_container particle_container
particle_iterator_range particles_in_cell(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell)
particle_iterator insert_particle(const Particle< dim, spacedim > &particle, const typename Triangulation< dim, spacedim >::active_cell_iterator &cell)
void sort_particles_into_subdomains_and_cells()
void remove_particles(const std::vector< particle_iterator > &particles)
types::particle_index n_global_max_particles_per_cell() const
virtual ~ParticleHandler()
void copy_from(const ParticleHandler< dim, spacedim > &particle_handler)
types::particle_index get_next_free_particle_index() const
particle_container particles
std::vector< char > pack_callback(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const typename Triangulation< dim, spacedim >::CellStatus status) const
IndexSet locally_owned_particle_ids() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertThrowMPI(error_code)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcPointNotAvailableHere()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
@ past_the_end
Iterator reached end of container.
@ valid
Iterator points to a valid object.
T sum(const T &t, const MPI_Comm mpi_communicator)
std::map< unsigned int, T > some_to_some(const MPI_Comm comm, const std::map< unsigned int, T > &objects_to_send)
unsigned int n_mpi_processes(const MPI_Comm mpi_communicator)
T max(const T &t, const MPI_Comm mpi_communicator)
std::vector< T > all_gather(const MPI_Comm comm, const T &object_to_send)
const types::subdomain_id artificial_subdomain_id
static const unsigned int invalid_unsigned_int
bool is_finite(const double x)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
unsigned int subdomain_id
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
std::map< unsigned int, std::set<::types::subdomain_id > > * vertices_with_ghost_neighbors
#define DEAL_II_PARTICLE_INDEX_MPI_TYPE
static bool is_inside_unit_cell(const Point< dim > &p)