version GIT relicensing-7341-gcb9dbcaa45 2026-12-04 11:10: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
fully_distributed_tria.cc
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) 2019 - 2026 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
15#include <deal.II/base/mpi.h>
16#include <deal.II/base/mpi.templates.h>
18
21
23
24#include <algorithm>
25#include <fstream>
26#include <limits>
27#include <memory>
28#include <string>
29
31
32// Forward declarations
33namespace GridGenerator
34{
35 template <int dim, int spacedim>
36 void
38 const double left,
39 const double right,
40 const bool colorize);
41} // namespace GridGenerator
42
43namespace parallel
44{
45 namespace fullydistributed
46 {
47 template <int dim, int spacedim>
49 Triangulation<dim, spacedim>::Triangulation(const MPI_Comm mpi_communicator)
50 : parallel::DistributedTriangulationBase<dim, spacedim>(mpi_communicator)
51 , settings(TriangulationDescription::Settings::default_setting)
52 , partitioner([](::Triangulation<dim, spacedim> &tria,
53 const unsigned int n_partitions) {
55 })
56 , currently_processing_create_triangulation_for_internal_usage(false)
57 , currently_processing_prepare_coarsening_and_refinement_for_internal_usage(
58 false)
59 {}
60
61
62
63 template <int dim, int spacedim>
65 void Triangulation<dim, spacedim>::create_triangulation(
66 const TriangulationDescription::Description<dim, spacedim>
67 &construction_data)
68 {
69 // check if the communicator of this parallel triangulation has been used
70 // to construct the TriangulationDescription::Description
71 Assert(construction_data.comm == this->mpi_communicator,
72 ExcMessage("MPI communicators do not match!"));
73
74 // store internally the settings
75 settings = construction_data.settings;
76
77 // set the smoothing properties
78 if (settings &
80 this->set_mesh_smoothing(
81 static_cast<
82 typename ::Triangulation<dim, spacedim>::MeshSmoothing>(
85 else
86 this->set_mesh_smoothing(
87 static_cast<
88 typename ::Triangulation<dim, spacedim>::MeshSmoothing>(
90
91 this->set_mesh_smoothing(construction_data.smoothing);
92
93 // clear internal data structures
94 this->coarse_cell_ids.clear();
95 this->coarse_cell_indices.clear();
96 this->coarse_cell_index_to_coarse_cell_id_vector.clear();
97
98 // check if no locally relevant coarse-grid cells have been provided
99 if (construction_data.coarse_cell_vertices.empty())
100 {
101 // 1) create a dummy hypercube
102 currently_processing_create_triangulation_for_internal_usage = true;
103 GridGenerator::hyper_cube(*this, 0, 1, false);
104 currently_processing_create_triangulation_for_internal_usage = false;
105
106 // 2) mark cell as artificial
107 auto cell = this->begin();
108 cell->set_subdomain_id(::numbers::artificial_subdomain_id);
109 cell->set_level_subdomain_id(
111
112 // 3) set up dummy mapping between locally relevant coarse-grid cells
113 // and global cells
114 this->coarse_cell_index_to_coarse_cell_id_vector.emplace_back(
116 this->setup_coarse_cell_id_to_coarse_cell_index();
117 }
118 else
119 {
120 // 1) store `coarse-cell index to coarse-cell id`-mapping
121 this->coarse_cell_index_to_coarse_cell_id_vector =
122 construction_data.coarse_cell_index_to_coarse_cell_id;
123
124 // 2) set up `coarse-cell id to coarse-cell index`-mapping
125 this->setup_coarse_cell_id_to_coarse_cell_index();
126
127 // create locally-relevant
128 currently_processing_prepare_coarsening_and_refinement_for_internal_usage =
129 true;
130 currently_processing_create_triangulation_for_internal_usage = true;
132 construction_data);
133 currently_processing_prepare_coarsening_and_refinement_for_internal_usage =
134 false;
135 currently_processing_create_triangulation_for_internal_usage = false;
136
137 // sort cell_infos on each level separately by coarse-cell index and
138 // CellId
139 const auto cell_infos =
140 this->get_sorted_cell_infos(construction_data.cell_infos);
141
142 // 4a) set all cells artificial (and set the actual
143 // (level_)subdomain_ids in the next step)
144 for (const auto &cell : this->cell_iterators())
145 {
146 if (cell->is_active())
147 cell->set_subdomain_id(
149
150 cell->set_level_subdomain_id(
152 }
153
154 // 4b) set actual (level_)subdomain_ids
155 for (unsigned int level = 0;
156 level < cell_infos.size() && !cell_infos[level].empty();
157 ++level)
158 {
159 auto cell = this->begin(level);
160 auto cell_info = cell_infos[level].begin();
161 for (; cell_info != cell_infos[level].end(); ++cell_info)
162 {
163 // find cell that has the correct cell
164 while (cell_info->id != cell->id().template to_binary<dim>())
165 ++cell;
166
167 // subdomain id
168 if (cell->is_active())
169 cell->set_subdomain_id(cell_info->subdomain_id);
170
171 // level subdomain id
173 construct_multigrid_hierarchy)
174 cell->set_level_subdomain_id(cell_info->level_subdomain_id);
175 }
176 }
177 }
178
179 this->update_number_cache();
180 this->update_cell_relations();
181
182 // We need to sync the reference_cell vector of the integrated
183 // triangulations. It might fell out of sync due to operations inside the
184 // serial grid generator introducing or removing types of reference cells.
185 // One such example is the refinement and coarsening of pyramids
186 // introducing or potentially removing tets form the triangulation.
187 this->reference_cells =
188 Utilities::MPI::compute_set_union(this->reference_cells,
189 this->mpi_communicator);
190 }
191
192
193
194 template <int dim, int spacedim>
196 void Triangulation<dim, spacedim>::create_triangulation(
197 const std::vector<Point<spacedim>> &vertices,
198 const std::vector<::CellData<dim>> &cells,
199 const SubCellData &subcelldata)
200 {
201 Assert(
202 currently_processing_create_triangulation_for_internal_usage,
204 "You have called the overload of\n"
205 "\n"
206 " parallel::fullydistributed::Triangulation::"
207 "create_triangulation()\n"
208 "\n"
209 "which takes 3 arguments. This function is not yet implemented for "
210 "this class. If you have not called this function directly, it "
211 "might have been called via a function from the GridGenerator or "
212 "GridIn namespace. To set up a fully-distributed Triangulation with "
213 "these utility functions, please start by using the same process to "
214 "set up a serial Triangulation, parallel::shared::Triangulation, or "
215 "a parallel::distributed::Triangulation. Once that is complete use "
216 "the copy_triangulation() member function to finish setting up the "
217 "original fully distributed Triangulation. Alternatively, you can "
218 "use TriangulationDescription::Utilities::"
219 "create_description_from_triangulation() or "
220 "create_description_from_triangulation_in_groups() to create the "
221 "description of the local partition, and pass that description to "
222 "parallel::fullydistributed::Triangulation::create_triangulation()."));
223
225 cells,
226 subcelldata);
227 }
228
229
230
231 template <int dim, int spacedim>
233 void Triangulation<dim, spacedim>::copy_triangulation(
234 const ::Triangulation<dim, spacedim> &other_tria)
235 {
236 // pointer to the triangulation for which the construction data
237 // should be created (normally it is the input triangulation but
238 // in the case of a serial triangulation we create a copy which should
239 // be used)
240 const ::Triangulation<dim, spacedim> *other_tria_ptr = &other_tria;
241
242 // temporary serial triangulation (since the input triangulation is const
243 // and we might modify its subdomain_ids and level_subdomain_ids during
244 // partitioning)
246
247 // check if other triangulation is not a parallel one, which needs to be
248 // partitioned
249 if (dynamic_cast<const ::parallel::TriangulationBase<dim, spacedim>
250 *>(&other_tria) == nullptr)
251 {
252 // actually copy the serial triangulation
253 serial_tria.copy_triangulation(other_tria);
254
255 // partition triangulation
256 this->partitioner(serial_tria,
258 this->mpi_communicator));
259
260 // partition multigrid levels
261 if (this->is_multilevel_hierarchy_constructed())
263
264 // use the new serial triangulation to create the construction data
265 other_tria_ptr = &serial_tria;
266 }
267
268 // create construction data
269 const auto construction_data = TriangulationDescription::Utilities::
271 this->mpi_communicator,
272 this->settings);
273
274 // finally create triangulation
275 this->create_triangulation(construction_data);
276 }
277
278
279
280 template <int dim, int spacedim>
282 void Triangulation<dim, spacedim>::set_partitioner(
283 const std::function<void(::Triangulation<dim, spacedim> &,
284 const unsigned int)> &partitioner,
285 const TriangulationDescription::Settings &settings)
286 {
287 this->partitioner = partitioner;
288 this->settings = settings;
289 }
290
291
292
293 template <int dim, int spacedim>
295 void Triangulation<dim, spacedim>::set_partitioner(
296 const RepartitioningPolicyTools::Base<dim, spacedim> &partitioner,
297 const TriangulationDescription::Settings &settings)
298 {
299 this->partitioner_distributed = &partitioner;
300 this->settings = settings;
301 }
302
303
304
305 template <int dim, int spacedim>
307 void Triangulation<dim, spacedim>::repartition()
308 {
309 // signal that repartitioning has started
310 this->signals.pre_distributed_repartition();
311
312 // create construction_data with the help of the partitioner
313 const auto construction_data = TriangulationDescription::Utilities::
315 *this,
316 this->partitioner_distributed->partition(*this),
317 this->settings);
318
319 // clear old content
320 this->clear();
321 this->coarse_cell_ids.clear();
322 this->coarse_cell_indices.clear();
323 this->coarse_cell_index_to_coarse_cell_id_vector.clear();
324
325 // use construction_data to set up new triangulation
326 this->create_triangulation(construction_data);
327
328 // signal that repartitioning has completed
329 this->signals.post_distributed_repartition();
330 }
331
332
333
334 template <int dim, int spacedim>
336 void Triangulation<dim, spacedim>::execute_coarsening_and_refinement()
337 {
339 }
340
341
342
343 template <int dim, int spacedim>
345 bool Triangulation<dim, spacedim>::prepare_coarsening_and_refinement()
346 {
347 Assert(
348 currently_processing_prepare_coarsening_and_refinement_for_internal_usage,
349 ExcMessage("No coarsening and refinement is supported!"));
350
351 return ::Triangulation<dim, spacedim>::
352 prepare_coarsening_and_refinement();
353 }
354
355
356
357 template <int dim, int spacedim>
359 std::size_t Triangulation<dim, spacedim>::memory_consumption() const
360 {
361 const std::size_t mem =
364 coarse_cell_ids.memory_consumption() +
365 MemoryConsumption::memory_consumption(coarse_cell_indices) +
367 coarse_cell_index_to_coarse_cell_id_vector);
368 return mem;
369 }
370
371
372
373 template <int dim, int spacedim>
375 bool Triangulation<dim, spacedim>::is_multilevel_hierarchy_constructed()
376 const
377 {
378 return (
379 settings &
381 }
382
383
384
385 template <int dim, int spacedim>
387 unsigned int Triangulation<dim, spacedim>::
388 coarse_cell_id_to_coarse_cell_index(
389 const types::coarse_cell_id coarse_cell_id) const
390 {
391 // This function is called before the Triangulation is set up, so we don't
392 // know the number of global coarse cells here: hence we cannot assert
393 // that coarse_cell_id is valid
394 if (coarse_cell_id >= coarse_cell_ids.size())
396
397 const auto index = coarse_cell_ids.index_within_set(
398 static_cast<IndexSet::size_type>(coarse_cell_id));
399 if (index == numbers::invalid_dof_index)
400 return numbers::invalid_unsigned_int; // cell could not be found
401 else
402 {
403 AssertIndexRange(index, coarse_cell_indices.size());
404 return coarse_cell_indices[index];
405 }
406 }
407
408
409
410 template <int dim, int spacedim>
412 void Triangulation<dim,
413 spacedim>::setup_coarse_cell_id_to_coarse_cell_index()
414 {
415 coarse_cell_ids.clear();
416 coarse_cell_indices.clear();
417
418 std::vector<std::pair<types::coarse_cell_id, unsigned int>> id_index;
419 id_index.reserve(coarse_cell_index_to_coarse_cell_id_vector.size());
420 for (unsigned int i = 0;
421 i < coarse_cell_index_to_coarse_cell_id_vector.size();
422 ++i)
423 if (coarse_cell_index_to_coarse_cell_id_vector[i] !=
425 id_index.emplace_back(coarse_cell_index_to_coarse_cell_id_vector[i],
426 i);
427
428 // In the case of a dummy cell (see create_triangulation()), there is no
429 // valid coarse-cell id to look up: leave the index set empty.
430 if (id_index.size() == 0)
431 return;
432
433 std::sort(id_index.begin(), id_index.end());
434
435 const types::coarse_cell_id max_id = id_index.back().first;
436 std::vector<IndexSet::size_type> ids;
437 ids.reserve(id_index.size());
438 coarse_cell_indices.reserve(id_index.size());
439 for (const auto &[id, index] : id_index)
440 {
441 Assert(ids.empty() || ids.back() != id,
442 ExcMessage("Coarse-cell ids must be unique."));
443 ids.push_back(static_cast<IndexSet::size_type>(id));
444 coarse_cell_indices.push_back(index);
445 }
446
447 coarse_cell_ids.set_size(static_cast<IndexSet::size_type>(max_id) + 1);
448 coarse_cell_ids.add_indices(ids.begin(), ids.end());
449 coarse_cell_ids.compress();
450 }
451
452
453
454 template <int dim, int spacedim>
458 const unsigned int coarse_cell_index) const
459 {
460 AssertIndexRange(coarse_cell_index,
461 coarse_cell_index_to_coarse_cell_id_vector.size());
462
463 const auto coarse_cell_id =
464 coarse_cell_index_to_coarse_cell_id_vector[coarse_cell_index];
466 ExcMessage("You are trying to access a dummy cell!"));
467 return coarse_cell_id;
468 }
469
470
471 template <int dim, int spacedim>
473 void Triangulation<dim, spacedim>::update_cell_relations()
474 {
475 // Reorganize memory for local_cell_relations.
476 this->local_cell_relations.clear();
477 this->local_cell_relations.reserve(this->n_locally_owned_active_cells());
478
479 for (const auto &cell : this->active_cell_iterators())
480 if (cell->is_locally_owned())
481 this->local_cell_relations.emplace_back(
483 }
484
485
486
487 template <int dim, int spacedim>
489 void Triangulation<dim, spacedim>::save(const std::string &filename) const
490 {
491#ifdef DEAL_II_WITH_MPI
492
493 Assert(
494 this->cell_attached_data.n_attached_deserialize == 0,
496 "Not all SolutionTransfer objects have been deserialized after the last call to load()."));
497 Assert(this->n_cells() > 0,
498 ExcMessage("Can not save() an empty Triangulation."));
499
500 const int myrank =
501 Utilities::MPI::this_mpi_process(this->mpi_communicator);
502 const int mpisize =
503 Utilities::MPI::n_mpi_processes(this->mpi_communicator);
504
505 // Compute global offset for each rank.
506 unsigned int n_locally_owned_cells = this->n_locally_owned_active_cells();
507
508 unsigned int global_first_cell = 0;
509
510 int ierr = MPI_Exscan(&n_locally_owned_cells,
511 &global_first_cell,
512 1,
513 MPI_UNSIGNED,
514 MPI_SUM,
515 this->mpi_communicator);
516 AssertThrowMPI(ierr);
517
518
519 if (myrank == 0)
520 {
521 std::string fname = std::string(filename) + ".info";
522 std::ofstream f(fname);
523 f << "version nproc n_attached_fixed_size_objs n_attached_variable_size_objs n_global_active_cells"
524 << std::endl
526 version_number
527 << " " << Utilities::MPI::n_mpi_processes(this->mpi_communicator)
528 << " " << this->cell_attached_data.pack_callbacks_fixed.size()
529 << " " << this->cell_attached_data.pack_callbacks_variable.size()
530 << " " << this->n_global_active_cells() << std::endl;
531 }
532
533 // Save cell attached data.
534 this->save_attached_data(global_first_cell,
535 this->n_global_active_cells(),
536 filename);
537
538 // Save triangulation description.
539 {
540 MPI_Info info;
541 int ierr = MPI_Info_create(&info);
542 AssertThrowMPI(ierr);
543
544 const std::string fname_tria = filename + "_triangulation.data";
545
546 // Open file.
547 MPI_File fh;
548 ierr = MPI_File_open(this->mpi_communicator,
549 fname_tria.c_str(),
550 MPI_MODE_CREATE | MPI_MODE_WRONLY,
551 info,
552 &fh);
553 AssertThrowMPI(ierr);
554
555 ierr = MPI_File_set_size(fh, 0); // delete the file contents
556 AssertThrowMPI(ierr);
557 // this barrier is necessary, because otherwise others might already
558 // write while one core is still setting the size to zero.
559 ierr = MPI_Barrier(this->mpi_communicator);
560 AssertThrowMPI(ierr);
561 ierr = MPI_Info_free(&info);
562 AssertThrowMPI(ierr);
563 // ------------------
564
565 // Create construction data.
566 const auto construction_data = TriangulationDescription::Utilities::
568 this->mpi_communicator,
569 this->settings);
570
571 // Pack.
572 std::vector<char> buffer;
573 ::Utilities::pack(construction_data, buffer, false);
574
575 // Write offsets to file.
576 const std::uint64_t buffer_size = buffer.size();
577
578 std::uint64_t offset = 0;
579
580 ierr = MPI_Exscan(
581 &buffer_size,
582 &offset,
583 1,
584 Utilities::MPI::mpi_type_id_for_type<decltype(buffer_size)>,
585 MPI_SUM,
586 this->mpi_communicator);
587 AssertThrowMPI(ierr);
588
589 // Write offsets to file.
590 ierr = MPI_File_write_at(
591 fh,
592 myrank * sizeof(std::uint64_t),
593 &buffer_size,
594 1,
595 Utilities::MPI::mpi_type_id_for_type<decltype(buffer_size)>,
596 MPI_STATUS_IGNORE);
597 AssertThrowMPI(ierr);
598
599 // global position in file
600 const std::uint64_t global_position =
601 mpisize * sizeof(std::uint64_t) + offset;
602
603 // Write buffers to file.
605 fh,
606 global_position,
607 buffer.data(),
608 buffer.size(), // local buffer
609 MPI_CHAR,
610 MPI_STATUS_IGNORE);
611 AssertThrowMPI(ierr);
612
613 ierr = MPI_File_close(&fh);
614 AssertThrowMPI(ierr);
615 }
616#else
617 (void)filename;
618
619 AssertThrow(false, ExcNeedsMPI());
620#endif
621 }
622
623
624
625 template <int dim, int spacedim>
627 void Triangulation<dim, spacedim>::load(const std::string &filename)
628 {
629#ifdef DEAL_II_WITH_MPI
630 Assert(this->n_cells() == 0,
631 ExcMessage("load() only works if the Triangulation is empty!"));
632
633
634 unsigned int version, numcpus, attached_count_fixed,
635 attached_count_variable, n_global_active_cells;
636 {
637 std::string fname = std::string(filename) + ".info";
638 std::ifstream f(fname);
639 AssertThrow(f.fail() == false, ExcIO());
640 std::string firstline;
641 getline(f, firstline);
642 f >> version >> numcpus >> attached_count_fixed >>
643 attached_count_variable >> n_global_active_cells;
644 }
645
646 const auto expected_version = ::internal::
647 CellAttachedDataSerializer<dim, spacedim>::version_number;
648
649 AssertThrow(version == expected_version,
650 ExcMessage("Incompatible version found in .info file."));
651
652 // Load description and construct the triangulation.
653 {
654 const int myrank =
655 Utilities::MPI::this_mpi_process(this->mpi_communicator);
656 const int mpisize =
657 Utilities::MPI::n_mpi_processes(this->mpi_communicator);
658
659 AssertDimension(numcpus, mpisize);
660
661 // Open file.
662 MPI_Info info;
663 int ierr = MPI_Info_create(&info);
664 AssertThrowMPI(ierr);
665
666 const std::string fname_tria = filename + "_triangulation.data";
667
668 MPI_File fh;
669 ierr = MPI_File_open(this->mpi_communicator,
670 fname_tria.c_str(),
671 MPI_MODE_RDONLY,
672 info,
673 &fh);
674 AssertThrowMPI(ierr);
675
676 ierr = MPI_Info_free(&info);
677 AssertThrowMPI(ierr);
678
679 // Read offsets from file.
680 std::uint64_t buffer_size;
681
682 ierr = MPI_File_read_at(
683 fh,
684 myrank * sizeof(std::uint64_t),
685 &buffer_size,
686 1,
687 Utilities::MPI::mpi_type_id_for_type<decltype(buffer_size)>,
688 MPI_STATUS_IGNORE);
689 AssertThrowMPI(ierr);
690
691 std::uint64_t offset = 0;
692
693 ierr = MPI_Exscan(
694 &buffer_size,
695 &offset,
696 1,
697 Utilities::MPI::mpi_type_id_for_type<decltype(buffer_size)>,
698 MPI_SUM,
699 this->mpi_communicator);
700 AssertThrowMPI(ierr);
701
702 // global position in file
703 const std::uint64_t global_position =
704 mpisize * sizeof(std::uint64_t) + offset;
705
706 // Read buffers from file.
707 std::vector<char> buffer(buffer_size);
709 fh,
710 global_position,
711 buffer.data(),
712 buffer.size(), // local buffer
713 MPI_CHAR,
714 MPI_STATUS_IGNORE);
715 AssertThrowMPI(ierr);
716
717 ierr = MPI_File_close(&fh);
718 AssertThrowMPI(ierr);
719
720 auto construction_data = ::Utilities::template unpack<
722
723 // WARNING: serialization cannot handle the MPI communicator
724 // which is the reason why we have to set it here explicitly
725 construction_data.comm = this->mpi_communicator;
726
727 this->create_triangulation(construction_data);
728 }
729
730 // Compute global offset for each rank.
731 unsigned int n_locally_owned_cells = this->n_locally_owned_active_cells();
732
733 unsigned int global_first_cell = 0;
734
735 int ierr = MPI_Exscan(&n_locally_owned_cells,
736 &global_first_cell,
737 1,
738 MPI_UNSIGNED,
739 MPI_SUM,
740 this->mpi_communicator);
741 AssertThrowMPI(ierr);
742
743 Assert(this->n_global_active_cells() == n_global_active_cells,
744 ExcMessage("Number of global active cells differ!"));
745
746 // clear all of the callback data, as explained in the documentation of
747 // register_data_attach()
748 this->cell_attached_data.n_attached_data_sets = 0;
749 this->cell_attached_data.n_attached_deserialize =
750 attached_count_fixed + attached_count_variable;
751
752 // Load attached cell data, if any was stored.
753 this->load_attached_data(global_first_cell,
754 this->n_global_active_cells(),
755 this->n_locally_owned_active_cells(),
756 filename,
757 attached_count_fixed,
758 attached_count_variable);
759
760 this->update_cell_relations();
761 this->update_periodic_face_map();
762 this->update_number_cache();
763#else
764 (void)filename;
765
766 AssertThrow(false, ExcNeedsMPI());
767#endif
768 }
769
770
771
772 template <int dim, int spacedim>
774 void Triangulation<dim, spacedim>::update_number_cache()
775 {
777
778 // additionally update the number of global coarse cells
779 types::coarse_cell_id number_of_global_coarse_cells = 0;
780
781 for (const auto &cell : this->active_cell_iterators())
782 if (!cell->is_artificial())
783 number_of_global_coarse_cells =
784 std::max(number_of_global_coarse_cells,
785 cell->id().get_coarse_cell_id());
786
787 number_of_global_coarse_cells =
788 Utilities::MPI::max(number_of_global_coarse_cells,
789 this->mpi_communicator) +
790 1;
791
792 this->number_cache.number_of_global_coarse_cells =
793 number_of_global_coarse_cells;
794 }
795
796
797 } // namespace fullydistributed
798} // namespace parallel
799
800
801
802/*-------------- Explicit Instantiations -------------------------------*/
803#include "distributed/fully_distributed_tria.inst"
804
805
*  *  iterator begin()
Definition point.h:111
virtual void copy_triangulation(const Triangulation< dim, spacedim > &other_tria)
virtual std::size_t memory_consumption() const override
Definition tria_base.cc:90
virtual void update_number_cache()
Definition tria_base.cc:168
virtual void clear() override
Definition tria_base.cc:686
virtual types::coarse_cell_id coarse_cell_index_to_coarse_cell_id(const unsigned int coarse_cell_index) const override
void create_triangulation(const TriangulationDescription::Description< dim, spacedim > &construction_data) override
virtual std::size_t memory_consumption() const override
#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
#define DEAL_II_NOT_IMPLEMENTED()
bool colorize
Definition grid_out.cc:4641
unsigned int level
Definition grid_out.cc:4642
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcNeedsMPI()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertThrowMPI(error_code)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
void hyper_cube(Triangulation< dim, spacedim > &tria, const double left=0., const double right=1., const bool colorize=false)
void partition_triangulation_zorder(const unsigned int n_partitions, Triangulation< dim, spacedim > &triangulation, const bool group_siblings=true)
void partition_multigrid_levels(Triangulation< dim, spacedim > &triangulation)
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
Description< dim, spacedim > create_description_from_triangulation(const ::Triangulation< dim, spacedim > &tria, const MPI_Comm comm, const TriangulationDescription::Settings settings=TriangulationDescription::Settings::default_setting, const unsigned int my_rank_in=numbers::invalid_unsigned_int)
int File_write_at_c(MPI_File fh, MPI_Offset offset, const void *buf, MPI_Count count, MPI_Datatype datatype, MPI_Status *status)
int File_read_at_c(MPI_File fh, MPI_Offset offset, void *buf, MPI_Count count, MPI_Datatype datatype, MPI_Status *status)
unsigned int n_mpi_processes(const MPI_Comm mpi_communicator)
Definition mpi.cc:103
T max(const T &t, const MPI_Comm mpi_communicator)
std::vector< T > compute_set_union(const std::vector< T > &vec, const MPI_Comm comm)
unsigned int this_mpi_process(const MPI_Comm mpi_communicator)
Definition mpi.cc:118
const MPI_Datatype mpi_type_id_for_type
Definition mpi.h:1685
std::size_t pack(const T &object, std::vector< char > &dest_buffer, const bool allow_compression=true)
Definition utilities.h:1352
constexpr types::global_dof_index invalid_dof_index
Definition types.h:259
constexpr unsigned int invalid_unsigned_int
Definition types.h:228
constexpr types::subdomain_id artificial_subdomain_id
Definition types.h:406
constexpr types::coarse_cell_id invalid_coarse_cell_id
Definition types.h:272
STL namespace.
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
Definition types.h:30
std::vector< std::vector< CellData< dim > > > cell_infos