Reference documentation for deal.II version Git 5f32ffafa8 2019-10-18 00:26:50 -0600
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
parallel::fullydistributed::Triangulation< dim, spacedim > Class Template Reference

#include <deal.II/distributed/fully_distributed_tria.h>

Inheritance diagram for parallel::fullydistributed::Triangulation< dim, spacedim >:
[legend]

Public Member Functions

 Triangulation (MPI_Comm mpi_communicator)
 
virtual ~Triangulation ()=default
 
void create_triangulation (const ConstructionData< dim, spacedim > &construction_data)
 
virtual void create_triangulation (const std::vector< Point< spacedim >> &vertices, const std::vector<::CellData< dim >> &cells, const SubCellData &subcelldata) override
 
virtual void execute_coarsening_and_refinement () override
 
virtual bool prepare_coarsening_and_refinement () override
 
virtual bool has_hanging_nodes () const override
 
virtual std::size_t memory_consumption () const override
 
virtual bool is_multilevel_hierarchy_constructed () const override
 
virtual unsigned int coarse_cell_id_to_coarse_cell_index (const types::coarse_cell_id coarse_cell_id) const override
 
virtual types::coarse_cell_id coarse_cell_index_to_coarse_cell_id (const unsigned int coarse_cell_index) const override
 
- Public Member Functions inherited from parallel::DistributedTriangulationBase< dim, spacedim >
 DistributedTriangulationBase (MPI_Comm mpi_communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing smooth_grid=(::Triangulation< dim, spacedim >::none), const bool check_for_distorted_cells=false)
 
- Public Member Functions inherited from parallel::TriangulationBase< dim, spacedim >
 TriangulationBase (MPI_Comm mpi_communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing smooth_grid=(::Triangulation< dim, spacedim >::none), const bool check_for_distorted_cells=false)
 
virtual ~TriangulationBase () override
 
virtual MPI_Comm get_communicator () const
 
virtual void copy_triangulation (const ::Triangulation< dim, spacedim > &old_tria) override
 
std::vector< unsigned int > compute_n_locally_owned_active_cells_per_processor () const
 
unsigned int n_locally_owned_active_cells () const
 
virtual types::global_dof_index n_global_active_cells () const override
 
virtual unsigned int n_global_levels () const override
 
types::subdomain_id locally_owned_subdomain () const override
 
const std::set< types::subdomain_id > & ghost_owners () const
 
const std::set< types::subdomain_id > & level_ghost_owners () const
 
virtual std::map< unsigned int, std::set<::types::subdomain_id > > compute_vertices_with_ghost_neighbors () const
 
- Public Member Functions inherited from Triangulation< dim, spacedim >
 Triangulation (const MeshSmoothing smooth_grid=none, const bool check_for_distorted_cells=false)
 
 Triangulation (const Triangulation< dim, spacedim > &)=delete
 
 Triangulation (Triangulation< dim, spacedim > &&tria) noexcept
 
Triangulationoperator= (Triangulation< dim, spacedim > &&tria) noexcept
 
virtual void clear ()
 
virtual void set_mesh_smoothing (const MeshSmoothing mesh_smoothing)
 
virtual const MeshSmoothingget_mesh_smoothing () const
 
void set_manifold (const types::manifold_id number, const Manifold< dim, spacedim > &manifold_object)
 
void set_manifold (const types::manifold_id number)
 
void reset_manifold (const types::manifold_id manifold_number)
 
void reset_all_manifolds ()
 
void set_all_manifold_ids (const types::manifold_id number)
 
void set_all_manifold_ids_on_boundary (const types::manifold_id number)
 
void set_all_manifold_ids_on_boundary (const types::boundary_id b_id, const types::manifold_id number)
 
const Manifold< dim, spacedim > & get_manifold (const types::manifold_id number) const
 
std::vector< types::boundary_idget_boundary_ids () const
 
std::vector< types::manifold_idget_manifold_ids () const
 
virtual void copy_triangulation (const Triangulation< dim, spacedim > &other_tria)
 
virtual void create_triangulation (const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata)
 
virtual void create_triangulation_compatibility (const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata)
 
void flip_all_direction_flags ()
 
void set_all_refine_flags ()
 
void refine_global (const unsigned int times=1)
 
void save_refine_flags (std::ostream &out) const
 
void save_refine_flags (std::vector< bool > &v) const
 
void load_refine_flags (std::istream &in)
 
void load_refine_flags (const std::vector< bool > &v)
 
void save_coarsen_flags (std::ostream &out) const
 
