Reference documentation for deal.II version GIT b6bf1e606d 2022-08-11 15:25: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_q1.h>
25 
26 #include <deal.II/hp/collection.h>
27 
28 #include <memory>
29 #include <vector>
30 
32 
33 namespace 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>
145  {
146  public:
151  };
152 
153 
154  /* --------------- inline functions ------------------- */
155 
156  template <int dim, int spacedim>
157  template <class... MappingTypes>
159  const MappingTypes &...mappings)
160  {
161  static_assert(
162  is_base_of_all<Mapping<dim, spacedim>, MappingTypes...>::value,
163  "Not all of the input arguments of this function "
164  "are derived from FiniteElement<dim,spacedim>!");
165 
166  // loop over all of the given arguments and add the mappings to
167  // this collection. Inlining the definition of mapping_pointers causes
168  // internal compiler errors on GCC 7.1.1 so we define it separately:
169  const auto mapping_pointers = {
170  (static_cast<const Mapping<dim, spacedim> *>(&mappings))...};
171  for (const auto p : mapping_pointers)
172  push_back(*p);
173  }
174 
175 } // namespace hp
176 
177 
179 
180 #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:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
Definition: hp.h:118
static MappingCollection< dim, spacedim > mapping_collection