#include <deal.II/particles/particle_iterator.h>
#include <deal.II/particles/property_pool.h>
-#include <deal.II/grid/tria.h>
+#include <deal.II/distributed/tria.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/mpi.h>
#include <deal.II/base/array_view.h>
* particle that is no longer in the cell.
*/
particle_iterator_range
- particles_in_cell(const typename parallel::distributed::Triangulation<dim,spacedim>::active_cell_iterator &cell);
+ particles_in_cell(const typename Triangulation<dim,spacedim>::active_cell_iterator &cell);
/**
* particle that is no longer in the cell.
*/
particle_iterator_range
- particles_in_cell(const typename parallel::distributed::Triangulation<dim,spacedim>::active_cell_iterator &cell) const;
+ particles_in_cell(const typename Triangulation<dim,spacedim>::active_cell_iterator &cell) const;
/**
* Remove a particle pointed to by the iterator.
*/
particle_iterator
insert_particle(const Particle<dim,spacedim> &particle,
- const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell);
+ const typename Triangulation<dim,spacedim>::active_cell_iterator &cell);
/**
* Insert a number of particle into the collection of particles.
* respective cell center.
*/
std::vector<std::vector<Tensor<1,spacedim> > >
- vertex_to_cell_centers_directions(const std::vector<std::set<typename parallel::distributed::Triangulation<dim,spacedim>::active_cell_iterator> > &vertex_to_cells) const;
+ vertex_to_cell_centers_directions(const std::vector<std::set<typename Triangulation<dim,spacedim>::active_cell_iterator> > &vertex_to_cells) const;
/**
* Finds the cells containing each particle for all locally owned
void serialize (Archive &ar, const unsigned int version);
private:
- /**
- * A private typedef for cell iterator that makes the code of this class
- * easier to read.
- */
- typedef typename parallel::distributed::Triangulation<dim,spacedim>::active_cell_iterator active_cell_it;
-
/**
* Address of the triangulation to work on.
*/
void
send_recv_particles(const std::vector<std::vector<particle_iterator> > &particles_to_send,
std::multimap<types::LevelInd,Particle <dim,spacedim> > &received_particles,
- const std::vector<std::vector<active_cell_it> > &new_cells_for_particles = std::vector<std::vector<active_cell_it> > ());
+ const std::vector<std::vector<typename Triangulation<dim,spacedim>::active_cell_iterator> > &new_cells_for_particles = std::vector<std::vector<typename Triangulation<dim,spacedim>::active_cell_iterator> > ());
* cell to be sent around to the new processes.
*/
void
- store_particles(const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator &cell,
- const typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus status,
+ store_particles(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+ const typename Triangulation<dim,spacedim>::CellStatus status,
void *data) const;
/**
* of particles has to be read from the triangulation user_pointer.
*/
void
- load_particles(const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator &cell,
- const typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus status,
+ load_particles(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+ const typename Triangulation<dim,spacedim>::CellStatus status,
const void *data);
/**
template <int dim,int spacedim>
typename ParticleHandler<dim,spacedim>::particle_iterator_range
- ParticleHandler<dim,spacedim>::particles_in_cell(const active_cell_it &cell) const
+ ParticleHandler<dim,spacedim>::particles_in_cell(const typename Triangulation<dim,spacedim>::active_cell_iterator &cell) const
{
return (const_cast<ParticleHandler<dim,spacedim> *> (this))->particles_in_cell(cell);
}
template <int dim,int spacedim>
typename ParticleHandler<dim,spacedim>::particle_iterator_range
- ParticleHandler<dim,spacedim>::particles_in_cell(const active_cell_it &cell)
+ ParticleHandler<dim,spacedim>::particles_in_cell(const typename Triangulation<dim,spacedim>::active_cell_iterator &cell)
{
const types::LevelInd level_index = std::make_pair<int, int> (cell->level(),cell->index());
template <int dim,int spacedim>
typename ParticleHandler<dim,spacedim>::particle_iterator
ParticleHandler<dim,spacedim>::insert_particle(const Particle<dim,spacedim> &particle,
- const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell)
+ const typename Triangulation<dim,spacedim>::active_cell_iterator &cell)
{
typename std::multimap<types::LevelInd, Particle<dim,spacedim> >::iterator it =
particles.insert(std::make_pair(types::LevelInd(cell->level(),cell->index()),particle));
ParticleHandler<dim,spacedim>::update_global_max_particles_per_cell()
{
unsigned int local_max_particles_per_cell(0);
- active_cell_it cell = triangulation->begin_active();
+ typename Triangulation<dim,spacedim>::active_cell_iterator cell = triangulation->begin_active();
for (; cell!=triangulation->end(); ++cell)
if (cell->is_locally_owned())
{
template <int dim, int spacedim>
std::vector<std::vector<Tensor<1,spacedim> > >
- ParticleHandler<dim,spacedim>::vertex_to_cell_centers_directions(const std::vector<std::set<active_cell_it> > &vertex_to_cells) const
+ ParticleHandler<dim,spacedim>::vertex_to_cell_centers_directions(const std::vector<std::set<typename Triangulation<dim,spacedim>::active_cell_iterator> > &vertex_to_cells) const
{
const std::vector<Point<spacedim> > &vertices = triangulation->get_vertices();
const unsigned int n_vertices = vertex_to_cells.size();
const unsigned int n_neighbor_cells = vertex_to_cells[vertex].size();
vertex_to_cell_centers[vertex].resize(n_neighbor_cells);
- typename std::set<typename Triangulation<dim,spacedim>::active_cell_iterator>::iterator it = vertex_to_cells[vertex].begin();
+ typename std::set<typename Triangulation<dim,spacedim>::active_cell_iterator>::iterator
+ it = vertex_to_cells[vertex].begin();
+
for (unsigned int cell=0; cell<n_neighbor_cells; ++cell,++it)
{
vertex_to_cell_centers[vertex][cell] = (*it)->center() - vertices[vertex];
// Now update the reference locations of the moved particles
for (particle_iterator it=begin(); it!=end(); ++it)
{
- const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator cell = it->get_surrounding_cell(*triangulation);
+ const typename Triangulation<dim,spacedim>::cell_iterator cell = it->get_surrounding_cell(*triangulation);
try
{
// the mesh completely are ignored and removed.
std::vector<std::pair<types::LevelInd, Particle<dim,spacedim> > > sorted_particles;
std::vector<std::vector<particle_iterator> > moved_particles;
- std::vector<std::vector<active_cell_it> > moved_cells;
+ std::vector<std::vector<typename Triangulation<dim,spacedim>::active_cell_iterator> > moved_cells;
// We do not know exactly how many particles are lost, exchanged between
// domains, or remain on this process. Therefore we pre-allocate approximate
// Check if the particle is in one of the old cell's neighbors
// that are adjacent to the closest vertex
- active_cell_it current_cell = (*it)->get_surrounding_cell(*triangulation);
+ typename Triangulation<dim,spacedim>::active_cell_iterator current_cell = (*it)->get_surrounding_cell(*triangulation);
const unsigned int closest_vertex = get_closest_vertex_of_cell(current_cell,(*it)->get_location());
Tensor<1,spacedim> vertex_to_particle = (*it)->get_location() - current_cell->vertex(closest_vertex);
{
try
{
- typename std::set<typename Triangulation<dim,spacedim>::active_cell_iterator>::const_iterator cell = vertex_to_cells[closest_vertex_index].begin();
+ typename std::set<typename Triangulation<dim,spacedim>::active_cell_iterator>::const_iterator
+ cell = vertex_to_cells[closest_vertex_index].begin();
+
std::advance(cell,neighbor_permutation[i]);
const Point<dim> p_unit = mapping->transform_real_to_unit_cell(*cell,
(*it)->get_location());
// This case is rare.
try
{
- const std::pair<const typename parallel::distributed::Triangulation<dim,spacedim>::active_cell_iterator,
+ const std::pair<const typename Triangulation<dim,spacedim>::active_cell_iterator,
Point<dim> > current_cell_and_position =
GridTools::find_active_cell_around_point<> (*mapping,
*triangulation,
std::vector<std::set<unsigned int> > vertex_to_neighbor_subdomain(triangulation->n_vertices());
- active_cell_it
+ typename Triangulation<dim,spacedim>::active_cell_iterator
cell = triangulation->begin_active(),
endc = triangulation->end();
for (; cell != endc; ++cell)
void
ParticleHandler<dim,spacedim>::send_recv_particles(const std::vector<std::vector<particle_iterator> > &particles_to_send,
std::multimap<types::LevelInd,Particle <dim,spacedim> > &received_particles,
- const std::vector<std::vector<active_cell_it> > &send_cells)
+ const std::vector<std::vector<typename Triangulation<dim,spacedim>::active_cell_iterator> > &send_cells)
{
// Determine the communication pattern
const std::set<types::subdomain_id> ghost_owners = triangulation->ghost_owners();
for (unsigned int i=0; i<particles_to_send[neighbor_id].size(); ++i)
{
// If no target cells are given, use the iterator information
- active_cell_it cell;
+ typename Triangulation<dim,spacedim>::active_cell_iterator cell;
if (send_cells.size() == 0)
cell = particles_to_send[neighbor_id][i]->get_surrounding_cell(*triangulation);
else
const CellId id(binary_cellid);
recv_data_it = static_cast<const char *> (recv_data_it) + cellid_size;
- const active_cell_it cell = id.to_cell(*triangulation);
+ const typename Triangulation<dim,spacedim>::active_cell_iterator cell = id.to_cell(*triangulation);
typename std::multimap<types::LevelInd,Particle <dim,spacedim> >::iterator recv_particle =
received_particles.insert(std::make_pair(types::LevelInd(cell->level(),cell->index()),
if (global_max_particles_per_cell > 0)
{
- const std::function<void(const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator &,
- const typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus, void *) > callback_function
+ const std::function<void(const typename Triangulation<dim,spacedim>::cell_iterator &,
+ const typename Triangulation<dim,spacedim>::CellStatus, void *) > callback_function
= std::bind(&ParticleHandler<dim,spacedim>::store_particles,
std::cref(*this),
std::placeholders::_1,
// data correctly. Only do this if something was actually stored.
if (serialization && (global_max_particles_per_cell > 0))
{
- const std::function<void(const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator &,
- const typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus, void *) > callback_function
+ const std::function<void(const typename Triangulation<dim,spacedim>::cell_iterator &,
+ const typename Triangulation<dim,spacedim>::CellStatus, void *) > callback_function
= std::bind(&ParticleHandler<dim,spacedim>::store_particles,
std::cref(*this),
std::placeholders::_1,
// Check if something was stored and load it
if (data_offset != numbers::invalid_unsigned_int)
{
- const std::function<void(const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator &,
- const typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus,
+ const std::function<void(const typename Triangulation<dim,spacedim>::cell_iterator &,
+ const typename Triangulation<dim,spacedim>::CellStatus,
const void *) > callback_function
= std::bind(&ParticleHandler<dim,spacedim>::load_particles,
std::ref(*this),
template <int dim, int spacedim>
void
- ParticleHandler<dim,spacedim>::store_particles(const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator &cell,
- const typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus status,
+ ParticleHandler<dim,spacedim>::store_particles(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+ const typename Triangulation<dim,spacedim>::CellStatus status,
void *data) const
{
unsigned int n_particles(0);
{
for (unsigned int child_index = 0; child_index < GeometryInfo<dim>::max_children_per_cell; ++child_index)
{
- const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
+ const typename Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
n_particles += n_particles_in_cell(child);
}
for (unsigned int child_index = 0; child_index < GeometryInfo<dim>::max_children_per_cell; ++child_index)
{
- const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
+ const typename Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
const boost::iterator_range<particle_iterator> particle_range
= particles_in_cell(child);
template <int dim, int spacedim>
void
- ParticleHandler<dim,spacedim>::load_particles(const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator &cell,
- const typename parallel::distributed::Triangulation<dim,spacedim>::CellStatus status,
+ ParticleHandler<dim,spacedim>::load_particles(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+ const typename Triangulation<dim,spacedim>::CellStatus status,
const void *data)
{
const unsigned int *n_particles_in_cell_ptr = static_cast<const unsigned int *> (data);
std::vector<typename std::multimap<types::LevelInd, Particle<dim,spacedim> >::iterator > position_hints(GeometryInfo<dim>::max_children_per_cell);
for (unsigned int child_index=0; child_index<GeometryInfo<dim>::max_children_per_cell; ++child_index)
{
- const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
+ const typename Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
position_hints[child_index] = particles.upper_bound(std::make_pair(child->level(),child->index()));
}
for (unsigned int child_index = 0; child_index < GeometryInfo<dim>::max_children_per_cell; ++child_index)
{
- const typename parallel::distributed::Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
+ const typename Triangulation<dim,spacedim>::cell_iterator child = cell->child(child_index);
try
{