Reference documentation for deal.II version 9.5.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
mapping_collection.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2005 - 2023 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
16#ifndef dealii_mapping_collection_h
17#define dealii_mapping_collection_h
18
19#include <deal.II/base/config.h>
20
22
23#include <deal.II/fe/fe.h>
24#include <deal.II/fe/mapping.h>
26
28
29#include <memory>
30#include <vector>
31
33
34namespace hp
35{
56 template <int dim, int spacedim = dim>
57 class MappingCollection : public Collection<Mapping<dim, spacedim>>
58 {
59 public:
64 MappingCollection() = default;
65
72 explicit MappingCollection(const Mapping<dim, spacedim> &mapping);
73
80 template <class... MappingTypes>
81 explicit MappingCollection(const MappingTypes &...mappings);
82
87 const MappingCollection<dim, spacedim> &mapping_collection);
88
99 std::is_nothrow_move_constructible<
100 std::vector<std::shared_ptr<const Mapping<dim, spacedim>>>>::value
101 &&std::is_nothrow_move_constructible<std::function<
102 unsigned int(const typename hp::MappingCollection<dim, spacedim> &,
103 const unsigned int)>>::value) = default;
104
108 MappingCollection<dim, spacedim> &
109 operator=(MappingCollection<dim, spacedim> &&) = default; // NOLINT
110
123 void
124 push_back(const Mapping<dim, spacedim> &new_mapping);
125 };
126
127
144 template <int dim, int spacedim = dim>
146 {
147 public:
152 };
153
154
155
156 /* --------------- inline functions ------------------- */
157
158 template <int dim, int spacedim>
159 template <class... MappingTypes>
161 const MappingTypes &...mappings)
162 {
163 static_assert(
164 is_base_of_all<Mapping<dim, spacedim>, MappingTypes...>::value,
165 "Not all of the input arguments of this function "
166 "are derived from Mapping<dim, spacedim>!");
167
168 // loop over all of the given arguments and add the mappings to
169 // this collection. Inlining the definition of mapping_pointers causes
170 // internal compiler errors on GCC 7.1.1 so we define it separately:
171 const auto mapping_pointers = {
172 (static_cast<const Mapping<dim, spacedim> *>(&mappings))...};
173 for (const auto p : mapping_pointers)
174 push_back(*p);
175 }
176
177
178
179 template <int dim, int spacedim>
183
184
185#ifndef DOXYGEN
186 // Declare the existence of explicit instantiations of the class
187 // above to avoid certain warnings issues by clang and
188 // newer (LLVM-based) Intel compilers:
189 extern template struct StaticMappingQ1<1, 1>;
190 extern template struct StaticMappingQ1<1, 2>;
191 extern template struct StaticMappingQ1<1, 3>;
192 extern template struct StaticMappingQ1<2, 2>;
193 extern template struct StaticMappingQ1<2, 3>;
194 extern template struct StaticMappingQ1<3, 3>;
195
196# ifndef _MSC_VER
197 extern template MappingCollection<1, 1>
199 extern template MappingCollection<1, 2>
201 extern template MappingCollection<1, 3>
203 extern template MappingCollection<2, 2>
205 extern template MappingCollection<2, 3>
207 extern template MappingCollection<3, 3>
209# endif
210#endif
211
212} // namespace hp
213
214
216
217#endif
Abstract base class for mapping classes.
Definition mapping.h:317
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:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
Definition hp.h:118
STL namespace.
static MappingCollection< dim, spacedim > mapping_collection