Reference documentation for deal.II version 8.4.2
mapping_collection.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2016 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__mapping_collection_h
17 #define dealii__mapping_collection_h
18 
19 #include <deal.II/base/config.h>
20 #include <deal.II/base/subscriptor.h>
21 #include <deal.II/fe/mapping_q1.h>
22 #include <deal.II/fe/fe.h>
23 
24 #include <vector>
25 #include <deal.II/base/std_cxx11/shared_ptr.h>
26 
27 DEAL_II_NAMESPACE_OPEN
28 
29 namespace hp
30 {
53  template<int dim, int spacedim=dim>
54  class MappingCollection : public Subscriptor
55  {
56  public:
62 
69  explicit MappingCollection (const Mapping<dim,spacedim> &mapping);
70 
74  MappingCollection (const MappingCollection<dim,spacedim> &mapping_collection);
75 
82  void push_back (const Mapping<dim,spacedim> &new_mapping);
83 
91  const Mapping<dim,spacedim> &
92  operator[] (const unsigned int index) const;
93 
97  unsigned int size () const;
98 
103  std::size_t memory_consumption () const;
104 
105  private:
110  std::vector<std_cxx11::shared_ptr<const Mapping<dim,spacedim> > > mappings;
111  };
112 
113 
130  template<int dim, int spacedim=dim>
132  {
133  public:
138  };
139 
140 
141  /* --------------- inline functions ------------------- */
142 
143  template<int dim, int spacedim>
144  inline
145  unsigned int
147  {
148  return mappings.size();
149  }
150 
151 
152 
153  template<int dim, int spacedim>
154  inline
155  const Mapping<dim,spacedim> &
156  MappingCollection<dim,spacedim>::operator[] (const unsigned int index) const
157  {
158  Assert (index < mappings.size (),
159  ExcIndexRange (index, 0, mappings.size ()));
160  return *mappings[index];
161  }
162 
163 } // namespace hp
164 
165 
166 DEAL_II_NAMESPACE_CLOSE
167 
168 #endif
void push_back(const Mapping< dim, spacedim > &new_mapping)
static MappingCollection< dim, spacedim > mapping_collection
std::vector< std_cxx11::shared_ptr< const Mapping< dim, spacedim > > > mappings
#define Assert(cond, exc)
Definition: exceptions.h:294
Abstract base class for mapping classes.
Definition: dof_tools.h:52
Definition: hp.h:102
const Mapping< dim, spacedim > & operator[](const unsigned int index) const
std::size_t memory_consumption() const
unsigned int size() const