Reference documentation for deal.II version 9.6.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\}}\)
Loading...
Searching...
No Matches
shared_tria.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: 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// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_distributed_shared_tria_h
16#define dealii_distributed_shared_tria_h
17
18
19#include <deal.II/base/config.h>
20
25
27
28#include <deal.II/grid/tria.h>
29
30#include <functional>
31#include <list>
32#include <utility>
33#include <vector>
34
36
37namespace parallel
38{
39#ifdef DEAL_II_WITH_MPI
40
41
42 namespace shared
43 {
106 template <int dim, int spacedim = dim>
109 : public ::parallel::TriangulationBase<dim, spacedim>
110 {
111 public:
113 typename ::Triangulation<dim, spacedim>::active_cell_iterator;
115 typename ::Triangulation<dim, spacedim>::cell_iterator;
116
131 {
141 partition_auto = 0x0,
142
146 partition_metis = 0x1,
147
165 partition_zorder = 0x2,
166
170 partition_zoltan = 0x3,
171
221 partition_custom_signal = 0x4,
222
231 construct_multigrid_hierarchy = 0x8,
232 };
233
234
259 const MPI_Comm mpi_communicator,
260 const typename ::Triangulation<dim, spacedim>::MeshSmoothing =
262 const bool allow_artificial_cells = false,
263 const Settings settings = partition_auto);
264
268 virtual ~Triangulation() override = default;
269
273 virtual bool
274 is_multilevel_hierarchy_constructed() const override;
275
284 virtual void
285 execute_coarsening_and_refinement() override;
286
293 virtual void
294 create_triangulation(const std::vector<Point<spacedim>> &vertices,
295 const std::vector<CellData<dim>> &cells,
296 const SubCellData &subcelldata) override;
297
303 virtual void
304 create_triangulation(
306 &construction_data) override;
307
318 virtual void
319 copy_triangulation(
320 const ::Triangulation<dim, spacedim> &other_tria) override;
321
322# ifdef DOXYGEN
328 template <class Archive>
329 void
330 serialize(Archive &archive, const unsigned int version);
331# else
332 // This macro defines the serialize() method that is compatible with
333 // the templated save() and load() method that have been implemented.
334 BOOST_SERIALIZATION_SPLIT_MEMBER()
335# endif
336
344 using parallel::TriangulationBase<dim, spacedim>::save;
345
351 using parallel::TriangulationBase<dim, spacedim>::load;
352
361 template <class Archive>
362 void
363 load(Archive &ar, const unsigned int version);
364
373 const std::vector<types::subdomain_id> &
374 get_true_subdomain_ids_of_cells() const;
375
384 const std::vector<types::subdomain_id> &
385 get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
386
391 bool
392 with_artificial_cells() const;
393
394 private:
399
404
409 void
410 partition();
411
424 std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
425
434 std::vector<std::vector<types::subdomain_id>>
436 };
437
438
439
440 template <int dim, int spacedim>
442 template <class Archive>
444 const unsigned int version)
445 {
447 partition();
448 this->update_number_cache();
449 }
450 } // namespace shared
451#else
452
453 namespace shared
454 {
468 template <int dim, int spacedim = dim>
470 class Triangulation
471 : public ::parallel::TriangulationBase<dim, spacedim>
472 {
473 public:
478 Triangulation() = delete;
479
483 virtual bool
485
489 const std::vector<types::subdomain_id> &
491
495 const std::vector<types::subdomain_id> &
496 get_true_level_subdomain_ids_of_cells(const unsigned int level) const;
497
501 bool
502 with_artificial_cells() const;
503
504 private:
508 std::vector<types::subdomain_id> true_subdomain_ids_of_cells;
509
513 std::vector<types::subdomain_id> true_level_subdomain_ids_of_cells;
514 };
515 } // namespace shared
516
517
518#endif
519} // namespace parallel
520
521
522namespace internal
523{
524 namespace parallel
525 {
526 namespace shared
527 {
547 template <int dim, int spacedim = dim>
549 {
550 public:
560 const Triangulation<dim, spacedim> &tria);
561
569
570 private:
574 const SmartPointer<
575 const ::parallel::shared::Triangulation<dim, spacedim>>
577
583 std::vector<unsigned int> saved_subdomain_ids;
584 };
585 } // namespace shared
586 } // namespace parallel
587} // namespace internal
588
590
591#endif
Definition point.h:111
const SmartPointer< const ::parallel::shared::Triangulation< dim, spacedim > > shared_tria
TemporarilyRestoreSubdomainIds(const Triangulation< dim, spacedim > &tria)
std::vector< types::subdomain_id > true_subdomain_ids_of_cells
typename ::Triangulation< dim, spacedim >::cell_iterator 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
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
Triangulation(const MPI_Comm mpi_communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing=(::Triangulation< dim, spacedim >::none), const bool allow_artificial_cells=false, const Settings settings=partition_auto)
typename ::Triangulation< dim, spacedim >::active_cell_iterator active_cell_iterator
virtual bool is_multilevel_hierarchy_constructed() const override
void load(Archive &ar, const unsigned int version)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:177
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
Point< 3 > vertices[4]
unsigned int level
Definition grid_out.cc:4626