version GIT relicensing-7278-g091132d5eb 2026-12-02 03: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
default_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) 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#ifndef dealii_distributed_default_tria_h
14#define dealii_distributed_default_tria_h
15
16
17#include <deal.II/base/config.h>
18
21
24
25#include <deal.II/grid/tria.h>
26
27#include <type_traits>
28
29
31
32namespace parallel
33{
34 namespace internal
35 {
36#if !defined(DEAL_II_WITH_MPI)
37
42 template <int dim, int spacedim = dim>
44
45#elif defined(DEAL_II_WITH_P4EST)
46
52 template <int dim, int spacedim>
54 : public ::parallel::shared::Triangulation<dim, spacedim>
55 {
56 public:
58 const MPI_Comm communicator,
59 const typename ::Triangulation<dim, spacedim>::MeshSmoothing
60 smoothing,
61 const bool allow_artificial_cells)
62 : ::parallel::shared::Triangulation<dim, spacedim>(
63 communicator,
64 smoothing,
66 ::parallel::shared::Triangulation<dim,
67 spacedim>::partition_zorder)
68 {}
69 };
70
75 template <int dim, int spacedim = dim>
76 using DefaultTriangulationImpl = std::conditional_t<
77 dim == 1,
80
81#else
82
87 template <int dim, int spacedim = dim>
90
91#endif
92 } // namespace internal
93
94
95
130 template <int dim, int spacedim = dim>
133 : public internal::DefaultTriangulationImpl<dim, spacedim>
134 {
135 public:
137
151 explicit DefaultTriangulation(
152 const MPI_Comm mpi_communicator,
153 const typename ::Triangulation<dim, spacedim>::MeshSmoothing
155 const bool check_for_distorted_cells = false);
156 };
157
158
159 template <int dim, int spacedim>
162 const MPI_Comm mpi_communicator,
163 const typename ::Triangulation<dim, spacedim>::MeshSmoothing
164 smooth_grid,
165 const bool check_for_distorted_cells)
166#if !defined(DEAL_II_WITH_MPI)
167 : Base(smooth_grid, check_for_distorted_cells)
168#elif defined(DEAL_II_WITH_P4EST)
169 : Base(mpi_communicator, smooth_grid, []() {
170 if constexpr (dim == 1)
171 return true;
172 else
173 return ::parallel::distributed::Triangulation<dim, spacedim>::
174 default_setting;
175 }())
176#else
177 : Base(mpi_communicator,
178 smooth_grid,
179 /*allow_artificial_cells = */ true,
181 spacedim>::partition_zorder)
182#endif
183 {
184#if !defined(DEAL_II_WITH_MPI)
185 (void)mpi_communicator;
186#endif
187 }
188} // namespace parallel
189
190
192
193#endif
internal::DefaultTriangulationImpl< dim, spacedim > Base
DefaultSharedTriangulation(const MPI_Comm communicator, const typename ::Triangulation< dim, spacedim >::MeshSmoothing smoothing, const bool allow_artificial_cells)
#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
std::conditional_t< dim==1, DefaultSharedTriangulation< dim, spacedim >, ::parallel::distributed::Triangulation< dim, spacedim > > DefaultTriangulationImpl