Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Types | Public Member Functions | Public Attributes | List of all members
parallel::distributed::Triangulation< 1, spacedim > Class Template Reference

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

Inheritance diagram for parallel::distributed::Triangulation< 1, spacedim >:
[legend]

Public Types

enum  Settings
 
- 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 }
 

Public Member Functions

 Triangulation (MPI_Comm mpi_communicator, const typename ::Triangulation< 1, spacedim >::MeshSmoothing smooth_grid=(::Triangulation< 1, spacedim >::none), const Settings settings=default_setting)
 
virtual ~Triangulation () override
 
const std::vector< types::global_dof_index > & get_p4est_tree_to_coarse_cell_permutation () const
 
void communicate_locally_moved_vertices (const std::vector< bool > &vertex_locally_moved)
 
void load (const std::string &filename, const bool autopartition=true)
 
void save (const std::string &filename) const
 
unsigned int register_data_attach (const std::function< std::vector< char >(const typename ::Triangulation< 1, spacedim >::cell_iterator &, const typename ::Triangulation< 1, spacedim >::CellStatus)> &pack_callback, const bool returns_variable_size_data)
 
void notify_ready_to_unpack (const unsigned int handle, const std::function< void(const typename ::Triangulation< 1, spacedim >::cell_iterator &, const typename ::Triangulation< 1, spacedim >::CellStatus, const boost::iterator_range< std::vector< char >::const_iterator > &)> &unpack_callback)
 
virtual std::map< unsigned int, std::set<::types::subdomain_id > > compute_vertices_with_ghost_neighbors () const override
 
virtual std::map< unsigned int, std::set<::types::subdomain_id > > compute_level_vertices_with_ghost_neighbors (const unsigned int level) const
 
virtual std::vector< bool > mark_locally_active_vertices_on_level (const unsigned int level) const
 
- Public Member Functions inherited from parallel::Triangulation< 1, spacedim >
 Triangulation (MPI_Comm mpi_communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing smooth_grid=(::Triangulation< dim, spacedim >::none), const bool check_for_distorted_cells=false)
 
virtual MPI_Comm get_communicator () const
 
virtual void copy_triangulation (const ::Triangulation< dim, spacedim > &old_tria) override
 
const std::vector< unsigned int > & 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 std::size_t memory_consumption () 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
 
- 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)
 
virtual void execute_coarsening_and_refinement ()
 
virtual bool prepare_coarsening_and_refinement ()
 
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
 
virtual bool has_hanging_nodes () 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)
 

Public Attributes

std::vector< types::global_dof_indexcoarse_cell_to_p4est_tree_permutation
 
Settings settings
 
- Public Attributes inherited from Triangulation< dim, spacedim >
Signals signals
 

Additional Inherited Members

- 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 Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- 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::Triangulation< 1, spacedim >
virtual void update_number_cache ()
 
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::Triangulation< 1, 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 spacedim>
class parallel::distributed::Triangulation< 1, spacedim >

Specialization of the general template for the 1d case. There is currently no support for distributing 1d triangulations. Consequently, all this class does is throw an exception.

Definition at line 1235 of file tria.h.

Member Enumeration Documentation

◆ Settings

template<int spacedim>
enum parallel::distributed::Triangulation< 1, spacedim >::Settings

dummy settings

Definition at line 1242 of file tria.h.

Constructor & Destructor Documentation

◆ Triangulation()

template<int spacedim>
parallel::Triangulation< 1, spacedim >::Triangulation ( MPI_Comm  mpi_communicator,
const typename ::Triangulation< 1, spacedim >::MeshSmoothing  smooth_grid = (::Triangulation<1, spacedim>::none),
const Settings  settings = default_setting 
)

Constructor. The argument denotes the MPI communicator to be used for the triangulation.

Definition at line 4967 of file tria.cc.

◆ ~Triangulation()

template<int spacedim>
parallel::Triangulation< 1, spacedim >::~Triangulation ( )
overridevirtual

Destructor.

Reimplemented from parallel::Triangulation< 1, spacedim >.

Definition at line 4981 of file tria.cc.

Member Function Documentation

◆ get_p4est_tree_to_coarse_cell_permutation()

template<int spacedim>
const std::vector< types::global_dof_index > & parallel::Triangulation< 1, spacedim >::get_p4est_tree_to_coarse_cell_permutation ( ) const

Return a permutation vector for the order the coarse cells are handed of to p4est. For example the first element i in this vector denotes that the first cell in hierarchical ordering is the ith deal cell starting from begin(0).

Definition at line 5030 of file tria.cc.

◆ communicate_locally_moved_vertices()