void save_coarsen_flags (std::vector< bool > &v) const
 
void load_coarsen_flags (std::istream &out)
 
void load_coarsen_flags (const std::vector< bool > &v)
 
bool get_anisotropic_refinement_flag () const
 
void clear_user_flags ()
 
void save_user_flags (std::ostream &out) const
 
void save_user_flags (std::vector< bool > &v) const
 
void load_user_flags (std::istream &in)
 
void load_user_flags (const std::vector< bool > &v)
 
void clear_user_flags_line ()
 
void save_user_flags_line (std::ostream &out) const
 
void save_user_flags_line (std::vector< bool > &v) const
 
void load_user_flags_line (std::istream &in)
 
void load_user_flags_line (const std::vector< bool > &v)
 
void clear_user_flags_quad ()
 
void save_user_flags_quad (std::ostream &out) const
 
void save_user_flags_quad (std::vector< bool > &v) const
 
void load_user_flags_quad (std::istream &in)
 
void load_user_flags_quad (const std::vector< bool > &v)
 
void clear_user_flags_hex ()
 
void save_user_flags_hex (std::ostream &out) const
 
void save_user_flags_hex (std::vector< bool > &v) const
 
void load_user_flags_hex (std::istream &in)
 
void load_user_flags_hex (const std::vector< bool > &v)
 
void clear_user_data ()
 
void save_user_indices (std::vector< unsigned int > &v) const
 
void load_user_indices (const std::vector< unsigned int > &v)
 
void save_user_pointers (std::vector< void *> &v) const
 
void load_user_pointers (const std::vector< void *> &v)
 
void save_user_indices_line (std::vector< unsigned int > &v) const
 
void load_user_indices_line (const std::vector< unsigned int > &v)
 
void save_user_indices_quad (std::vector< unsigned int > &v) const
 
void load_user_indices_quad (const std::vector< unsigned int > &v)
 
void save_user_indices_hex (std::vector< unsigned int > &v) const
 
void load_user_indices_hex (const std::vector< unsigned int > &v)
 
void save_user_pointers_line (std::vector< void *> &v) const
 
void load_user_pointers_line (const std::vector< void *> &v)
 
void save_user_pointers_quad (std::vector< void *> &v) const
 
void load_user_pointers_quad (const std::vector< void *> &v)
 
void save_user_pointers_hex (std::vector< void *> &v) const
 
void load_user_pointers_hex (const std::vector< void *> &v)
 
cell_iterator begin (const unsigned int level=0) const
 
active_cell_iterator begin_active (const unsigned int level=0) const
 
cell_iterator end () const
 
cell_iterator end (const unsigned int level) const
 
active_cell_iterator end_active (const unsigned int level) const
 
cell_iterator last () const
 
active_cell_iterator last_active () const
 
IteratorRange< cell_iteratorcell_iterators () const
 
IteratorRange< active_cell_iteratoractive_cell_iterators () const
 
IteratorRange< cell_iteratorcell_iterators_on_level (const unsigned int level) const
 
IteratorRange< active_cell_iteratoractive_cell_iterators_on_level (const unsigned int level) const
 
face_iterator begin_face () const
 
active_face_iterator begin_active_face () const
 
face_iterator end_face () const
 
IteratorRange< active_face_iteratoractive_face_iterators () const
 
vertex_iterator begin_vertex () const
 
active_vertex_iterator begin_active_vertex () const
 
vertex_iterator end_vertex () const
 
unsigned int n_lines () const
 
unsigned int n_lines (const unsigned int level) const
 
unsigned int n_active_lines () const
 
unsigned int n_active_lines (const unsigned int level) const
 
unsigned int n_quads () const
 
unsigned int n_quads (const unsigned int level) const
 
unsigned int n_active_quads () const
 
unsigned int n_active_quads (const unsigned int level) const
 
unsigned int n_hexs () const
 
unsigned int n_hexs (const unsigned int level) const
 
unsigned int n_active_hexs () const
 
unsigned int n_active_hexs (const unsigned int level) const
 
unsigned int n_cells () const
 
unsigned int n_cells (const unsigned int level) const
 
unsigned int n_active_cells () const
 
unsigned int n_active_cells (const unsigned int level) const
 
unsigned int n_faces () const
 
unsigned int n_active_faces () const
 
unsigned int n_levels () const
 
unsigned int n_vertices () const
 
const std::vector< Point< spacedim > > & get_vertices () const
 
unsigned int n_used_vertices () const
 
bool vertex_used (const unsigned int index) const
 
const std::vector< bool > & get_used_vertices () const
 
