Reference documentation for deal.II version 9.2.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\}}\)
mapping_collection.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2020 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 <memory>
27 #include <vector>
28 
30 
31 namespace hp
32 {
55  template <int dim, int spacedim = dim>
57  {
58  public:
63  MappingCollection() = default;
64 
71  explicit MappingCollection(const Mapping<dim, spacedim> &mapping);
72 
77  const MappingCollection<dim, spacedim> &mapping_collection);
78 
91  void
92  push_back(const Mapping<dim, spacedim> &new_mapping);
93 
101  const Mapping<dim, spacedim> &operator[](const unsigned int index) const;
102 
106  unsigned int
107  size() const;
108 
113  std::size_t
114  memory_consumption() const;
115 
116  private:
121  std::vector<std::shared_ptr<const Mapping<dim, spacedim>>> mappings;
122  };
123 
124 
141  template <int dim, int spacedim = dim>
143  {
144  public:
149  };
150 
151 
152  /* --------------- inline functions ------------------- */
153 
154  template <int dim, int spacedim>
155  inline unsigned int
157  {
158  return mappings.size();
159  }
160 
161 
162 
163  template <int dim, int spacedim>
165  operator[](const unsigned int index) const
166  {
167  AssertIndexRange(index, mappings.size());
168  return *mappings[index];
169  }
170 
171 } // namespace hp
172 
173 
175 
176 #endif
hp::MappingCollection::MappingCollection
MappingCollection()=default
hp::MappingCollection::push_back
void push_back(const Mapping< dim, spacedim > &new_mapping)
Definition: mapping_collection.cc:68
mapping_q1.h
AssertIndexRange
#define AssertIndexRange(index, range)
Definition: exceptions.h:1649
hp::StaticMappingQ1::mapping_collection
static MappingCollection< dim, spacedim > mapping_collection
Definition: mapping_collection.h:148
hp::MappingCollection::mappings
std::vector< std::shared_ptr< const Mapping< dim, spacedim > > > mappings
Definition: mapping_collection.h:121
Subscriptor
Definition: subscriptor.h:62
hp::StaticMappingQ1
Definition: mapping_collection.h:142
Mapping
Abstract base class for mapping classes.
Definition: mapping.h:302
subscriptor.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
fe.h
hp::MappingCollection
Definition: mapping_collection.h:56
hp
Definition: hp.h:117
config.h
hp::MappingCollection::size
unsigned int size() const
Definition: mapping_collection.h:156
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
hp::MappingCollection::operator[]
const Mapping< dim, spacedim > & operator[](const unsigned int index) const
Definition: mapping_collection.h:165
hp::MappingCollection::memory_consumption
std::size_t memory_consumption() const
Definition: mapping_collection.cc:59