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\}}\)
source
hp
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
17
#include <
deal.II/base/memory_consumption.h
>
18
19
#include <
deal.II/hp/mapping_collection.h
>
20
21
DEAL_II_NAMESPACE_OPEN
22
23
24
namespace
hp
25
{
26
template
<
int
dim,
int
spacedim>
27
MappingCollection<dim, spacedim>::MappingCollection
(
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>
37
MappingCollection<dim, spacedim>::MappingCollection
(
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
59
MappingCollection<dim, spacedim>::memory_consumption
()
const
60
{
61
return
(
sizeof
(*
this
) +
MemoryConsumption::memory_consumption
(mappings));
62
}
63
64
65
66
template
<
int
dim,
int
spacedim>
67
void
68
MappingCollection<dim, spacedim>::push_back
(
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>
90
MappingQGeneric<dim, 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>
99
MappingCollection<dim, spacedim>
100
StaticMappingQ1<dim, spacedim>::mapping_collection
=
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
111
DEAL_II_NAMESPACE_CLOSE
StaticMappingQ1
Definition:
mapping_q1.h:88
hp::MappingCollection::MappingCollection
MappingCollection()=default
MappingQGeneric
Definition:
mapping_q_generic.h:135
memory_consumption.h
hp::MappingCollection::push_back
void push_back(const Mapping< dim, spacedim > &new_mapping)
Definition:
mapping_collection.cc:68
Subscriptor
Definition:
subscriptor.h:62
Mapping
Abstract base class for mapping classes.
Definition:
mapping.h:302
Mapping::clone
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const =0
MappingQ1
Definition:
mapping_q1.h:57
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition:
config.h:358
MemoryConsumption::memory_consumption
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
Definition:
memory_consumption.h:268
hp::MappingCollection
Definition:
mapping_collection.h:56
mapping_collection.h
hp
Definition:
hp.h:117
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition:
config.h:359
Generated by
1.8.17