template<int spacedim>
void parallel::Triangulation< 1, spacedim >::communicate_locally_moved_vertices ( const std::vector< bool > &  vertex_locally_moved)

When vertices have been moved locally, for example using code like

cell->vertex(0) = new_location;

then this function can be used to update the location of vertices between MPI processes.

All the vertices that have been moved and might be in the ghost layer of a process have to be reported in the vertex_locally_moved argument. This ensures that that part of the information that has to be send between processes is actually sent. Additionally, it is quite important that vertices on the boundary between processes are reported on exactly one process (e.g. the one with the highest id). Otherwise we could expect undesirable results if multiple processes move a vertex differently. A typical strategy is to let processor \(i\) move those vertices that are adjacent to cells whose owners include processor \(i\) but no other processor \(j\) with \(j<i\); in other words, for vertices at the boundary of a subdomain, the processor with the lowest subdomain id "owns" a vertex.

Note
It only makes sense to move vertices that are either located on locally owned cells or on cells in the ghost layer. This is because you can be sure that these vertices indeed exist on the finest mesh aggregated over all processors, whereas vertices on artificial cells but not at least in the ghost layer may or may not exist on the globally finest mesh. Consequently, the vertex_locally_moved argument may not contain vertices that aren't at least on ghost cells.
See also
This function is used, for example, in GridTools::distort_random().

Definition at line 4990 of file tria.cc.

◆ load()

template<int spacedim>
void parallel::Triangulation< 1, spacedim >::load ( const std::string &  filename,
const bool  autopartition = true 
)

This function is not implemented, but needs to be present for the compiler.

Definition at line 5074 of file tria.cc.

◆ save()

template<int spacedim>
void parallel::Triangulation< 1, spacedim >::save ( const std::string &  filename) const

This function is not implemented, but needs to be present for the compiler.

Definition at line 5083 of file tria.cc.

◆ register_data_attach()

template<int spacedim>
unsigned int parallel::Triangulation< 1, spacedim >::register_data_attach ( const std::function< std::vector< char >(const typename ::Triangulation< 1, spacedim >::cell_iterator &, const typename ::Triangulation< 1, spacedim >::CellStatus)> &  pack_callback,
const bool  returns_variable_size_data 
)

This function is not implemented, but needs to be present for the compiler.

Definition at line 5000 of file tria.cc.

◆ notify_ready_to_unpack()

template<int spacedim>
void parallel::Triangulation< 1, spacedim >::notify_ready_to_unpack ( const unsigned int  handle,
const std::function< void(const typename ::Triangulation< 1, spacedim >::cell_iterator &, const typename ::Triangulation< 1, spacedim >::CellStatus, const boost::iterator_range< std::vector< char >::const_iterator > &)> &  unpack_callback 
)

This function is not implemented, but needs to be present for the compiler.

Definition at line 5015 of file tria.cc.

◆ compute_vertices_with_ghost_neighbors()

template<int spacedim>
std::map< unsigned int, std::set<::types::subdomain_id > > parallel::Triangulation< 1, spacedim >::compute_vertices_with_ghost_neighbors ( ) const
overridevirtual

Like above, this method, which is only implemented for dim = 2 or 3, needs a stub because it is used in dof_handler_policy.cc

Reimplemented from parallel::Triangulation< 1, spacedim >.

Definition at line 5041 of file tria.cc.

◆ compute_level_vertices_with_ghost_neighbors()

template<int spacedim>
std::map< unsigned int, std::set<::types::subdomain_id > > parallel::Triangulation< 1, spacedim >::compute_level_vertices_with_ghost_neighbors ( const unsigned int  level) const
virtual

Like above, this method, which is only implemented for dim = 2 or 3, needs a stub because it is used in dof_handler_policy.cc

Definition at line 5051 of file tria.cc.

◆ mark_locally_active_vertices_on_level()

template<int spacedim>
std::vector< bool > parallel::Triangulation< 1, spacedim >::mark_locally_active_vertices_on_level ( const unsigned int  level) const
virtual

Like above, this method, which is only implemented for dim = 2 or 3, needs a stub because it is used in dof_handler_policy.cc

Definition at line 5063 of file tria.cc.

Member Data Documentation

◆ coarse_cell_to_p4est_tree_permutation

template<int spacedim>
std::vector<types::global_dof_index> parallel::distributed::Triangulation< 1, spacedim >::coarse_cell_to_p4est_tree_permutation

Dummy arrays. This class isn't usable but the compiler wants to see these variables at a couple places anyway.

Definition at line 1354 of file tria.h.

◆ settings

template<int spacedim>
Settings parallel::distributed::Triangulation< 1, spacedim >::settings

dummy settings object

Definition at line 1364 of file tria.h.


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