deal.II version GIT relicensing-6809-ge913b9bb34 2026-09-25 17:20:01+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\}}\)
Loading...
Searching...
No Matches
shared_tria.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2015 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_distributed_shared_tria_h
14#define dealii_distributed_shared_tria_h
15
16
17#include <deal.II/base/config.h>
18
23
25
26#include <deal.II/grid/tria.h>
27
28#include <functional>
29#include <list>
30#include <utility>
31#include <vector>
32
34
35namespace parallel
36{
37#ifdef DEAL_II_WITH_MPI
38
39
40 namespace shared
41 {
104 template <int dim, int spacedim = dim>
107 : public ::parallel::TriangulationBase<dim, spacedim>
108 {
109 public:
111 typename ::Triangulation<dim, spacedim>::active_cell_iterator;
113 typename ::Triangulation<dim, spacedim>::cell_iterator;
114
129 {
139 partition_auto = 0x0,
140
144 partition_metis = 0x1,
145
163 partition_zorder = 0x2,
164
168 partition_zoltan = 0x3,
169
219 partition_custom_signal = 0x4,
220
229 construct_multigrid_hierarchy = 0x8,
230 };
231
232
257 const MPI_Comm mpi_communicator,
258 const typename ::Triangulation<dim, spacedim>::MeshSmoothing =
260 const bool allow_artificial_cells = false,
261 const Settings settings = partition_auto);
262
266 virtual ~Triangulation() override = default;
267
271 virtual bool
272 is_multilevel_hierarchy_constructed() const override;
273
282 virtual void
283 execute_coarsening_and_refinement() override;
284
298 virtual bool
299 prepare_coarsening_and_refinement() override;
300
307 virtual void
308 create_triangulation(const std::vector<Point<spacedim>> &vertices,
309 const std::vector<CellData<dim>> &cells,
310 const SubCellData &subcelldata) override;
311
317 virtual void
318 create_triangulation(
320 &construction_data) override;
321
332 virtual void
333 copy_triangulation(
334 const ::Triangulation<dim, spacedim> &other_tria) override;
335
336# ifdef DOXYGEN
342 template <class Archive>
343 void
344 serialize(Archive &archive, const unsigned int version);
345# else
346 // This macro defines the serialize() method that is compatible with
347 // the templated save() and load() method that have been implemented.
348 BOOST_SERIALIZATION_SPLIT_MEMBER()
349# endif
350
358 using parallel::TriangulationBase<dim, spacedim>::save;
359
365 using parallel::TriangulationBase<dim, spacedim>::load;
366
375 template <class Archive>
376 void
377 load(Archive &ar, const unsigned int version);
378
387 const std::vector<types::subdomain_id> &
388 get_true_subdomain_ids_of_cells() const;
389
398 const std::vector<types::subdomain_id> &
399 get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
400
405 bool
406 with_artificial_cells() const;
407
408 private:
413
418
423 void
424 partition();
425
433 void
434 communicate_coarsening_and_refinement_flags();
435
448 std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
449
458 std::vector<std::vector<types::subdomain_id>>
460 };
461
462
463
464 template <int dim, int spacedim>
466 template <class Archive>
468 const unsigned int version)
469 {
471 partition();
472 this->update_number_cache();
473 }
474 } // namespace shared
475#else
476
477 namespace shared
478 {
492 template <int dim, int spacedim = dim>
494 class Triangulation
495 : public ::parallel::TriangulationBase<dim, spacedim>
496 {
497 public:
502 Triangulation() = delete;
503
507 virtual bool
509
513 const std::vector<types::subdomain_id> &
515
519 const std::vector<types::subdomain_id> &
520 get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
521
525 bool
526 with_artificial_cells() const;
527
528 private:
532 std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
533
537 std::vector<types::subdomain_id> true_level_subdomain_ids_of_cells;
538 };
539 } // namespace shared
540
541
542#endif
543} // namespace parallel
544
545
546namespace internal
547{
548 namespace parallel
549 {
550 namespace shared
551 {
571 template <int dim, int spacedim = dim>
573 {
574 public:
584 const Triangulation<dim, spacedim> &tria);
585
593
594 private:
598 const ObserverPointer<
599 const ::parallel::shared::Triangulation<dim, spacedim>>
601
607 std::vector<unsigned int> saved_subdomain_ids;
608 };
609 } // namespace shared
610 } // namespace parallel
611} // namespace internal
612
614
615#endif
Definition point.h:111
const ObserverPointer< const ::parallel::shared::Triangulation< dim, spacedim > > shared_tria
std::vector< types::subdomain_id > true_subdomain_ids_of_cells
typename ::Triangulation< dim, spacedim >::active_cell_iterator active_cell_iterator
const std::vector< types::subdomain_id > & get_true_subdomain_ids_of_cells() const
std::vector< std::vector< types::subdomain_id > > true_level_subdomain_ids_of_cells
typename ::Triangulation< dim, spacedim >::cell_iterator cell_iterator
const std::vector< types::subdomain_id > & get_true_level_subdomain_ids_of_cells(const unsigned int level) const
void serialize(Archive &archive, const unsigned int version)
virtual ~Triangulation() override=default
virtual bool is_multilevel_hierarchy_constructed() const override
void load(Archive &ar, const unsigned int version)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:249
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
unsigned int level
Definition grid_out.cc:4642