Reference documentation for deal.II version 8.5.1
mapping_collection.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2003 - 2015 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 
26  template<int dim, int spacedim>
28  {}
29 
30 
31 
32  template<int dim, int spacedim>
35  {
36  mappings
37  .push_back (std_cxx11::shared_ptr<const Mapping<dim,spacedim> >(mapping.clone()));
38  }
39 
40 
41 
42  template<int dim, int spacedim>
45  :
46  Subscriptor (),
47  // copy the array
48  // of shared
49  // pointers. nothing
50  // bad should
51  // happen -- they
52  // simply all point
53  // to the same
54  // objects, and the
55  // last one to die
56  // will delete the
57  // mappings
58  mappings (mapping_collection.mappings)
59  {}
60 
61 
62 
63  template<int dim, int spacedim>
64  std::size_t
66  {
67  return (sizeof(*this) +
69  }
70 
71 
72 
73  template<int dim, int spacedim>
74  void
76  {
77  mappings
78  .push_back (std_cxx11::shared_ptr<const Mapping<dim,spacedim> >(new_mapping.clone()));
79  }
80 
81 //---------------------------------------------------------------------------
82 
83 
84  namespace
85  {
95  template<int dim, int spacedim>
97  get_static_mapping_q1()
98  {
99  static MappingQ1<dim,spacedim> mapping;
100  return mapping;
101  }
102  }
103 
104  template<int dim, int spacedim>
105  MappingCollection<dim,spacedim>
107  = MappingCollection<dim,spacedim>(get_static_mapping_q1<dim,spacedim>());
108 
109 }
110 
111 
112 
113 // explicit instantiations
114 #include "mapping_collection.inst"
115 
116 
117 DEAL_II_NAMESPACE_CLOSE
void push_back(const Mapping< dim, spacedim > &new_mapping)
Abstract base class for mapping classes.
Definition: dof_tools.h:46
Definition: hp.h:102
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
virtual Mapping< dim, spacedim > * clone() const =0