
This class acts like the Triangulation class, but it distributes the mesh across a number of different processors when using MPI. The class's interface does not add a lot to the Triangulation class but there are a number of difficult algorithms under the hood that ensure we always have a load-balanced, fully distributed mesh. Use of this class is explained in step-40, step-32, the Parallel computing with multiple processors using distributed memory documentation module, as well as the distributed_paper . See there for more information.
| typedef ::Triangulation<dim,spacedim>::active_cell_iterator parallel::distributed::Triangulation< dim, spacedim >::active_cell_iterator |
Import the various iterator typedefs from the base class.
Reimplemented from Triangulation< dim, spacedim >.
| typedef ::Triangulation<dim,spacedim>::cell_iterator parallel::distributed::Triangulation< dim, spacedim >::cell_iterator |
Reimplemented from Triangulation< dim, spacedim >.
| typedef ::Triangulation<dim,spacedim>::raw_cell_iterator parallel::distributed::Triangulation< dim, spacedim >::raw_cell_iterator |
Reimplemented from Triangulation< dim, spacedim >.
typedef std_cxx1x::function< void(typename Triangulation<dim,spacedim>::cell_iterator, CellStatus, void*) parallel::distributed::Triangulation< dim, spacedim >::pack_callback_t) [private] |
typedef std::pair<unsigned int, pack_callback_t> parallel::distributed::Triangulation< dim, spacedim >::callback_pair_t [private] |
typedef std::list<callback_pair_t> parallel::distributed::Triangulation< dim, spacedim >::callback_list_t [private] |
| enum parallel::distributed::Triangulation::CellStatus |
Used to inform in the callbacks of register_data_attach() and notify_ready_to_unpack() how the cell with the given cell_iterator is going to change. Note that this may me different then the refine_flag() and coarsen_flag() in the cell_iterator because of refinement constraints that this machine does not see.
| parallel::distributed::Triangulation< dim, spacedim >::Triangulation | ( | MPI_Comm | mpi_communicator, |
| const typename::Triangulation< dim, spacedim >::MeshSmoothing | smooth_grid = (::Triangulation< dim, spacedim >::none) |
||
| ) |
Constructor.
| mpi_communicator | denotes the MPI communicator to be used for the triangulation. |
| smooth_grid | Degree and kind of mesh smoothing to be applied to the mesh. See the Triangulation class for a description of the kinds of smoothing operations that can be applied. |
check_for_distorted_cells argument provided by the base class. | virtual parallel::distributed::Triangulation< dim, spacedim >::~Triangulation | ( | ) | [virtual] |
Destructor.
Reimplemented from Triangulation< dim, spacedim >.
| virtual void parallel::distributed::Triangulation< dim, spacedim >::clear | ( | ) | [virtual] |
Reset this triangulation into a virgin state by deleting all data.
Note that this operation is only allowed if no subscriptions to this object exist any more, such as DoFHandler objects using it.
Reimplemented from Triangulation< dim, spacedim >.
| virtual void parallel::distributed::Triangulation< dim, spacedim >::copy_triangulation | ( | const ::Triangulation< dim, spacedim > & | old_tria | ) | [virtual] |
Implementation of the same function as in the base class.
| virtual void parallel::distributed::Triangulation< dim, spacedim >::create_triangulation | ( | const std::vector< Point< spacedim > > & | vertices, |
| const std::vector< CellData< dim > > & | cells, | ||
| const SubCellData & | subcelldata | ||
| ) | [virtual] |
Create a triangulation as documented in the base class.
This function also sets up the various data structures necessary to distribute a mesh across a number of processors. This will be necessary once the mesh is being refined, though we will always keep the entire coarse mesh that is generated by this function on all processors.
Reimplemented from Triangulation< dim, spacedim >.
| virtual void parallel::distributed::Triangulation< dim, spacedim >::execute_coarsening_and_refinement | ( | ) | [virtual] |
Coarsen and refine the mesh according to refinement and coarsening flags set.
Since the current processor only has control over those cells it owns (i.e. the ones for which cell->subdomain_id() == this->locally_owned_subdomain()), refinement and coarsening flags are only respected for those locally owned cells. Flags may be set on other cells as well (and may often, in fact, if you call Triangulation::prepare_coarsening_and_refinement) but will be largely ignored: the decision to refine the global mesh will only be affected by flags set on locally owned cells.
Reimplemented from Triangulation< dim, spacedim >.
| types::subdomain_id_t parallel::distributed::Triangulation< dim, spacedim >::locally_owned_subdomain | ( | ) | const |
Return the subdomain id of those cells that are owned by the current processor. All cells in the triangulation that do not have this subdomain id are either owned by another processor or have children that only exist on other processors.
| unsigned int parallel::distributed::Triangulation< dim, spacedim >::n_locally_owned_active_cells | ( | ) | const |
Return the number of active cells in the triangulation that are locally owned, i.e. that have a subdomain_id equal to locally_owned_subdomain(). Note that there may be more active cells in the triangulation stored on the present processor, such as for example ghost cells, or cells further away from the locally owned block of cells but that are needed to ensure that the triangulation that stores this processor's set of active cells still remains balanced with respect to the 2:1 size ratio of adjacent cells.
As a consequence of the remark above, the result of this function is always smaller or equal to the result of Triangulation::n_active_cells() which includes the active ghost and artificial cells (see also GlossArtificialCell and GlossGhostCell).
| unsigned int parallel::distributed::Triangulation< dim, spacedim >::n_global_active_cells | ( | ) | const |
Return the sum over all processors of the number of active cells owned by each processor. This equals the overall number of active cells in the distributed triangulation.
| const std::vector<unsigned int>& parallel::distributed::Triangulation< dim, spacedim >::n_locally_owned_active_cells_per_processor | ( | ) | const |
Return the number of active cells owned by each of the MPI processes that contribute to this triangulation. The element of this vector indexed by locally_owned_subdomain() equals the result of n_locally_owned_active_cells().
| MPI_Comm parallel::distributed::Triangulation< dim, spacedim >::get_communicator | ( | ) | const |
Return the MPI communicator used by this triangulation.
| virtual unsigned int parallel::distributed::Triangulation< dim, spacedim >::memory_consumption | ( | ) | const [virtual] |
Return the local memory consumption in bytes.
Reimplemented from Triangulation< dim, spacedim >.
| virtual unsigned int parallel::distributed::Triangulation< dim, spacedim >::memory_consumption_p4est | ( | ) | const [virtual] |
Return the local memory consumption contained in the p4est data structures alone. This is already contained in memory_consumption() but made available separately for debugging purposes.
| void parallel::distributed::Triangulation< dim, spacedim >::write_mesh_vtk | ( | const char * | file_basename | ) | const |
A collective operation that produces a sequence of output files with the given file base name that contain the mesh in VTK format.
More than anything else, this function is useful for debugging the interface between deal.II and p4est.
| unsigned int parallel::distributed::Triangulation< dim, spacedim >::get_checksum | ( | ) | const |
Produce a check sum of the triangulation. This is a collective operation and is mostly useful for debugging purposes.
| unsigned int parallel::distributed::Triangulation< dim, spacedim >::register_data_attach | ( | const size_t | size, |
| const std_cxx1x::function< void(const cell_iterator &, const CellStatus, void *)> & | pack_callback | ||
| ) |
Register a function with the current Triangulation object that will be used to attach data to active cells before execute_coarsening_and_refinement(). In execute_coarsening_and_refinement() the Triangulation will call the given function pointer and provide size bytes to store data. If necessary, this data will be transferred to the new owner of that cell during repartitioning the tree. See notify_ready_to_unpack() on how to retrieve the data.
Callers need to store the return value. It specifies an offset of the position at which data can later be retrieved during a call to notify_ready_to_unpack().
| void parallel::distributed::Triangulation< dim, spacedim >::notify_ready_to_unpack | ( | const unsigned int | offset, |
| const std_cxx1x::function< void(const cell_iterator &, const CellStatus, const void *)> & | unpack_callback | ||
| ) |
The given function is called for each new active cell and supplies a pointer to the data saved with register_data_attach().
| typename ::internal::p4est::types<dim>::tree* parallel::distributed::Triangulation< dim, spacedim >::init_tree | ( | const int | dealii_coarse_cell_index | ) | const [private] |
Return a pointer to the p4est tree that belongs to the given dealii_coarse_cell_index()
| void parallel::distributed::Triangulation< dim, spacedim >::setup_coarse_cell_to_p4est_tree_permutation | ( | ) | [private] |
The function that computes the permutation between the two data storage schemes.
| void parallel::distributed::Triangulation< dim, spacedim >::copy_new_triangulation_to_p4est | ( | ::internal::int2type< 2 > | ) | [private] |
Take the contents of a newly created triangulation we are attached to and copy it to p4est data structures.
This function exists in 2d and 3d variants.
| void parallel::distributed::Triangulation< dim, spacedim >::copy_new_triangulation_to_p4est | ( | ::internal::int2type< 3 > | ) | [private] |
| void parallel::distributed::Triangulation< dim, spacedim >::copy_local_forest_to_triangulation | ( | ) | [private] |
Copy the local part of the refined forest from p4est into the attached triangulation.
| void parallel::distributed::Triangulation< dim, spacedim >::update_number_cache | ( | ) | [private] |
Update the number_cache variable after mesh creation or refinement.
| void parallel::distributed::Triangulation< dim, spacedim >::attach_mesh_data | ( | ) | [private] |
Internal function notifying all registered classes to attach their data before repartitioning occurs. Called from execute_coarsening_and_refinement().
friend class ::internal::DoFHandler::Policy::ParallelDistributed [friend] |
MPI_Comm parallel::distributed::Triangulation< dim, spacedim >::mpi_communicator [private] |
MPI communicator to be used for the triangulation. We create a unique communicator for this class, which is a duplicate of the one passed to the constructor.
types::subdomain_id_t parallel::distributed::Triangulation< dim, spacedim >::my_subdomain [private] |
The subdomain id to be used for the current processor.
bool parallel::distributed::Triangulation< dim, spacedim >::triangulation_has_content [private] |
A flag that indicates whether the triangulation has actual content.
NumberCache parallel::distributed::Triangulation< dim, spacedim >::number_cache [private] |
Cache to hold the numbers of lines, quads, hexes, etc. These numbers are set at the end of the refinement and coarsening functions and enable faster access later on. In the old days, whenever one wanted to access one of these numbers, one had to perform a loop over all lines, e.g., and count the elements until we hit the end iterator. This is time consuming and since access to the number of lines etc is a rather frequent operation, this was not an optimal solution.
Reimplemented from Triangulation< dim, spacedim >.
typename ::internal::p4est::types<dim>::connectivity* parallel::distributed::Triangulation< dim, spacedim >::connectivity [private] |
A data structure that holds the connectivity between trees. Since each tree is rooted in a coarse grid cell, this data structure holds the connectivity between the cells of the coarse grid.
typename ::internal::p4est::types<dim>::forest* parallel::distributed::Triangulation< dim, spacedim >::parallel_forest [private] |
A data structure that holds the local part of the global triangulation.
bool parallel::distributed::Triangulation< dim, spacedim >::refinement_in_progress [private] |
A flag that indicates whether refinement of a triangulation is currently in progress. We need this flag because the refinement_notification() function is called from Triangulation::execute_coarsening_and_refinement(), but refinement_notification() itself also calls Triangulation::execute_coarsening_and_refinement() and therefore gets called recursively again. While the first time we want to take over work to copy things from a refined p4est, the other times we don't want to get in the way as these latter calls to Triangulation::execute_coarsening_and_refinement() are simply there in order to re-create a triangulation that matches the p4est.
unsigned int parallel::distributed::Triangulation< dim, spacedim >::attached_data_size [private] |
unsigned int parallel::distributed::Triangulation< dim, spacedim >::n_attached_datas [private] |
callback_list_t parallel::distributed::Triangulation< dim, spacedim >::attached_data_pack_callbacks [private] |
std::vector<unsigned int> parallel::distributed::Triangulation< dim, spacedim >::coarse_cell_to_p4est_tree_permutation [private] |
Two arrays that store which p4est tree corresponds to which coarse grid cell and vice versa. We need these arrays because p4est goes with the original order of coarse cells when it sets up its forest, and then applies the Morton ordering within each tree. But if coarse grid cells are badly ordered this may mean that individual parts of the forest stored on a local machine may be split across coarse grid cells that are not geometrically close. Consequently, we apply a Cuthill-McKee preordering to ensure that the part of the forest stored by p4est is located on geometrically close coarse grid cells.
std::vector<unsigned int> parallel::distributed::Triangulation< dim, spacedim >::p4est_tree_to_coarse_cell_permutation [private] |
documentation generated on Fri Aug 12 2011 15:01:09 by
doxygen
1.7.4