unsigned int max_adjacent_cells () const
 
Triangulation< dim, spacedim > & get_triangulation ()
 
const Triangulation< dim, spacedim > & get_triangulation () const
 
unsigned int n_raw_lines () const
 
unsigned int n_raw_lines (const unsigned int level) const
 
unsigned int n_raw_quads () const
 
unsigned int n_raw_quads (const unsigned int level) const
 
unsigned int n_raw_hexs (const unsigned int level) const
 
unsigned int n_raw_cells (const unsigned int level) const
 
unsigned int n_raw_faces () const
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
virtual void add_periodicity (const std::vector< GridTools::PeriodicFacePair< cell_iterator >> &)
 
const std::map< std::pair< cell_iterator, unsigned int >, std::pair< std::pair< cell_iterator, unsigned int >, std::bitset< 3 > > > & get_periodic_face_map () const
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Member Functions

virtual void update_number_cache () override
 

Private Attributes

Settings settings
 
std::vector< std::pair< types::coarse_cell_id, unsigned int > > coarse_cell_id_to_coarse_cell_index_vector
 
std::vector< types::coarse_cell_idcoarse_cell_index_to_coarse_cell_id_vector
 
bool currently_processing_create_triangulation_for_internal_usage
 
bool currently_processing_prepare_coarsening_and_refinement_for_internal_usage
 

Additional Inherited Members

- Public Types inherited from Triangulation< dim, spacedim >
enum  MeshSmoothing {
  none = 0x0, limit_level_difference_at_vertices = 0x1, eliminate_unrefined_islands = 0x2, patch_level_1 = 0x4,
  coarsest_level_1 = 0x8, allow_anisotropic_smoothing = 0x10, eliminate_refined_inner_islands = 0x100, eliminate_refined_boundary_islands = 0x200,
  do_not_produce_unrefined_islands = 0x400, smoothing_on_refinement, smoothing_on_coarsening, maximum_smoothing = 0xffff ^ allow_anisotropic_smoothing
}
 
using cell_iterator = TriaIterator< CellAccessor< dim, spacedim > >
 
using active_cell_iterator = TriaActiveIterator< CellAccessor< dim, spacedim > >
 
using face_iterator = TriaIterator< TriaAccessor< dim - 1, dim, spacedim > >
 
using active_face_iterator = TriaActiveIterator< TriaAccessor< dim - 1, dim, spacedim > >
 
using vertex_iterator = TriaIterator<::TriaAccessor< 0, dim, spacedim > >
 
using active_vertex_iterator = TriaActiveIterator<::TriaAccessor< 0, dim, spacedim > >
 
using line_iterator = typename IteratorSelector::line_iterator
 
using active_line_iterator = typename IteratorSelector::active_line_iterator
 
using quad_iterator = typename IteratorSelector::quad_iterator
 
using active_quad_iterator = typename IteratorSelector::active_quad_iterator
 
using hex_iterator = typename IteratorSelector::hex_iterator
 
using active_hex_iterator = typename IteratorSelector::active_hex_iterator
 
enum  CellStatus { CELL_PERSIST, CELL_REFINE, CELL_COARSEN, CELL_INVALID }
 
- Static Public Member Functions inherited from Triangulation< dim, spacedim >
static ::ExceptionBaseExcInvalidLevel (int arg1, int arg2)
 
static ::ExceptionBaseExcTriangulationNotEmpty (int arg1, int arg2)
 
static ::ExceptionBaseExcGridReadError ()
 
static ::ExceptionBaseExcFacesHaveNoLevel ()
 
static ::ExceptionBaseExcEmptyLevel (int arg1)
 
static ::ExceptionBaseExcNonOrientableTriangulation ()
 
static ::ExceptionBaseExcBoundaryIdNotFound (types::boundary_id arg1)
 
static ::ExceptionBaseExcInconsistentCoarseningFlags ()
 
- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Public Attributes inherited from Triangulation< dim, spacedim >
Signals signals
 
- Static Public Attributes inherited from Triangulation< dim, spacedim >
static const unsigned int dimension = dim
 
static const unsigned int space_dimension = spacedim
 
- Protected Member Functions inherited from parallel::TriangulationBase< dim, spacedim >
void fill_level_ghost_owners ()
 
- Protected Member Functions inherited from Triangulation< dim, spacedim >
void update_periodic_face_map ()
 
- Static Protected Member Functions inherited from Triangulation< dim, spacedim >
static void write_bool_vector (const unsigned int magic_number1, const std::vector< bool > &v, const unsigned int magic_number2, std::ostream &out)
 
