Reference documentation for deal.II version GIT 7b2de2f2f9 2023-09-24 11:00:02+00:00
\(\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\}}\)
tria.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2023 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_tria_h
17 #define dealii_tria_h
18 
19 
20 #include <deal.II/base/config.h>
21 
25 #include <deal.II/base/point.h>
28 
29 #include <deal.II/grid/cell_id.h>
34 
35 #include <boost/serialization/map.hpp>
36 #include <boost/serialization/split_member.hpp>
37 #include <boost/serialization/unique_ptr.hpp>
38 #include <boost/serialization/vector.hpp>
39 #include <boost/signals2.hpp>
40 
41 #include <bitset>
42 #include <functional>
43 #include <list>
44 #include <map>
45 #include <memory>
46 #include <numeric>
47 #include <vector>
48 
49 
51 
52 #ifdef signals
53 # error \
54  "The name 'signals' is already defined. You are most likely using the QT library \
55 and using the 'signals' keyword. You can either #include the Qt headers (or any conflicting headers) \
56 *after* the deal.II headers or you can define the 'QT_NO_KEYWORDS' macro and use the 'Q_SIGNALS' macro."
57 #endif
58 
59 // Forward declarations
60 #ifndef DOXYGEN
61 template <int dim, int spacedim>
62 class Manifold;
63 
64 template <int dim>
65 struct CellData;
66 
67 struct SubCellData;
68 
70 {
71  template <int, int>
72  struct Description;
73 }
74 
75 namespace GridTools
76 {
77  template <typename CellIterator>
78  struct PeriodicFacePair;
79 }
80 
81 template <int, int, int>
82 class TriaAccessor;
83 template <int spacedim>
84 class TriaAccessor<0, 1, spacedim>;
85 template <int, int, int>
86 class TriaAccessorBase;
87 
88 namespace internal
89 {
90  namespace TriangulationImplementation
91  {
92  class TriaFaces;
93 
94  class TriaObjects;
95 
96  template <int, int>
97  class Policy;
98 
104  struct Implementation;
105  struct ImplementationMixedMesh;
106  } // namespace TriangulationImplementation
107 
108  namespace TriaAccessorImplementation
109  {
110  struct Implementation;
111  }
112 } // namespace internal
113 #endif
114 
115 
116 /*------------------------------------------------------------------------*/
117 
118 
119 namespace internal
120 {
125  namespace TriangulationImplementation
126  {
138  template <int dim>
139  struct NumberCache
140  {};
141 
153  template <>
154  struct NumberCache<1>
155  {
159  unsigned int n_levels;
160 
164  unsigned int n_lines;
165 
169  std::vector<unsigned int> n_lines_level;
170 
174  unsigned int n_active_lines;
175 
179  std::vector<unsigned int> n_active_lines_level;
180 
184  std::shared_ptr<const Utilities::MPI::Partitioner>
186 
190  std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
192 
196  NumberCache();
197 
202  std::size_t
203  memory_consumption() const;
204 
210  template <class Archive>
211  void
212  serialize(Archive &ar, const unsigned int version);
213  };
214 
215 
228  template <>
229  struct NumberCache<2> : public NumberCache<1>
230  {
234  unsigned int n_quads;
235 
239  std::vector<unsigned int> n_quads_level;
240 
244  unsigned int n_active_quads;
245 
249  std::vector<unsigned int> n_active_quads_level;
250 
254  NumberCache();
255 
260  std::size_t
261  memory_consumption() const;
262 
268  template <class Archive>
269  void
270  serialize(Archive &ar, const unsigned int version);
271  };
272 
273 
287  template <>
288  struct NumberCache<3> : public NumberCache<2>
289  {
293  unsigned int n_hexes;
294 
298  std::vector<unsigned int> n_hexes_level;
299 
303  unsigned int n_active_hexes;
304 
308  std::vector<unsigned int> n_active_hexes_level;
309 
313  NumberCache();
314 
319  std::size_t
320  memory_consumption() const;
321 
327  template <class Archive>
328  void
329  serialize(Archive &ar, const unsigned int version);
330  };
331  } // namespace TriangulationImplementation
332 
333 
337  template <int dim, int spacedim = dim>
338  DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
340  {
342 
347  unsigned int n_attached_data_sets;
348 
354 
356  std::function<std::vector<char>(cell_iterator, CellStatus)>;
357 
362  std::vector<pack_callback_t> pack_callbacks_fixed;
363  std::vector<pack_callback_t> pack_callbacks_variable;
364  };
365 
376  template <int dim, int spacedim = dim>
377  DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
379  {
380  public:
382 
388  using cell_relation_t = typename std::pair<cell_iterator, CellStatus>;
389 
391 
400  void
401  pack_data(
402  const std::vector<cell_relation_t> &cell_relations,
403  const std::vector<
405  &pack_callbacks_fixed,
406  const std::vector<
408  &pack_callbacks_variable,
409  const MPI_Comm &mpi_communicator);
410 
418  void
419  unpack_cell_status(std::vector<cell_relation_t> &cell_relations) const;
420 
433  void
434  unpack_data(
435  const std::vector<cell_relation_t> &cell_relations,
436  const unsigned int handle,
437  const std::function<
438  void(const cell_iterator &,
439  const CellStatus &,
440  const boost::iterator_range<std::vector<char>::const_iterator> &)>
441  &unpack_callback) const;
442 
457  void
458  save(const unsigned int global_first_cell,
459  const unsigned int global_num_cells,
460  const std::string &filename,
461  const MPI_Comm &mpi_communicator) const;
462 
481  void
482  load(const unsigned int global_first_cell,
483  const unsigned int global_num_cells,
484  const unsigned int local_num_cells,
485  const std::string &filename,
486  const unsigned int n_attached_deserialize_fixed,
487  const unsigned int n_attached_deserialize_variable,
488  const MPI_Comm &mpi_communicator);
489 
496  void
497  clear();
498 
503 
514  std::vector<unsigned int> sizes_fixed_cumulative;
515 
520  std::vector<char> src_data_fixed;
521  std::vector<char> dest_data_fixed;
522 
527  std::vector<int> src_sizes_variable;
528  std::vector<int> dest_sizes_variable;
529  std::vector<char> src_data_variable;
530  std::vector<char> dest_data_variable;
531  };
532 } // namespace internal
533 
534 
535 /*------------------------------------------------------------------------*/
536 
537 
1335 template <int dim, int spacedim = dim>
1336 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1338 {
1339 private:
1346 
1347 public:
1353  {
1358  none = 0x0,
1402  limit_level_difference_at_vertices = 0x1,
1423  eliminate_unrefined_islands = 0x2,
1439  patch_level_1 = 0x4,
1463  coarsest_level_1 = 0x8,
1488  allow_anisotropic_smoothing = 0x10,
1521  eliminate_refined_inner_islands = 0x100,
1526  eliminate_refined_boundary_islands = 0x200,
1532  do_not_produce_unrefined_islands = 0x400,
1533 
1538  smoothing_on_refinement =
1539  (limit_level_difference_at_vertices | eliminate_unrefined_islands),
1544  smoothing_on_coarsening =
1545  (eliminate_refined_inner_islands | eliminate_refined_boundary_islands |
1546  do_not_produce_unrefined_islands),
1547 
1553  maximum_smoothing = 0xffff ^ allow_anisotropic_smoothing
1554  };
1555 
1572 
1578 
1596 
1610  using face_iterator = TriaIterator<TriaAccessor<dim - 1, dim, spacedim>>;
1611 
1624  TriaActiveIterator<TriaAccessor<dim - 1, dim, spacedim>>;
1625 
1635 
1650 
1658  using line_iterator = typename IteratorSelector::line_iterator;
1659 
1673  using active_line_iterator = typename IteratorSelector::active_line_iterator;
1674 
1682  using quad_iterator = typename IteratorSelector::quad_iterator;
1683 
1697  using active_quad_iterator = typename IteratorSelector::active_quad_iterator;
1698 
1706  using hex_iterator = typename IteratorSelector::hex_iterator;
1707 
1717  using active_hex_iterator = typename IteratorSelector::active_hex_iterator;
1718 
1738  {
1745  virtual ~DistortedCellList() noexcept override;
1746 
1751  std::list<typename Triangulation<dim, spacedim>::cell_iterator>
1752  distorted_cells;
1753  };
1754 
1758  static constexpr unsigned int dimension = dim;
1759 
1763  static constexpr unsigned int space_dimension = spacedim;
1764 
1779  Triangulation(const MeshSmoothing smooth_grid = none,
1780  const bool check_for_distorted_cells = false);
1781 
1797  Triangulation(const Triangulation<dim, spacedim> &) = delete;
1798 
1805  Triangulation(Triangulation<dim, spacedim> &&tria) noexcept;
1806 
1810  Triangulation &
1811  operator=(Triangulation<dim, spacedim> &&tria) noexcept;
1812 
1816  virtual ~Triangulation() override;
1817 
1824  virtual void
1825  clear();
1826 
1831  virtual MPI_Comm
1832  get_communicator() const;
1833 
1839  virtual std::weak_ptr<const Utilities::MPI::Partitioner>
1840  global_active_cell_index_partitioner() const;
1841 
1847  virtual std::weak_ptr<const Utilities::MPI::Partitioner>
1848  global_level_cell_index_partitioner(const unsigned int level) const;
1849 
1854  virtual void
1855  set_mesh_smoothing(const MeshSmoothing mesh_smoothing);
1856 
1860  virtual const MeshSmoothing &
1861  get_mesh_smoothing() const;
1862 
1885  void
1886  set_manifold(const types::manifold_id number,
1887  const Manifold<dim, spacedim> &manifold_object);
1888 
1901  void
1902  reset_manifold(const types::manifold_id manifold_number);
1903 
1915  void
1916  reset_all_manifolds();
1917 
1926  void
1927  set_all_manifold_ids(const types::manifold_id number);
1928 
1937  void
1938  set_all_manifold_ids_on_boundary(const types::manifold_id number);
1939 
1949  void
1950  set_all_manifold_ids_on_boundary(const types::boundary_id b_id,
1951  const types::manifold_id number);
1952 
1964  const Manifold<dim, spacedim> &
1965  get_manifold(const types::manifold_id number) const;
1966 
1979  virtual std::vector<types::boundary_id>
1980  get_boundary_ids() const;
1981 
1994  virtual std::vector<types::manifold_id>
1995  get_manifold_ids() const;
1996 
2023  virtual void
2024  copy_triangulation(const Triangulation<dim, spacedim> &other_tria);
2025 
2074  virtual void
2075  create_triangulation(const std::vector<Point<spacedim>> &vertices,
2076  const std::vector<CellData<dim>> &cells,
2077  const SubCellData &subcelldata);
2078 
2091  virtual void
2093  const TriangulationDescription::Description<dim, spacedim>
2094  &construction_data);
2095 
2102  void
2103  flip_all_direction_flags();
2104 
2116  void
2117  set_all_refine_flags();
2118 
2141  void
2142  refine_global(const unsigned int times = 1);
2143 
2156  void
2157  coarsen_global(const unsigned int times = 1);
2158 
2190  virtual void
2191  execute_coarsening_and_refinement();
2192 
2222  virtual bool
2223  prepare_coarsening_and_refinement();
2224 
2239  using CellStatus DEAL_II_DEPRECATED_EARLY = ::CellStatus;
2240 
2245  static constexpr auto CELL_PERSIST DEAL_II_DEPRECATED_EARLY =
2247 
2252  static constexpr auto CELL_REFINE DEAL_II_DEPRECATED_EARLY =
2254 
2259  static constexpr auto CELL_COARSEN DEAL_II_DEPRECATED_EARLY =
2261 
2266  static constexpr auto CELL_INVALID DEAL_II_DEPRECATED_EARLY =
2268 
2269 
2275  template <typename T>
2277  {
2278  using result_type = T;
2279 
2280  template <typename InputIterator>
2281  T
2282  operator()(InputIterator first, InputIterator last) const
2283  {
2284  return std::accumulate(first, last, T());
2285  }
2286  };
2287 
2297  struct Signals
2298  {
2306  boost::signals2::signal<void()> create;
2307 
2315  boost::signals2::signal<void()> pre_refinement;
2316 
2322  boost::signals2::signal<void()> post_refinement;
2323 
2330  boost::signals2::signal<void()> pre_partition;
2331 
2339  boost::signals2::signal<void()> mesh_movement;
2340 
2348  boost::signals2::signal<void(
2349  const typename Triangulation<dim, spacedim>::cell_iterator &cell)>
2351 
2358  boost::signals2::signal<void(
2359  const typename Triangulation<dim, spacedim>::cell_iterator &cell)>
2361 
2368  boost::signals2::signal<void(
2369  const Triangulation<dim, spacedim> &destination_tria)>
2371 
2385  boost::signals2::signal<void()> clear;
2386 
2396  boost::signals2::signal<void()> any_change;
2397 
2434  boost::signals2::signal<unsigned int(const cell_iterator &,
2438 
2450  boost::signals2::signal<void()> pre_distributed_refinement;
2451 
2459  boost::signals2::signal<void()> post_p4est_refinement;
2460 
2469  boost::signals2::signal<void()> post_distributed_refinement;
2470 
2476  boost::signals2::signal<void()> pre_distributed_repartition;
2477 
2483  boost::signals2::signal<void()> post_distributed_repartition;
2484 
2491  boost::signals2::signal<void()> pre_distributed_save;
2492 
2498  boost::signals2::signal<void()> post_distributed_save;
2499 
2506  boost::signals2::signal<void()> pre_distributed_load;
2507 
2513  boost::signals2::signal<void()> post_distributed_load;
2514  };
2515 
2524  mutable Signals signals;
2525 
2537  void
2538  save_refine_flags(std::ostream &out) const;
2539 
2543  void
2544  save_refine_flags(std::vector<bool> &v) const;
2545 
2549  void
2550  load_refine_flags(std::istream &in);
2551 
2555  void
2556  load_refine_flags(const std::vector<bool> &v);
2557 
2561  void
2562  save_coarsen_flags(std::ostream &out) const;
2563 
2567  void
2568  save_coarsen_flags(std::vector<bool> &v) const;
2569 
2573  void
2574  load_coarsen_flags(std::istream &out);
2575 
2579  void
2580  load_coarsen_flags(const std::vector<bool> &v);
2581 
2586  bool
2588 
2600  void
2602 
2608  void
2609  save_user_flags(std::ostream &out) const;
2610 
2616  void
2617  save_user_flags(std::vector<bool> &v) const;
2618 
2623  void
2624  load_user_flags(std::istream &in);
2625 
2630  void
2631  load_user_flags(const std::vector<bool> &v);
2632 
2637  void
2639 
2644  void
2645  save_user_flags_line(std::ostream &out) const;
2646 
2652  void
2653  save_user_flags_line(std::vector<bool> &v) const;
2654 
2659  void
2660  load_user_flags_line(std::istream &in);
2661 
2666  void
2667  load_user_flags_line(const std::vector<bool> &v);
2668 
2673  void
2675 
2680  void
2681  save_user_flags_quad(std::ostream &out) const;
2682 
2688  void
2689  save_user_flags_quad(std::vector<bool> &v) const;
2690 
2695  void
2696  load_user_flags_quad(std::istream &in);
2697 
2702  void
2703  load_user_flags_quad(const std::vector<bool> &v);
2704 
2705 
2710  void
2712 
2717  void
2718  save_user_flags_hex(std::ostream &out) const;
2719 
2725  void
2726  save_user_flags_hex(std::vector<bool> &v) const;
2727 
2732  void
2733  load_user_flags_hex(std::istream &in);
2734 
2739  void
2740  load_user_flags_hex(const std::vector<bool> &v);
2741 
2747  void
2749 
2755  void
2756  save_user_indices(std::vector<unsigned int> &v) const;
2757 
2762  void
2763  load_user_indices(const std::vector<unsigned int> &v);
2764 
2770  void
2771  save_user_pointers(std::vector<void *> &v) const;
2772 
2777  void
2778  load_user_pointers(const std::vector<void *> &v);
2779 
2785  void
2786  save_user_indices_line(std::vector<unsigned int> &v) const;
2787 
2792  void
2793  load_user_indices_line(const std::vector<unsigned int> &v);
2794 
2800  void
2801  save_user_indices_quad(std::vector<unsigned int> &v) const;
2802 
2807  void
2808  load_user_indices_quad(const std::vector<unsigned int> &v);
2809 
2815  void
2816  save_user_indices_hex(std::vector<unsigned int> &v) const;
2817 
2822  void
2823  load_user_indices_hex(const std::vector<unsigned int> &v);
2829  void
2830  save_user_pointers_line(std::vector<void *> &v) const;
2831 
2836  void
2837  load_user_pointers_line(const std::vector<void *> &v);
2838 
2844  void
2845  save_user_pointers_quad(std::vector<void *> &v) const;
2846 
2851  void
2852  load_user_pointers_quad(const std::vector<void *> &v);
2853 
2859  void
2860  save_user_pointers_hex(std::vector<void *> &v) const;
2861 
2866  void
2867  load_user_pointers_hex(const std::vector<void *> &v);
2868 
2894  begin(const unsigned int level = 0) const;
2895 
2927  begin_active(const unsigned int level = 0) const;
2928 
2934  end() const;
2935 
2955  end(const unsigned int level) const;
2956 
2977  end_active(const unsigned int level) const;
2978 
2979 
2984  last() const;
2985 
2990  last_active() const;
2991 
3000  create_cell_iterator(const CellId &cell_id) const;
3001 
3012  bool
3013  contains_cell(const CellId &cell_id) const;
3033 
3071 
3088  cell_iterators_on_level(const unsigned int level) const;
3089 
3106  active_cell_iterators_on_level(const unsigned int level) const;
3107 
3110  /*-------------------------------------------------------------------------*/
3111 
3121  begin_face() const;
3122 
3128 
3134  end_face() const;
3135 
3156 
3159  /*-------------------------------------------------------------------------*/
3160 
3171  begin_vertex() const;
3172 
3180 
3187  end_vertex() const;
3188 
3208  unsigned int
3209  n_lines() const;
3210 
3214  unsigned int
3215  n_lines(const unsigned int level) const;
3216 
3220  unsigned int
3222 
3226  unsigned int
3227  n_active_lines(const unsigned int level) const;
3228 
3232  unsigned int
3233  n_quads() const;
3234 
3238  unsigned int
3239  n_quads(const unsigned int level) const;
3240 
3244  unsigned int
3246 
3250  unsigned int
3251  n_active_quads(const unsigned int level) const;
3252 
3256  unsigned int
3257  n_hexs() const;
3258 
3263  unsigned int
3264  n_hexs(const unsigned int level) const;
3265 
3269  unsigned int
3270  n_active_hexs() const;
3271 
3276  unsigned int
3277  n_active_hexs(const unsigned int level) const;
3278 
3283  unsigned int
3284  n_cells() const;
3285 
3290  unsigned int
3291  n_cells(const unsigned int level) const;
3292 
3297  unsigned int
3299 
3307  virtual types::global_cell_index
3309 
3310 
3315  unsigned int
3316  n_active_cells(const unsigned int level) const;
3317 
3322  virtual types::coarse_cell_id
3324 
3330  unsigned int
3331  n_faces() const;
3332 
3338  unsigned int
3340 
3358  unsigned int
3359  n_levels() const;
3360 
3367  virtual unsigned int
3369 
3379  virtual bool
3381 
3389  unsigned int
3390  n_vertices() const;
3391 
3400  const std::vector<Point<spacedim>> &
3401  get_vertices() const;
3402 
3407  unsigned int
3409 
3413  bool
3414  vertex_used(const unsigned int index) const;
3415 
3420  const std::vector<bool> &
3422 
3434  unsigned int
3436 
3443  virtual types::subdomain_id
3445 
3457 
3464 
3465 
3482  unsigned int
3483  n_raw_lines() const;
3484 
3494  unsigned int
3495  n_raw_lines(const unsigned int level) const;
3496 
3506  unsigned int
3507  n_raw_quads() const;
3508 
3518  unsigned int
3519  n_raw_quads(const unsigned int level) const;
3520 
3530  unsigned int
3531  n_raw_hexs(const unsigned int level) const;
3532 
3542  unsigned int
3543  n_raw_cells(const unsigned int level) const;
3544 
3556  unsigned int
3557  n_raw_faces() const;
3558 
3569  virtual std::size_t
3571 
3581  template <class Archive>
3582  void
3583  save(Archive &ar, const unsigned int version) const;
3584 
3602  template <class Archive>
3603  void
3604  load(Archive &ar, const unsigned int version);
3605 
3606 
3613  virtual void
3614  save(const std::string &filename) const;
3615 
3619  virtual void
3620  load(const std::string &filename);
3621 
3622 
3638  virtual void
3640  const std::vector<GridTools::PeriodicFacePair<cell_iterator>> &);
3641 
3645  const std::map<
3646  std::pair<cell_iterator, unsigned int>,
3647  std::pair<std::pair<cell_iterator, unsigned int>, std::bitset<3>>> &
3649 
3654  const std::vector<ReferenceCell> &
3656 
3661  bool
3663 
3668  bool
3670 
3676  bool
3677  is_mixed_mesh() const;
3678 
3679 #ifdef DOXYGEN
3685  template <class Archive>
3686  void
3687  serialize(Archive &archive, const unsigned int version);
3688 #else
3689  // This macro defines the serialize() method that is compatible with
3690  // the templated save() and load() method that have been implemented.
3691  BOOST_SERIALIZATION_SPLIT_MEMBER()
3692 #endif
3693 
3698 public:
3806  unsigned int
3808  const std::function<std::vector<char>(const cell_iterator &,
3810  &pack_callback,
3811  const bool returns_variable_size_data);
3812 
3862  void
3864  const unsigned int handle,
3865  const std::function<
3866  void(const cell_iterator &,
3868  const boost::iterator_range<std::vector<char>::const_iterator> &)>
3869  &unpack_callback);
3870 
3872 
3873 protected:
3880  void
3881  save_attached_data(const unsigned int global_first_cell,
3882  const unsigned int global_num_cells,
3883  const std::string &filename) const;
3884 
3892  void
3893  load_attached_data(const unsigned int global_first_cell,
3894  const unsigned int global_num_cells,
3895  const unsigned int local_num_cells,
3896  const std::string &filename,
3897  const unsigned int n_attached_deserialize_fixed,
3898  const unsigned int n_attached_deserialize_variable);
3899 
3910  virtual void
3912  {}
3913 
3919  std::vector<typename internal::CellAttachedDataSerializer<dim, spacedim>::
3920  cell_relation_t>
3922 
3928 public:
3939  DeclException2(ExcInvalidLevel,
3940  int,
3941  int,
3942  << "You are requesting information from refinement level "
3943  << arg1
3944  << " of a triangulation, but this triangulation only has "
3945  << arg2 << " refinement levels. The given level " << arg1
3946  << " must be *less* than " << arg2 << '.');
3954  ExcTriangulationNotEmpty,
3955  int,
3956  int,
3957  << "You are trying to perform an operation on a triangulation "
3958  << "that is only allowed if the triangulation is currently empty. "
3959  << "However, it currently stores " << arg1 << " vertices and has "
3960  << "cells on " << arg2 << " levels.");
3966  DeclException0(ExcGridReadError);
3977  DeclException1(ExcEmptyLevel,
3978  int,
3979  << "You tried to do something on level " << arg1
3980  << ", but this level is empty.");
3986  DeclException0(ExcNonOrientableTriangulation);
3987 
3995  DeclException1(ExcBoundaryIdNotFound,
3997  << "The given boundary_id " << arg1
3998  << " is not defined in this Triangulation!");
3999 
4006  ExcInconsistentCoarseningFlags,
4007  "A cell is flagged for coarsening, but either not all of its siblings "
4008  "are active or flagged for coarsening as well. Please clean up all "
4009  "coarsen flags on your triangulation via "
4010  "Triangulation::prepare_coarsening_and_refinement() beforehand!");
4011 
4014 protected:
4020 
4025  std::vector<ReferenceCell> reference_cells;
4026 
4040  static void
4041  write_bool_vector(const unsigned int magic_number1,
4042  const std::vector<bool> &v,
4043  const unsigned int magic_number2,
4044  std::ostream &out);
4045 
4050  static void
4051  read_bool_vector(const unsigned int magic_number1,
4052  std::vector<bool> &v,
4053  const unsigned int magic_number2,
4054  std::istream &in);
4055 
4060  void
4062 
4066  virtual void
4068 
4069 
4070 private:
4075  std::unique_ptr<
4078 
4085  std::vector<GridTools::PeriodicFacePair<cell_iterator>>
4087 
4092  std::map<std::pair<cell_iterator, unsigned int>,
4093  std::pair<std::pair<cell_iterator, unsigned int>, std::bitset<3>>>
4095 
4106  TriaRawIterator<TriaAccessor<dim - 1, dim, spacedim>>;
4109  using raw_line_iterator = typename IteratorSelector::raw_line_iterator;
4110  using raw_quad_iterator = typename IteratorSelector::raw_quad_iterator;
4111  using raw_hex_iterator = typename IteratorSelector::raw_hex_iterator;
4112 
4123  begin_raw(const unsigned int level = 0) const;
4124 
4130  end_raw(const unsigned int level) const;
4131 
4146  begin_raw_line(const unsigned int level = 0) const;
4147 
4166  begin_line(const unsigned int level = 0) const;
4167 
4186  begin_active_line(const unsigned int level = 0) const;
4187 
4193  end_line() const;
4194 
4222  begin_raw_quad(const unsigned int level = 0) const;
4223 
4242  begin_quad(const unsigned int level = 0) const;
4243 
4262  begin_active_quad(const unsigned int level = 0) const;
4263 
4269  end_quad() const;
4270 
4297  begin_raw_hex(const unsigned int level = 0) const;
4298 
4316  hex_iterator
4317  begin_hex(const unsigned int level = 0) const;
4318 
4337  begin_active_hex(const unsigned int level = 0) const;
4338 
4343  hex_iterator
4344  end_hex() const;
4345 
4362  void
4364 
4368  void
4370 
4377  void
4379 
4383  void
4385 
4389  void
4391 
4407 
4414  void
4416 
4421  void
4423 
4439  virtual unsigned int
4442 
4443 
4456  virtual types::coarse_cell_id
4458  const unsigned int coarse_cell_index) const;
4459 
4464  std::vector<
4465  std::unique_ptr<::internal::TriangulationImplementation::TriaLevel>>
4467 
4473  std::unique_ptr<::internal::TriangulationImplementation::TriaFaces>
4475 
4476 
4480  std::vector<Point<spacedim>> vertices;
4481 
4485  std::vector<bool> vertices_used;
4486 
4491  std::map<types::manifold_id, std::unique_ptr<const Manifold<dim, spacedim>>>
4493 
4498 
4499 
4505 
4516 
4531  std::unique_ptr<std::map<unsigned int, types::boundary_id>>
4533 
4534 
4554  std::unique_ptr<std::map<unsigned int, types::manifold_id>>
4556 
4557  // make a couple of classes friends
4558  template <int, int, int>
4559  friend class TriaAccessorBase;
4560  template <int, int, int>
4561  friend class TriaAccessor;
4562  friend class TriaAccessor<0, 1, spacedim>;
4563 
4564  friend class CellAccessor<dim, spacedim>;
4565 
4566  friend struct ::internal::TriaAccessorImplementation::Implementation;
4567 
4568  friend struct ::internal::TriangulationImplementation::Implementation;
4569  friend struct ::internal::TriangulationImplementation::
4570  ImplementationMixedMesh;
4571 
4572  friend class ::internal::TriangulationImplementation::TriaObjects;
4573 
4574  // explicitly check for sensible template arguments, but not on windows
4575  // because MSVC creates bogus warnings during normal compilation
4576 #ifndef DEAL_II_MSVC
4577  static_assert(dim <= spacedim,
4578  "The dimension <dim> of a Triangulation must be less than or "
4579  "equal to the space dimension <spacedim> in which it lives.");
4580 #endif
4581 };
4582 
4583 
4584 #ifndef DOXYGEN
4585 
4586 
4587 
4588 namespace internal
4589 {
4590  namespace TriangulationImplementation
4591  {
4592  template <class Archive>
4593  void
4594  NumberCache<1>::serialize(Archive &ar, const unsigned int)
4595  {
4596  ar &n_levels;
4597  ar &n_lines &n_lines_level;
4598  ar &n_active_lines &n_active_lines_level;
4599  }
4600 
4601 
4602  template <class Archive>
4603  void
4604  NumberCache<2>::serialize(Archive &ar, const unsigned int version)
4605  {
4606  this->NumberCache<1>::serialize(ar, version);
4607 
4608  ar &n_quads &n_quads_level;
4609  ar &n_active_quads &n_active_quads_level;
4610  }
4611 
4612 
4613  template <class Archive>
4614  void
4615  NumberCache<3>::serialize(Archive &ar, const unsigned int version)
4616  {
4617  this->NumberCache<2>::serialize(ar, version);
4618 
4619  ar &n_hexes &n_hexes_level;
4620  ar &n_active_hexes &n_active_hexes_level;
4621  }
4622 
4623  } // namespace TriangulationImplementation
4624 } // namespace internal
4625 
4626 
4627 template <int dim, int spacedim>
4628 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4630  const unsigned int index) const
4631 {
4632  AssertIndexRange(index, vertices_used.size());
4633  return vertices_used[index];
4634 }
4635 
4636 
4637 
4638 template <int dim, int spacedim>
4639 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4640 inline unsigned int Triangulation<dim, spacedim>::n_levels() const
4641 {
4642  return number_cache.n_levels;
4643 }
4644 
4645 template <int dim, int spacedim>
4646 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4647 inline unsigned int Triangulation<dim, spacedim>::n_global_levels() const
4648 {
4649  return number_cache.n_levels;
4650 }
4651 
4652 
4653 template <int dim, int spacedim>
4654 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4655 inline unsigned int Triangulation<dim, spacedim>::n_vertices() const
4656 {
4657  return vertices.size();
4658 }
4659 
4660 
4661 
4662 template <int dim, int spacedim>
4663 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4664 inline const std::vector<Point<spacedim>>
4666 {
4667  return vertices;
4668 }
4669 
4670 
4671 template <int dim, int spacedim>
4672 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4673 template <class Archive>
4674 void Triangulation<dim, spacedim>::save(Archive &ar, const unsigned int) const
4675 {
4676  // as discussed in the documentation, do not store the signals as
4677  // well as boundary and manifold description but everything else
4678  ar &smooth_grid;
4679 
4680  unsigned int n_levels = levels.size();
4681  ar &n_levels;
4682  for (const auto &level : levels)
4683  ar &level;
4684 
4685  // boost dereferences a nullptr when serializing a nullptr
4686  // at least up to 1.65.1. This causes problems with clang-5.
4687  // Therefore, work around it.
4688  bool faces_is_nullptr = (faces.get() == nullptr);
4689  ar &faces_is_nullptr;
4690  if (!faces_is_nullptr)
4691  ar &faces;
4692 
4693  ar &vertices;
4694  ar &vertices_used;
4695 
4697  ar &number_cache;
4698 
4700 
4701  if (dim == 1)
4702  {
4705  }
4706 }
4707 
4708 
4709 
4710 template <int dim, int spacedim>
4711 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4712 template <class Archive>
4713 void Triangulation<dim, spacedim>::load(Archive &ar, const unsigned int)
4714 {
4715  // clear previous content. this also calls the respective signal
4716  clear();
4717 
4718  // as discussed in the documentation, do not store the signals as
4719  // well as boundary and manifold description but everything else
4720  ar &smooth_grid;
4721 
4722  unsigned int size;
4723  ar &size;
4724  levels.resize(size);
4725  for (auto &level_ : levels)
4726  {
4727  std::unique_ptr<internal::TriangulationImplementation::TriaLevel> level;
4728  ar &level;
4729  level_ = std::move(level);
4730  }
4731 
4732  // Workaround for nullptr, see in save().
4733  bool faces_is_nullptr = true;
4734  ar &faces_is_nullptr;
4735  if (!faces_is_nullptr)
4736  ar &faces;
4737 
4738  ar &vertices;
4739  ar &vertices_used;
4740 
4742  ar &number_cache;
4743 
4744  // the levels do not serialize the active_cell_indices because
4745  // they are easy enough to rebuild upon re-loading data. do
4746  // this here. don't forget to first resize the fields appropriately
4747  {
4748  for (auto &level : levels)
4749  {
4750  level->active_cell_indices.resize(level->refine_flags.size());
4751  level->global_active_cell_indices.resize(level->refine_flags.size());
4752  level->global_level_cell_indices.resize(level->refine_flags.size());
4753  }
4757  }
4758 
4759  reset_policy();
4760 
4761  bool my_check_for_distorted_cells;
4762  ar &my_check_for_distorted_cells;
4763 
4764  Assert(my_check_for_distorted_cells == check_for_distorted_cells,
4765  ExcMessage("The triangulation loaded into here must have the "
4766  "same setting with regard to reporting distorted "
4767  "cell as the one previously stored."));
4768 
4769  if (dim == 1)
4770  {
4773  }
4774 
4775  // trigger the create signal to indicate
4776  // that new content has been imported into
4777  // the triangulation
4778  signals.create();
4779 }
4780 
4781 
4782 
4783 template <int dim, int spacedim>
4784 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4785 inline unsigned int Triangulation<dim, spacedim>::
4788 {
4789  return coarse_cell_id;
4790 }
4791 
4792 
4793 
4794 template <int dim, int spacedim>
4795 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
4796 inline types::coarse_cell_id
4798  const unsigned int coarse_cell_index) const
4799 {
4800  return coarse_cell_index;
4801 }
4802 
4803 
4804 
4805 /* -------------- declaration of explicit specializations ------------- */
4806 
4807 template <>
4808 unsigned int
4810 template <>
4811 unsigned int
4812 Triangulation<1, 1>::n_quads(const unsigned int level) const;
4813 template <>
4814 unsigned int
4815 Triangulation<1, 1>::n_raw_quads(const unsigned int level) const;
4816 template <>
4817 unsigned int
4818 Triangulation<2, 2>::n_raw_quads(const unsigned int level) const;
4819 template <>
4820 unsigned int
4821 Triangulation<3, 3>::n_raw_quads(const unsigned int level) const;
4822 template <>
4823 unsigned int
4825 template <>
4826 unsigned int
4827 Triangulation<1, 1>::n_active_quads(const unsigned int level) const;
4828 template <>
4829 unsigned int
4831 template <>
4832 unsigned int
4833 Triangulation<1, 1>::n_raw_hexs(const unsigned int level) const;
4834 template <>
4835 unsigned int
4836 Triangulation<3, 3>::n_raw_hexs(const unsigned int level) const;
4837 template <>
4838 unsigned int
4840 template <>
4841 unsigned int
4843 template <>
4844 unsigned int
4845 Triangulation<3, 3>::n_active_hexs(const unsigned int) const;
4846 template <>
4847 unsigned int
4848 Triangulation<3, 3>::n_hexs(const unsigned int level) const;
4849 
4850 template <>
4851 unsigned int
4853 
4854 
4855 // -------------------------------------------------------------------
4856 // -- Explicit specializations for codimension one grids
4857 
4858 
4859 template <>
4860 unsigned int
4862 template <>
4863 unsigned int
4864 Triangulation<1, 2>::n_quads(const unsigned int level) const;
4865 template <>
4866 unsigned int
4867 Triangulation<1, 2>::n_raw_quads(const unsigned int level) const;
4868 template <>
4869 unsigned int
4870 Triangulation<2, 3>::n_raw_quads(const unsigned int level) const;
4871 template <>
4872 unsigned int
4873 Triangulation<1, 2>::n_raw_hexs(const unsigned int level) const;
4874 template <>
4875 unsigned int
4876 Triangulation<1, 2>::n_active_quads(const unsigned int level) const;
4877 template <>
4878 unsigned int
4880 template <>
4881 unsigned int
4883 
4884 // -------------------------------------------------------------------
4885 // -- Explicit specializations for codimension two grids
4886 
4887 template <>
4888 unsigned int
4890 template <>
4891 unsigned int
4892 Triangulation<1, 3>::n_quads(const unsigned int level) const;
4893 template <>
4894 unsigned int
4895 Triangulation<1, 3>::n_raw_quads(const unsigned int level) const;
4896 template <>
4897 unsigned int
4898 Triangulation<2, 3>::n_raw_quads(const unsigned int level) const;
4899 template <>
4900 unsigned int
4901 Triangulation<1, 3>::n_raw_hexs(const unsigned int level) const;
4902 template <>
4903 unsigned int
4904 Triangulation<1, 3>::n_active_quads(const unsigned int level) const;
4905 template <>
4906 unsigned int
4908 template <>
4909 unsigned int
4911 
4912 template <>
4913 bool
4915 template <>
4916 bool
4918 template <>
4919 bool
4921 
4922 
4923 extern template class Triangulation<1, 1>;
4924 extern template class Triangulation<1, 2>;
4925 extern template class Triangulation<1, 3>;
4926 extern template class Triangulation<2, 2>;
4927 extern template class Triangulation<2, 3>;
4928 extern template class Triangulation<3, 3>;
4929 
4930 #endif // DOXYGEN
4931 
4933 
4934 // Include tria_accessor.h here, so that it is possible for an end
4935 // user to use the iterators of Triangulation<dim> directly without
4936 // the need to include tria_accessor.h separately. (Otherwise the
4937 // iterators are an 'opaque' or 'incomplete' type.)
4939 
4940 #endif
CellStatus
Definition: cell_status.h:32
@ cell_will_be_refined
@ children_will_be_coarsened
Definition: cell_id.h:72
Definition: point.h:112
unsigned int n_hexs(const unsigned int level) const
void save_user_flags_line(std::vector< bool > &v) const
virtual types::global_cell_index n_global_active_cells() const
const std::vector< bool > & get_used_vertices() const
quad_iterator begin_quad(const unsigned int level=0) const
typename IteratorSelector::raw_line_iterator raw_line_iterator
Definition: tria.h:4109
active_vertex_iterator begin_active_vertex() const
void load_user_indices_quad(const std::vector< unsigned int > &v)
unsigned int n_quads() const
void load_user_indices(const std::vector< unsigned int > &v)
std::vector< bool > vertices_used
Definition: tria.h:4485
virtual void clear()
bool anisotropic_refinement
Definition: tria.h:4497
active_quad_iterator begin_active_quad(const unsigned int level=0) const
bool get_anisotropic_refinement_flag() const
virtual types::coarse_cell_id n_global_coarse_cells() const
std::unique_ptr< std::map< unsigned int, types::manifold_id > > vertex_to_manifold_id_map_1d
Definition: tria.h:4555
void save_user_pointers_quad(std::vector< void * > &v) const
void save_user_flags_hex(std::ostream &out) const
void clear_user_flags_quad()
unsigned int n_faces() const
active_hex_iterator begin_active_hex(const unsigned int level=0) const
static void read_bool_vector(const unsigned int magic_number1, std::vector< bool > &v, const unsigned int magic_number2, std::istream &in)
unsigned int n_active_lines(const unsigned int level) const
bool all_reference_cells_are_hyper_cube() const
void load_user_flags_line(std::istream &in)
void clear_user_data()
raw_hex_iterator begin_raw_hex(const unsigned int level=0) const
void save_user_flags_line(std::ostream &out) const
active_cell_iterator last_active() const
void save(Archive &ar, const unsigned int version) const
std::vector< typename internal::CellAttachedDataSerializer< dim, spacedim >::cell_relation_t > local_cell_relations
Definition: tria.h:3921
void reset_global_cell_indices()
face_iterator end_face() const
void reset_active_cell_indices()
cell_iterator create_cell_iterator(const CellId &cell_id) const
cell_iterator begin(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
Definition: tria.h:4094
void fix_coarsen_flags()
unsigned int n_active_cells(const unsigned int level) const
unsigned int n_cells(const unsigned int level) const
void save_user_pointers_line(std::vector< void * > &v) const
void save_user_flags_quad(std::vector< bool > &v) const
void load_refine_flags(std::istream &in)
void save_user_indices_line(std::vector< unsigned int > &v) const
raw_cell_iterator begin_raw(const unsigned int level=0) const
unsigned int n_lines() const
void load_coarsen_flags(const std::vector< bool > &v)
unsigned int n_raw_lines() const
virtual std::size_t memory_consumption() const
std::vector< Point< spacedim > > vertices
Definition: tria.h:4480
raw_quad_iterator begin_raw_quad(const unsigned int level=0) const
virtual types::subdomain_id locally_owned_subdomain() const
unsigned int n_raw_faces() const
unsigned int n_active_faces() const
const bool check_for_distorted_cells
Definition: tria.h:4504
raw_cell_iterator end_raw(const unsigned int level) const
line_iterator end_line() const
std::unique_ptr< std::map< unsigned int, types::boundary_id > > vertex_to_boundary_id_map_1d
Definition: tria.h:4532
void load_user_flags_quad(std::istream &in)
unsigned int n_active_cells() const
virtual void update_reference_cells()
std::vector< ReferenceCell > reference_cells
Definition: tria.h:4025
void update_periodic_face_map()
unsigned int n_raw_lines(const unsigned int level) const
void clear_despite_subscriptions()
void save_user_flags(std::ostream &out) const
void load_user_flags_hex(std::istream &in)
void load_user_pointers_quad(const std::vector< void * > &v)
std::unique_ptr<::internal::TriangulationImplementation::TriaFaces > faces
Definition: tria.h:4474
virtual void add_periodicity(const std::vector< GridTools::PeriodicFacePair< cell_iterator >> &)
::CellStatus CellStatus
Definition: tria.h:2239
unsigned int n_used_vertices() const
void reset_cell_vertex_indices_cache()
unsigned int n_active_lines() const
unsigned int n_levels() const
void load_user_flags_hex(const std::vector< bool > &v)
void load_user_indices_line(const std::vector< unsigned int > &v)
void clear_user_flags_hex()
void save_user_pointers_hex(std::vector< void * > &v) const
typename IteratorSelector::raw_quad_iterator raw_quad_iterator
Definition: tria.h:4110
void load_user_pointers(const std::vector< void * > &v)
unsigned int register_data_attach(const std::function< std::vector< char >(const cell_iterator &, const ::CellStatus)> &pack_callback, const bool returns_variable_size_data)
::internal::TriangulationImplementation::NumberCache< dim > number_cache
Definition: tria.h:4515
void load_user_flags_quad(const std::vector< bool > &v)
void load_user_flags_line(const std::vector< bool > &v)
void save_user_indices_hex(std::vector< unsigned int > &v) const
DistortedCellList execute_refinement()
active_line_iterator begin_active_line(const unsigned int level=0) const
void save_user_indices_quad(std::vector< unsigned int > &v) const
void load_user_pointers_hex(const std::vector< void * > &v)
cell_iterator end() const
virtual bool has_hanging_nodes() const
std::vector< GridTools::PeriodicFacePair< cell_iterator > > periodic_face_pairs_level_0
Definition: tria.h:4086
unsigned int n_raw_cells(const unsigned int level) const
cell_iterator end(const unsigned int level) const
bool contains_cell(const CellId &cell_id) const
virtual void save(const std::string &filename) const
virtual types::coarse_cell_id coarse_cell_index_to_coarse_cell_id(const unsigned int coarse_cell_index) const
unsigned int n_raw_quads(const unsigned int level) const
internal::CellAttachedData< dim, spacedim > cell_attached_data
Definition: tria.h:3871
void load_coarsen_flags(std::istream &out)
quad_iterator end_quad() const
line_iterator begin_line(const unsigned int level=0) const
unsigned int max_adjacent_cells() const
vertex_iterator begin_vertex() const
void save_attached_data(const unsigned int global_first_cell, const unsigned int global_num_cells, const std::string &filename) const
void clear_user_flags()
unsigned int n_hexs() const
vertex_iterator end_vertex() const
bool vertex_used(const unsigned int index) const
void load_user_pointers_line(const std::vector< void * > &v)
void save_user_flags(std::vector< bool > &v) const
hex_iterator end_hex() const
const Triangulation< dim, spacedim > & get_triangulation() const
virtual void load(const std::string &filename)
hex_iterator begin_hex(const unsigned int level=0) const
virtual unsigned int n_global_levels() const
active_cell_iterator end_active(const unsigned int level) const
bool is_mixed_mesh() const
virtual void update_cell_relations()
Definition: tria.h:3911
cell_iterator last() const
unsigned int n_active_quads() const
void save_coarsen_flags(std::vector< bool > &v) const
void load_user_indices_hex(const std::vector< unsigned int > &v)
unsigned int n_raw_quads() const
void save_user_pointers(std::vector< void * > &v) const
face_iterator begin_face() const
unsigned int n_cells() const
virtual bool prepare_coarsening_and_refinement()
unsigned int n_active_quads(const unsigned int level) const
void load_user_flags(const std::vector< bool > &v)
typename IteratorSelector::raw_hex_iterator raw_hex_iterator
Definition: tria.h:4111
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::map< types::manifold_id, std::unique_ptr< const Manifold< dim, spacedim > > > manifolds
Definition: tria.h:4492
void serialize(Archive &archive, const unsigned int version)
void load_refine_flags(const std::vector< bool > &v)
MeshSmoothing smooth_grid
Definition: tria.h:4019
void save_refine_flags(std::ostream &out) const
std::unique_ptr< ::internal::TriangulationImplementation::Policy< dim, spacedim > > policy
Definition: tria.h:4077
Triangulation< dim, spacedim > & get_triangulation()
void save_user_flags_quad(std::ostream &out) const
Signals signals
Definition: tria.h:2524
internal::CellAttachedDataSerializer< dim, spacedim > data_serializer
Definition: tria.h:3923
unsigned int n_active_hexs(const unsigned int level) const
unsigned int n_vertices() const
void load(Archive &ar, const unsigned int version)
void save_user_indices(std::vector< unsigned int > &v) const
void notify_ready_to_unpack(const unsigned int handle, const std::function< void(const cell_iterator &, const ::CellStatus, const boost::iterator_range< std::vector< char >::const_iterator > &)> &unpack_callback)
void save_user_flags_hex(std::vector< bool > &v) const
bool all_reference_cells_are_simplex() const
std::vector< std::unique_ptr<::internal::TriangulationImplementation::TriaLevel > > levels
Definition: tria.h:4466
unsigned int n_raw_hexs(const unsigned int level) const
unsigned int n_lines(const unsigned int level) const
unsigned int n_active_hexs() const
virtual unsigned int coarse_cell_id_to_coarse_cell_index(const types::coarse_cell_id coarse_cell_id) const
unsigned int n_quads(const unsigned int level) const
void load_user_flags(std::istream &in)
void reset_policy()
const std::vector< ReferenceCell > & get_reference_cells() const
void save_coarsen_flags(std::ostream &out) const
active_face_iterator begin_active_face() const
void clear_user_flags_line()
raw_line_iterator begin_raw_line(const unsigned int level=0) const
static void write_bool_vector(const unsigned int magic_number1, const std::vector< bool > &v, const unsigned int magic_number2, std::ostream &out)
const std::vector< Point< spacedim > > & get_vertices() const
active_cell_iterator begin_active(const unsigned int level=0) const
void execute_coarsening()
void load_attached_data(const unsigned int global_first_cell, const unsigned int global_num_cells, const unsigned int local_num_cells, const std::string &filename, const unsigned int n_attached_deserialize_fixed, const unsigned int n_attached_deserialize_variable)
void save_refine_flags(std::vector< bool > &v) const
std::vector< char > dest_data_variable
Definition: tria.h:530
std::vector< char > src_data_fixed
Definition: tria.h:520
std::vector< char > dest_data_fixed
Definition: tria.h:521
std::vector< int > src_sizes_variable
Definition: tria.h:527
std::vector< unsigned int > sizes_fixed_cumulative
Definition: tria.h:514
typename std::pair< cell_iterator, CellStatus > cell_relation_t
Definition: tria.h:388
std::vector< int > dest_sizes_variable
Definition: tria.h:528
std::vector< char > src_data_variable
Definition: tria.h:529
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_CXX20_REQUIRES(condition)
Definition: config.h:166
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
Point< 3 > vertices[4]
Point< 2 > first
Definition: grid_out.cc:4614
unsigned int level
Definition: grid_out.cc:4617
IteratorRange< active_cell_iterator > active_cell_iterators() const
IteratorRange< active_face_iterator > active_face_iterators() const
IteratorRange< active_cell_iterator > active_cell_iterators_on_level(const unsigned int level) const
IteratorRange< cell_iterator > cell_iterators() const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
#define DeclException0(Exception0)
Definition: exceptions.h:467
#define Assert(cond, exc)
Definition: exceptions.h:1616
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:535
#define AssertIndexRange(index, range)
Definition: exceptions.h:1857
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:490
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:512
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcFacesHaveNoLevel()
typename IteratorSelector::hex_iterator hex_iterator
Definition: tria.h:1706
typename IteratorSelector::active_quad_iterator active_quad_iterator
Definition: tria.h:1697
typename IteratorSelector::active_hex_iterator active_hex_iterator
Definition: tria.h:1717
typename IteratorSelector::quad_iterator quad_iterator
Definition: tria.h:1682
typename IteratorSelector::line_iterator line_iterator
Definition: tria.h:1658
typename IteratorSelector::active_line_iterator active_line_iterator
Definition: tria.h:1673
void create_triangulation(Triangulation< dim, dim > &tria, const AdditionalData &additional_data=AdditionalData())
static const char T
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
Definition: types.h:33
unsigned int manifold_id
Definition: types.h:153
global_cell_index coarse_cell_id
Definition: types.h:127
unsigned int subdomain_id
Definition: types.h:44
unsigned int global_cell_index
Definition: types.h:118
unsigned int boundary_id
Definition: types.h:141
T operator()(InputIterator first, InputIterator last) const
Definition: tria.h:2282
virtual ~DistortedCellList() noexcept override
boost::signals2::signal< void()> mesh_movement
Definition: tria.h:2339
boost::signals2::signal< void()> post_distributed_load
Definition: tria.h:2513
boost::signals2::signal< void()> pre_distributed_save
Definition: tria.h:2491
boost::signals2::signal< unsigned int(const cell_iterator &, const ::CellStatus), CellWeightSum< unsigned int > > weight
Definition: tria.h:2437
boost::signals2::signal< void(const Triangulation< dim, spacedim > &destination_tria)> copy
Definition: tria.h:2370
boost::signals2::signal< void()> pre_distributed_refinement
Definition: tria.h:2450
boost::signals2::signal< void()> post_distributed_refinement
Definition: tria.h:2469
boost::signals2::signal< void()> pre_refinement
Definition: tria.h:2315
boost::signals2::signal< void()> any_change
Definition: tria.h:2396
boost::signals2::signal< void()> create
Definition: tria.h:2306
boost::signals2::signal< void()> clear
Definition: tria.h:2385
boost::signals2::signal< void(const typename Triangulation< dim, spacedim >::cell_iterator &cell)> post_refinement_on_cell
Definition: tria.h:2360
boost::signals2::signal< void(const typename Triangulation< dim, spacedim >::cell_iterator &cell)> pre_coarsening_on_cell
Definition: tria.h:2350
boost::signals2::signal< void()> post_refinement
Definition: tria.h:2322
boost::signals2::signal< void()> pre_partition
Definition: tria.h:2330
boost::signals2::signal< void()> pre_distributed_repartition
Definition: tria.h:2476
boost::signals2::signal< void()> pre_distributed_load
Definition: tria.h:2506
boost::signals2::signal< void()> post_p4est_refinement
Definition: tria.h:2459
boost::signals2::signal< void()> post_distributed_repartition
Definition: tria.h:2483
boost::signals2::signal< void()> post_distributed_save
Definition: tria.h:2498
std::vector< pack_callback_t > pack_callbacks_variable
Definition: tria.h:363
unsigned int n_attached_deserialize
Definition: tria.h:353
std::vector< pack_callback_t > pack_callbacks_fixed
Definition: tria.h:362
unsigned int n_attached_data_sets
Definition: tria.h:347
std::function< std::vector< char >(cell_iterator, CellStatus)> pack_callback_t
Definition: tria.h:356
std::shared_ptr< const Utilities::MPI::Partitioner > active_cell_index_partitioner
Definition: tria.h:185
void serialize(Archive &ar, const unsigned int version)
std::vector< unsigned int > n_active_lines_level
Definition: tria.h:179
std::vector< std::shared_ptr< const Utilities::MPI::Partitioner > > level_cell_index_partitioners
Definition: tria.h:191
std::vector< unsigned int > n_active_quads_level
Definition: tria.h:249
void serialize(Archive &ar, const unsigned int version)
void serialize(Archive &ar, const unsigned int version)
std::vector< unsigned int > n_active_hexes_level
Definition: tria.h:308
const ::Triangulation< dim, spacedim > & tria