Reference documentation for deal.II version 9.0.0
mapping_collection.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2003 - 2017 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 
17 #include <deal.II/base/memory_consumption.h>
18 #include <deal.II/hp/mapping_collection.h>
19 
20 DEAL_II_NAMESPACE_OPEN
21 
22 
23 namespace hp
24 {
25  template <int dim, int spacedim>
28  {
29  mappings
30  .push_back (std::shared_ptr<const Mapping<dim,spacedim> >(mapping.clone()));
31  }
32 
33 
34 
35  template <int dim, int spacedim>
38  :
39  Subscriptor (),
40  // copy the array
41  // of shared
42  // pointers. nothing
43  // bad should
44  // happen -- they
45  // simply all point
46  // to the same
47  // objects, and the
48  // last one to die
49  // will delete the
50  // mappings
51  mappings (mapping_collection.mappings)
52  {}
53 
54 
55 
56  template <int dim, int spacedim>
57  std::size_t
59  {
60  return (sizeof(*this) +
62  }
63 
64 
65 
66  template <int dim, int spacedim>
67  void
69  {
70  mappings
71  .push_back (std::shared_ptr<const Mapping<dim,spacedim> >(new_mapping.clone()));
72  }
73 
74 //---------------------------------------------------------------------------
75 
76 
77  namespace
78  {
88  template <int dim, int spacedim>
90  get_static_mapping_q1()
91  {
92  static MappingQ1<dim,spacedim> mapping;
93  return mapping;
94  }
95  }
96 
97  template <int dim, int spacedim>
98  MappingCollection<dim,spacedim>
100  = MappingCollection<dim,spacedim>(get_static_mapping_q1<dim,spacedim>());
101 
102 }
103 
104 
105 
106 // explicit instantiations
107 #include "mapping_collection.inst"
108 
109 
110 DEAL_II_NAMESPACE_CLOSE
void push_back(const Mapping< dim, spacedim > &new_mapping)
MappingCollection()=default
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const =0
Abstract base class for mapping classes.
Definition: dof_tools.h:46
Definition: hp.h:102
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)