static void read_bool_vector (const unsigned int magic_number1, std::vector< bool > &v, const unsigned int magic_number2, std::istream &in)
 
- Protected Attributes inherited from parallel::TriangulationBase< dim, spacedim >
MPI_Comm mpi_communicator
 
types::subdomain_id my_subdomain
 
types::subdomain_id n_subdomains
 
- Protected Attributes inherited from Triangulation< dim, spacedim >
MeshSmoothing smooth_grid
 

Detailed Description

template<int dim, int spacedim = dim>
class parallel::fullydistributed::Triangulation< dim, spacedim >

A distributed triangulation with a distributed coarse grid.

The motivation for parallel::fullydistributed::Triangulation has its origins in the following observations about complex geometries and/or about given meshes created by an external mesh generator. We regard complex geometries as geometries that can be meshed only with a non-negligible number of coarse cells (>10,000):

To be able to construct a fully partitioned triangulation that distributes the coarse grid and gives flexibility regarding partitioning, the following ingredients are required:

The ingredients listed above are bundled in the struct parallel::fullydistributed::ConstructionData. The user has to fill this data structure - in a pre-processing step - before actually creating the triangulation. Predefined functions to create ConstructionData can be found in the namespace ::fullydistributed::Utilities.

Once the ConstructionData construction_data has been constructed, the triangulation tria can be created by calling tria.create_triangulation(construction_data);.

Note
This triangulation supports: 1D/2D/3D, hanging nodes, geometric multigrid, and periodicity.
You can create a triangulation with hanging nodes and multigrid levels with create_triangulation(). However, once it has been created, it cannot be altered anymore, i.e. you cannot coarsen or refine afterwards.
Currently only simple periodicity conditions (i.e. without offsets and rotation matrices - see also the documentation of GridTools::collect_periodic_faces()) are supported.
Author
Peter Munch, 2019

Definition at line 272 of file fully_distributed_tria.h.

Constructor & Destructor Documentation

◆ Triangulation()

template<int dim, int spacedim>
Triangulation< dim, spacedim >::Triangulation ( MPI_Comm  mpi_communicator)
explicit

Constructor.

Parameters
mpi_communicatorThe MPI communicator to be used for the triangulation.

Definition at line 39 of file fully_distributed_tria.cc.

◆ ~Triangulation()

template<int dim, int spacedim = dim>
virtual parallel::fullydistributed::Triangulation< dim, spacedim >::~Triangulation ( )
virtualdefault

Destructor.

Reimplemented from Triangulation< dim, spacedim >.

Member Function Documentation

◆ create_triangulation() [1/2]

template<int dim, int spacedim>
void Triangulation< dim, spacedim >::create_triangulation ( const ConstructionData< dim, spacedim > &  construction_data)

Create a triangulation from the provided ConstructionData.

Note
The namespace ::fullydistributed::Util contains functions to create ConstructionData.
This is the function to be used instead of Triangulation::create_triangulation() for some of the other triangulations of deal.II.
Parameters
construction_dataThe data needed for this process.

Definition at line 51 of file fully_distributed_tria.cc.

◆ create_triangulation() [2/2]

template<int dim, int spacedim>
void Triangulation< dim, spacedim >::create_triangulation ( const std::vector< Point< spacedim >> &  vertices,
const std::vector<::CellData< dim >> &  cells,
const SubCellData subcelldata 
)
overridevirtual
Note
This function is not implemented for this class and throws an assertion. Instead, use the other create_triangulation() function to create the triangulation.

Definition at line 271 of file fully_distributed_tria.cc.

◆ execute_coarsening_and_refinement()

template<int dim, int spacedim>
void Triangulation< dim, spacedim >::execute_coarsening_and_refinement ( )
overridevirtual

Coarsen and refine the mesh according to refinement and coarsening flags set.

Note
Not implemented yet.

Reimplemented from Triangulation< dim, spacedim >.

Definition at line 302 of file fully_distributed_tria.cc.

◆ prepare_coarsening_and_refinement()

template<int dim, int spacedim>
bool Triangulation< dim, spacedim >::prepare_coarsening_and_refinement ( )
overridevirtual

Override the implementation of prepare_coarsening_and_refinement from the base class.

Note
Not implemented yet.

Reimplemented from Triangulation< dim, spacedim >.

Definition at line 311 of file fully_distributed_tria.cc.

◆ has_hanging_nodes()

template<int dim, int spacedim>
bool Triangulation< dim, spacedim >::has_hanging_nodes ( ) const
overridevirtual

