Reference documentation for deal.II version 9.3.3
\(\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 - 2021 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>
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
77 const MappingCollection<dim, spacedim> &mapping_collection);
78
85 template <class... MappingTypes>
86 explicit MappingCollection(const MappingTypes &... mappings);
87
100 void
101 push_back(const Mapping<dim, spacedim> &new_mapping);
102 };
103
104
121 template <int dim, int spacedim = dim>
123 {
124 public:
129 };
130
131
132 /* --------------- inline functions ------------------- */
133
134 template <int dim, int spacedim>
135 template <class... MappingTypes>
137 const MappingTypes &... mappings)
138 {
139 static_assert(
140 is_base_of_all<Mapping<dim, spacedim>, MappingTypes...>::value,
141 "Not all of the input arguments of this function "
142 "are derived from FiniteElement<dim,spacedim>!");
143
144 // loop over all of the given arguments and add the mappings to
145 // this collection. Inlining the definition of mapping_pointers causes
146 // internal compiler errors on GCC 7.1.1 so we define it separately:
147 const auto mapping_pointers = {
148 (static_cast<const Mapping<dim, spacedim> *>(&mappings))...};
149 for (const auto p : mapping_pointers)
150 push_back(*p);
151 }
152
153} // namespace hp
154
155
157
158#endif
void push_back(const Mapping< dim, spacedim > &new_mapping)
MappingCollection(const MappingTypes &... mappings)
MappingCollection()=default
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:402
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:403
Definition: hp.h:118
static MappingCollection< dim, spacedim > mapping_collection