Reference documentation for deal.II version GIT c9976103bc 2022-12-09 17:30:02+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\}}\)
mapping_collection.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2022 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>
25 #include <deal.II/fe/mapping_q1.h>
26 
27 #include <deal.II/hp/collection.h>
28 
29 #include <memory>
30 #include <vector>
31 
33 
34 namespace 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  /* --------------- 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 FiniteElement<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 } // namespace hp
184 
185 
187 
188 #endif
void push_back(const Mapping< dim, spacedim > &new_mapping)
MappingCollection(const MappingTypes &...mappings)
MappingCollection()=default
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
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:458
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:459
Definition: hp.h:118
static MappingCollection< dim, spacedim > mapping_collection