Return true if the triangulation has hanging nodes.

Note
Not implemented yet.

Reimplemented from Triangulation< dim, spacedim >.

Definition at line 325 of file fully_distributed_tria.cc.

◆ memory_consumption()

template<int dim, int spacedim>
std::size_t Triangulation< dim, spacedim >::memory_consumption ( ) const
overridevirtual

Return the local memory consumption in bytes.

Reimplemented from parallel::TriangulationBase< dim, spacedim >.

Definition at line 335 of file fully_distributed_tria.cc.

◆ is_multilevel_hierarchy_constructed()

template<int dim, int spacedim>
bool Triangulation< dim, spacedim >::is_multilevel_hierarchy_constructed ( ) const
overridevirtual

Return if multilevel hierarchy is supported and has been constructed.

Implements parallel::DistributedTriangulationBase< dim, spacedim >.

Definition at line 351 of file fully_distributed_tria.cc.

◆ coarse_cell_id_to_coarse_cell_index()

template<int dim, int spacedim>
unsigned int Triangulation< dim, spacedim >::coarse_cell_id_to_coarse_cell_index ( const types::coarse_cell_id  coarse_cell_id) const
overridevirtual

Translate the unique id of a coarse cell to its index. See the glossary entry on coarse cell IDs for more information.

Note
For serial and shared triangulation both id and index are the same. For distributed triangulations setting both might differ, since the id might correspond to a global id and the index to a local id.
Parameters
coarse_cell_idUnique id of the coarse cell.
Returns
Index of the coarse cell within the current triangulation.

Reimplemented from Triangulation< dim, spacedim >.

Definition at line 360 of file fully_distributed_tria.cc.

◆ coarse_cell_index_to_coarse_cell_id()

template<int dim, int spacedim>
types::coarse_cell_id Triangulation< dim, spacedim >::coarse_cell_index_to_coarse_cell_id ( const unsigned int  coarse_cell_index) const
overridevirtual

Translate the index of coarse cell to its unique id. See the glossary entry on coarse cell IDs for more information.

Note
See the note of the method coarse_cell_id_to_coarse_cell_index().
Parameters
coarse_cell_indexIndex of the coarse cell.
Returns
Id of the coarse cell.

Reimplemented from Triangulation< dim, spacedim >.

Definition at line 379 of file fully_distributed_tria.cc.

◆ update_number_cache()

template<int dim, int spacedim>
void Triangulation< dim, spacedim >::update_number_cache ( )
overrideprivatevirtual

Override the function to update the number cache so we can fill data like level_ghost_owners.

Reimplemented from parallel::TriangulationBase< dim, spacedim >.

Definition at line 290 of file fully_distributed_tria.cc.

Member Data Documentation

◆ settings

template<int dim, int spacedim = dim>
Settings parallel::fullydistributed::Triangulation< dim, spacedim >::settings
private

store the Settings.

Definition at line 379 of file fully_distributed_tria.h.

◆ coarse_cell_id_to_coarse_cell_index_vector

template<int dim, int spacedim = dim>
std::vector<std::pair<types::coarse_cell_id, unsigned int> > parallel::fullydistributed::Triangulation< dim, spacedim >::coarse_cell_id_to_coarse_cell_index_vector
private

Sorted list of pairs of coarse-cell ids and their indices.

Definition at line 385 of file fully_distributed_tria.h.

◆ coarse_cell_index_to_coarse_cell_id_vector

template<int dim, int spacedim = dim>
std::vector<types::coarse_cell_id> parallel::fullydistributed::Triangulation< dim, spacedim >::coarse_cell_index_to_coarse_cell_id_vector
private

List of the coarse-cell id for each coarse cell (stored at cell->index()).

Definition at line 392 of file fully_distributed_tria.h.

◆ currently_processing_create_triangulation_for_internal_usage

template<int dim, int spacedim = dim>
bool parallel::fullydistributed::Triangulation< dim, spacedim >::currently_processing_create_triangulation_for_internal_usage
private

Boolean indicating that the function create_triangulation() was called for internal usage.

Definition at line 398 of file fully_distributed_tria.h.

◆ currently_processing_prepare_coarsening_and_refinement_for_internal_usage

template<int dim, int spacedim = dim>
bool parallel::fullydistributed::Triangulation< dim, spacedim >::currently_processing_prepare_coarsening_and_refinement_for_internal_usage
private

Boolean indicating that the function prepare_coarsening_and_refinement() was called for internal usage.

Definition at line 405 of file fully_distributed_tria.h.


The documentation for this class was generated from the following files: