|
Reference documentation for deal.II version 9.2.0
|
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\)
\(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\)
\(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\)
\(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Go to the documentation of this file.
31 #include <boost/serialization/map.hpp>
32 #include <boost/serialization/split_member.hpp>
33 #include <boost/serialization/unique_ptr.hpp>
34 #include <boost/serialization/vector.hpp>
35 #include <boost/signals2.hpp>
50 template <
int dim,
int spacedim>
66 template <
typename CellIterator>
67 struct PeriodicFacePair;
70 template <
int,
int,
int>
72 template <
int spacedim>
74 template <
int,
int,
int>
79 namespace TriangulationImplementation
94 struct Implementation;
97 namespace TriaAccessorImplementation
99 struct Implementation;
105 template <
int dim,
int spacedim>
120 namespace TriangulationImplementation
196 template <
class Archive>
198 serialize(Archive &ar,
const unsigned int version);
255 template <
class Archive>
257 serialize(Archive &ar,
const unsigned int version);
315 template <
class Archive>
317 serialize(Archive &ar,
const unsigned int version);
1108 template <
int dim,
int spacedim = dim>
1517 std::list<typename Triangulation<dim, spacedim>::cell_iterator>
1721 virtual std::vector<types::boundary_id>
1736 virtual std::vector<types::manifold_id>
1830 &construction_data);
1995 template <
typename T>
2000 template <
typename InputIterator>
2068 boost::signals2::signal<void(
2078 boost::signals2::signal<void(
2088 boost::signals2::signal<void(
2659 end(
const unsigned int level)
const;
3045 virtual unsigned int
3078 const std::vector<Point<spacedim>> &
3098 const std::vector<bool> &
3262 template <
class Archive>
3264 save(Archive &ar,
const unsigned int version)
const;
3281 template <
class Archive>
3283 load(Archive &ar,
const unsigned int version);
3309 std::pair<cell_iterator, unsigned int>,
3310 std::pair<std::pair<cell_iterator, unsigned int>, std::bitset<3>>> &
3318 template <
class Archive>
3320 serialize(Archive &archive,
const unsigned int version);
3324 BOOST_SERIALIZATION_SPLIT_MEMBER()
3340 <<
"You are requesting information from refinement level "
3342 <<
" of a triangulation, but this triangulation only has "
3343 << arg2 <<
" refinement levels. The given level " << arg1
3344 <<
" must be *less* than " << arg2 <<
".");
3355 <<
"You are trying to perform an operation on a triangulation "
3356 <<
"that is only allowed if the triangulation is currently empty. "
3357 <<
"However, it currently stores " << arg1 <<
" vertices and has "
3358 <<
"cells on " << arg2 <<
" levels.");
3377 <<
"You tried to do something on level " << arg1
3378 <<
", but this level is empty.");
3395 <<
"The given boundary_id " << arg1
3396 <<
" is not defined in this Triangulation!");
3405 "A cell is flagged for coarsening, but either not all of its siblings "
3406 "are active or flagged for coarsening as well. Please clean up all "
3407 "coarsen flags on your triangulation via "
3408 "Triangulation::prepare_coarsening_and_refinement() beforehand!");
3436 const std::vector<bool> &v,
3437 const unsigned int magic_number2,
3438 std::ostream & out);
3446 std::vector<bool> &v,
3447 const unsigned int magic_number2,
3465 std::vector<GridTools::PeriodicFacePair<cell_iterator>>
3472 std::map<std::pair<cell_iterator, unsigned int>,
3473 std::pair<std::pair<cell_iterator, unsigned int>, std::bitset<3>>>
3807 virtual unsigned int
3826 const unsigned int coarse_cell_index)
const;
3832 std::vector<std::unique_ptr<
3841 std::unique_ptr<::internal::TriangulationImplementation::TriaFaces<dim>>
3859 std::map<types::manifold_id, std::unique_ptr<const Manifold<dim, spacedim>>>
3899 std::unique_ptr<std::map<unsigned int, types::boundary_id>>
3922 std::unique_ptr<std::map<unsigned int, types::manifold_id>>
3926 template <
int,
int,
int>
3928 template <
int,
int,
int>
3934 friend struct ::internal::TriaAccessorImplementation::Implementation;
3938 friend struct ::internal::TriangulationImplementation::Implementation;
3941 friend class ::internal::TriangulationImplementation::TriaObjects;
3947 #ifndef DEAL_II_MSVC
3948 static_assert(dim <= spacedim,
3949 "The dimension <dim> of a Triangulation must be less than or "
3950 "equal to the space dimension <spacedim> in which it lives.");
3961 namespace TriangulationImplementation
3963 template <
class Archive>
3968 ar &n_lines &n_lines_level;
3969 ar &n_active_lines &n_active_lines_level;
3973 template <
class Archive>
3979 ar &n_quads &n_quads_level;
3980 ar &n_active_quads &n_active_quads_level;
3984 template <
class Archive>
3990 ar &n_hexes &n_hexes_level;
3991 ar &n_active_hexes &n_active_hexes_level;
3998 template <
int dim,
int spacedim>
4003 return vertices_used[index];
4008 template <
int dim,
int spacedim>
4012 return number_cache.n_levels;
4015 template <
int dim,
int spacedim>
4019 return number_cache.n_levels;
4023 template <
int dim,
int spacedim>
4032 template <
int dim,
int spacedim>
4033 inline const std::vector<Point<spacedim>> &
4040 template <
int dim,
int spacedim>
4041 template <
class Archive>
4049 unsigned int n_levels = levels.size();
4051 for (
unsigned int i = 0; i < levels.size(); ++i)
4057 bool faces_is_nullptr = (faces.get() ==
nullptr);
4058 ar & faces_is_nullptr;
4059 if (!faces_is_nullptr)
4065 ar &anisotropic_refinement;
4068 ar &check_for_distorted_cells;
4072 ar &vertex_to_boundary_id_map_1d;
4073 ar &vertex_to_manifold_id_map_1d;
4079 template <
int dim,
int spacedim>
4080 template <
class Archive>
4093 levels.resize(size);
4094 for (
unsigned int i = 0; i < levels.size(); ++i)
4096 std::unique_ptr<internal::TriangulationImplementation::TriaLevel<dim>>
4099 levels[i] = std::move(
level);
4103 bool faces_is_nullptr =
true;
4104 ar & faces_is_nullptr;
4105 if (!faces_is_nullptr)
4111 ar &anisotropic_refinement;
4118 for (
unsigned int l = 0;
l < levels.size(); ++
l)
4119 levels[
l]->active_cell_indices.resize(levels[
l]->refine_flags.size());
4120 reset_active_cell_indices();
4124 bool my_check_for_distorted_cells;
4125 ar & my_check_for_distorted_cells;
4127 Assert(my_check_for_distorted_cells == check_for_distorted_cells,
4128 ExcMessage(
"The triangulation loaded into here must have the "
4129 "same setting with regard to reporting distorted "
4130 "cell as the one previously stored."));
4134 ar &vertex_to_boundary_id_map_1d;
4135 ar &vertex_to_manifold_id_map_1d;
4146 template <
int dim,
int spacedim>
4156 template <
int dim,
int spacedim>
4159 const unsigned int coarse_cell_index)
const
4161 return coarse_cell_index;
unsigned int n_raw_lines() const
std::vector< unsigned int > n_active_hexes_level
#define DeclExceptionMsg(Exception, defaulttext)
void clear_user_flags_quad()
void save_user_flags(std::ostream &out) const
boost::signals2::signal< void()> any_change
unsigned int n_faces() const
static void write_bool_vector(const unsigned int magic_number1, const std::vector< bool > &v, const unsigned int magic_number2, std::ostream &out)
std::vector< unsigned int > n_active_quads_level
virtual types::coarse_cell_id coarse_cell_index_to_coarse_cell_id(const unsigned int coarse_cell_index) const
@ allow_anisotropic_smoothing
unsigned int n_active_quads() const
void save_coarsen_flags(std::ostream &out) const
boost::signals2::signal< void()> pre_distributed_load
void load_user_pointers_hex(const std::vector< void * > &v)
static ::ExceptionBase & ExcEmptyLevel(int arg1)
boost::signals2::signal< void(const Triangulation< dim, spacedim > &destination_tria)> copy
raw_hex_iterator begin_raw_hex(const unsigned int level=0) const
active_cell_iterator end_active(const unsigned int level) const
void clear_despite_subscriptions()
unsigned int n_lines() const
boost::signals2::signal< void(const typename Triangulation< dim, spacedim >::cell_iterator &cell)> pre_coarsening_on_cell
bool vertex_used(const unsigned int index) const
void load(Archive &ar, const unsigned int version)
const std::vector< Point< spacedim > > & get_vertices() const
void load_user_indices_quad(const std::vector< unsigned int > &v)
void set_all_refine_flags()
void load_user_flags(std::istream &in)
typename IteratorSelector::raw_hex_iterator raw_hex_iterator
Triangulation< dim, spacedim > & get_triangulation()
void save_user_flags_hex(std::ostream &out) const
@ eliminate_refined_boundary_islands
void serialize(Archive &ar, const unsigned int version)
typename IteratorSelector::raw_quad_iterator raw_quad_iterator
virtual types::global_cell_index n_global_active_cells() const
line_iterator end_line() const
void refine_global(const unsigned int times=1)
void save_user_indices_quad(std::vector< unsigned int > &v) const
static const unsigned int space_dimension
boost::signals2::signal< void()> post_distributed_load
virtual unsigned int coarse_cell_id_to_coarse_cell_index(const types::coarse_cell_id coarse_cell_id) const
boost::signals2::signal< void()> clear
static ::ExceptionBase & ExcInconsistentCoarseningFlags()
static ::ExceptionBase & ExcFacesHaveNoLevel()
#define AssertIndexRange(index, range)
DistortedCellList execute_refinement()
boost::signals2::signal< void()> post_distributed_save
std::vector< unsigned int > n_lines_level
boost::signals2::signal< void(const typename Triangulation< dim, spacedim >::cell_iterator &cell)> post_refinement_on_cell
std::list< typename Triangulation< dim, spacedim >::cell_iterator > distorted_cells
IteratorRange< active_cell_iterator > active_cell_iterators_on_level(const unsigned int level) const
std::unique_ptr< std::map< unsigned int, types::boundary_id > > vertex_to_boundary_id_map_1d
unsigned int n_active_hexs() const
const bool check_for_distorted_cells
void serialize(Archive &archive, const unsigned int version)
@ smoothing_on_coarsening
bool get_anisotropic_refinement_flag() const
boost::signals2::signal< void()> mesh_movement
void load_user_flags_line(std::istream &in)
void save_user_pointers_line(std::vector< void * > &v) const
boost::signals2::signal< void()> post_distributed_refinement
void load_user_flags_quad(std::istream &in)
unsigned int n_raw_quads() const
unsigned int n_raw_faces() const
typename IteratorSelector::raw_line_iterator raw_line_iterator
unsigned int n_raw_hexs(const unsigned int level) const
void save_user_indices(std::vector< unsigned int > &v) const
virtual unsigned int n_global_levels() const
typename IteratorSelector::active_line_iterator active_line_iterator
virtual ~Triangulation() override
virtual std::vector< types::boundary_id > get_boundary_ids() const
boost::signals2::signal< void()> post_distributed_repartition
void update_periodic_face_map()
virtual const MeshSmoothing & get_mesh_smoothing() const
hex_iterator end_hex() const
quad_iterator begin_quad(const unsigned int level=0) const
virtual std::size_t memory_consumption() const
void serialize(Archive &ar, const unsigned int version)
void load_user_pointers_line(const std::vector< void * > &v)
void set_manifold(const types::manifold_id number, const Manifold< dim, spacedim > &manifold_object)
static ::ExceptionBase & ExcTriangulationNotEmpty(int arg1, int arg2)
face_iterator begin_face() const
@ smoothing_on_refinement
typename IteratorSelector::hex_iterator hex_iterator
std::map< types::manifold_id, std::unique_ptr< const Manifold< dim, spacedim > > > manifold
unsigned int n_vertices() const
void save_user_pointers_hex(std::vector< void * > &v) const
void reset_active_cell_indices()
IteratorRange< cell_iterator > cell_iterators() const
virtual void execute_coarsening_and_refinement()
boost::signals2::signal< void()> pre_distributed_repartition
static void read_bool_vector(const unsigned int magic_number1, std::vector< bool > &v, const unsigned int magic_number2, std::istream &in)
void save_user_indices_line(std::vector< unsigned int > &v) const
virtual void create_triangulation(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata)
boost::signals2::signal< void()> pre_distributed_save
typename IteratorSelector::quad_iterator quad_iterator
void flip_all_direction_flags()
face_iterator end_face() const
unsigned int n_raw_cells(const unsigned int level) const
void save_user_flags_line(std::ostream &out) const
Triangulation(const MeshSmoothing smooth_grid=none, const bool check_for_distorted_cells=false)
static ::ExceptionBase & ExcMessage(std::string arg1)
static const unsigned int dimension
active_cell_iterator begin_active(const unsigned int level=0) const
void load_user_pointers(const std::vector< void * > &v)
unsigned int n_used_vertices() const
void execute_coarsening()
virtual ~DistortedCellList() noexcept override=default
static ::ExceptionBase & ExcInvalidLevel(int arg1, int arg2)
#define DEAL_II_NAMESPACE_OPEN
void set_all_manifold_ids(const types::manifold_id number)
@ eliminate_refined_inner_islands
void reset_all_manifolds()
static ::ExceptionBase & ExcGridReadError()
unsigned int n_active_faces() const
unsigned int n_active_hexes
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int n_quads() const
void load_user_indices(const std::vector< unsigned int > &v)
raw_quad_iterator begin_raw_quad(const unsigned int level=0) const
void save_user_indices_hex(std::vector< unsigned int > &v) const
raw_line_iterator begin_raw_line(const unsigned int level=0) const
bool anisotropic_refinement
#define DeclException1(Exception1, type1, outsequence)
virtual void add_periodicity(const std::vector< GridTools::PeriodicFacePair< cell_iterator >> &)
@ limit_level_difference_at_vertices
quad_iterator end_quad() const
IteratorRange< active_face_iterator > active_face_iterators() const
unsigned int n_active_lines
virtual void set_mesh_smoothing(const MeshSmoothing mesh_smoothing)
void save_user_flags_quad(std::ostream &out) const
virtual void copy_triangulation(const Triangulation< dim, spacedim > &other_tria)
active_face_iterator begin_active_face() const
raw_cell_iterator end_raw(const unsigned int level) const
::internal::TriangulationImplementation::NumberCache< dim > number_cache
void load_user_indices_hex(const std::vector< unsigned int > &v)
void save_user_pointers(std::vector< void * > &v) const
hex_iterator begin_hex(const unsigned int level=0) const
vertex_iterator end_vertex() const
boost::signals2::signal< void()> pre_refinement
void reset_manifold(const types::manifold_id manifold_number)
global_cell_index coarse_cell_id
std::vector< unsigned int > n_active_lines_level
std::vector< unsigned int > n_hexes_level
#define Assert(cond, exc)
active_cell_iterator last_active() const
boost::signals2::signal< void()> pre_distributed_refinement
cell_iterator last() const
boost::signals2::signal< unsigned int(const cell_iterator &, const CellStatus), CellWeightSum< unsigned int > > cell_weight
boost::signals2::signal< void()> create
typename IteratorSelector::active_quad_iterator active_quad_iterator
static ::ExceptionBase & ExcBoundaryIdNotFound(types::boundary_id arg1)
std::vector< bool > vertices_used
vertex_iterator begin_vertex() const
#define DeclException0(Exception0)
T operator()(InputIterator first, InputIterator last) const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
boost::signals2::signal< void()> post_refinement
static ::ExceptionBase & ExcNonOrientableTriangulation()
std::vector< GridTools::PeriodicFacePair< cell_iterator > > periodic_face_pairs_level_0
unsigned int n_active_lines() const
virtual bool prepare_coarsening_and_refinement()
void serialize(Archive &ar, const unsigned int version)
virtual types::subdomain_id locally_owned_subdomain() const
std::vector< Point< spacedim > > vertices
unsigned int n_active_cells() const
active_quad_iterator begin_active_quad(const unsigned int level=0) const
void load_coarsen_flags(std::istream &out)
std::unique_ptr<::internal::TriangulationImplementation::TriaFaces< dim > > faces
void load_user_indices_line(const std::vector< unsigned int > &v)
line_iterator begin_line(const unsigned int level=0) const
active_line_iterator begin_active_line(const unsigned int level=0) const
unsigned int n_hexs() const
cell_iterator begin(const unsigned int level=0) const
void load_user_pointers_quad(const std::vector< void * > &v)
IteratorRange< active_cell_iterator > active_cell_iterators() const
void save_user_pointers_quad(std::vector< void * > &v) const
std::unique_ptr< std::map< unsigned int, types::manifold_id > > vertex_to_manifold_id_map_1d
virtual void create_triangulation_compatibility(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata)
unsigned int n_active_quads
#define DEAL_II_NAMESPACE_CLOSE
typename IteratorSelector::active_hex_iterator active_hex_iterator
active_hex_iterator begin_active_hex(const unsigned int level=0) const
void set_all_manifold_ids_on_boundary(const types::manifold_id number)
Triangulation & operator=(Triangulation< dim, spacedim > &&tria) noexcept
unsigned int n_cells() const
active_vertex_iterator begin_active_vertex() const
void clear_user_flags_hex()
void save_refine_flags(std::ostream &out) const
void clear_user_flags_line()
const std::vector< bool > & get_used_vertices() const
virtual bool has_hanging_nodes() const
raw_cell_iterator begin_raw(const unsigned int level=0) const
std::map< std::pair< cell_iterator, unsigned int >, std::pair< std::pair< cell_iterator, unsigned int >, std::bitset< 3 > > > periodic_face_map
#define DeclException2(Exception2, type1, type2, outsequence)
typename IteratorSelector::line_iterator line_iterator
std::vector< unsigned int > n_quads_level
@ do_not_produce_unrefined_islands
unsigned int n_levels() const
unsigned int max_adjacent_cells() const
boost::signals2::signal< void()> pre_partition
void save(Archive &ar, const unsigned int version) const
void load_refine_flags(std::istream &in)
MeshSmoothing smooth_grid
@ eliminate_unrefined_islands
const Manifold< dim, spacedim > & get_manifold(const types::manifold_id number) const
virtual std::vector< types::manifold_id > get_manifold_ids() const
cell_iterator end() const
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
std::vector< std::unique_ptr< ::internal::TriangulationImplementation::TriaLevel< dim > > > levels
void load_user_flags_hex(std::istream &in)