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