deal.II version GIT relicensing-2165-gc91f007519 2024-11-20 01:40:00+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
mapping_collection.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2005 - 2023 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_mapping_collection_h
16#define dealii_mapping_collection_h
17
18#include <deal.II/base/config.h>
19
21
22#include <deal.II/fe/fe.h>
23#include <deal.II/fe/mapping.h>
25
27
28#include <memory>
29#include <vector>
30
32
33namespace hp
34{
55 template <int dim, int spacedim = dim>
56 class MappingCollection : public Collection<Mapping<dim, spacedim>>
57 {
58 public:
63 MappingCollection() = default;
64
71 explicit MappingCollection(const Mapping<dim, spacedim> &mapping);
72
79 template <class... MappingTypes>
80 explicit MappingCollection(const MappingTypes &...mappings);
81
86 const MappingCollection<dim, spacedim> &mapping_collection);
87
98 std::is_nothrow_move_constructible<
99 std::vector<std::shared_ptr<const Mapping<dim, spacedim>>>>::value
100 &&std::is_nothrow_move_constructible<std::function<
101 unsigned int(const typename hp::MappingCollection<dim, spacedim> &,
102 const unsigned int)>>::value) = default;
103
107 MappingCollection<dim, spacedim> &
108 operator=(MappingCollection<dim, spacedim> &&) = default; // NOLINT
109
122 void
123 push_back(const Mapping<dim, spacedim> &new_mapping);
124 };
125
126
143 template <int dim, int spacedim = dim>
152
153
154
155 /* --------------- inline functions ------------------- */
156
157 template <int dim, int spacedim>
158 template <class... MappingTypes>
160 const MappingTypes &...mappings)
161 {
162 static_assert(
163 is_base_of_all<Mapping<dim, spacedim>, MappingTypes...>::value,
164 "Not all of the input arguments of this function "
165 "are derived from Mapping<dim, spacedim>!");
166
167 // loop over all of the given arguments and add the mappings to
168 // this collection. Inlining the definition of mapping_pointers causes
169 // internal compiler errors on GCC 7.1.1 so we define it separately:
170 const auto mapping_pointers = {
171 (static_cast<const Mapping<dim, spacedim> *>(&mappings))...};
172 for (const auto p : mapping_pointers)
173 push_back(*p);
174 }
175
176
177
178 template <int dim, int spacedim>
182
183
184#ifndef DOXYGEN
185 // Declare the existence of explicit instantiations of the class
186 // above to avoid certain warnings issues by clang and
187 // newer (LLVM-based) Intel compilers:
188 extern template struct StaticMappingQ1<1, 1>;
189 extern template struct StaticMappingQ1<1, 2>;
190 extern template struct StaticMappingQ1<1, 3>;
191 extern template struct StaticMappingQ1<2, 2>;
192 extern template struct StaticMappingQ1<2, 3>;
193 extern template struct StaticMappingQ1<3, 3>;
194
195# ifndef _MSC_VER
196 extern template MappingCollection<1, 1>
198 extern template MappingCollection<1, 2>
200 extern template MappingCollection<1, 3>
202 extern template MappingCollection<2, 2>
204 extern template MappingCollection<2, 3>
206 extern template MappingCollection<3, 3>
208# endif
209#endif
210
211} // namespace hp
212
213
215
216#endif
Abstract base class for mapping classes.
Definition mapping.h:318
MappingCollection(MappingCollection< dim, spacedim > &&) noexcept(std::is_nothrow_move_constructible< std::vector< std::shared_ptr< const Mapping< dim, spacedim > > > >::value &&std::is_nothrow_move_constructible< std::function< unsigned int(const typename hp::MappingCollection< dim, spacedim > &, const unsigned int)> >::value)=default
void push_back(const Mapping< dim, spacedim > &new_mapping)
MappingCollection(const MappingTypes &...mappings)
MappingCollection()=default
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
Definition hp.h:117
STL namespace.
static MappingCollection< dim, spacedim > mapping_collection