Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
parallel_grid_layout_impl.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3 * Author: Sebastian Reiter
4 *
5 * This file is part of UG4.
6 *
7 * UG4 is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License version 3 (as published by the
9 * Free Software Foundation) with the following additional attribution
10 * requirements (according to LGPL/GPL v3 §7):
11 *
12 * (1) The following notice must be displayed in the Appropriate Legal Notices
13 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 *
15 * (2) The following notice must be displayed at a prominent place in the
16 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 *
18 * (3) The following bibliography is recommended for citation and must be
19 * preserved in all covered files:
20 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 * parallel geometric multigrid solver on hierarchically distributed grids.
22 * Computing and visualization in science 16, 4 (2013), 151-164"
23 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 * flexible software system for simulating pde based models on high performance
25 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU Lesser General Public License for more details.
31 */
32
33#ifndef __H__LIB_GRID__PARALLEL_GRID_LAYOUT_IMPL__
34#define __H__LIB_GRID__PARALLEL_GRID_LAYOUT_IMPL__
35
37
38namespace ug
39{
41// GridLayoutMap - implementation
42template <class TType>
44has_layout(const Key& key) const
45{
46 const typename Types<TType>::Map& m = get_layout_map<TType>();
47 return m.find(key) != m.end();
48}
49
50template <class TType>
52get_layout(const Key& key)
53{
54 typename Types<TType>::Map& m = get_layout_map<TType>();
55 return m[key];
56}
57
58template <class TType>
60get_layout(const Key& key) const
61{
62 const typename Types<TType>::Map& m = get_layout_map<TType>();
63 typename Types<TType>::Map::const_iterator iter = m.find(key);
64 if(iter == m.end()){
65 UG_THROW("The specified layout can not be found in the GridLayoutMap.");
66 }
67 return iter->second;
68}
69
70template <class TType>
73{
74 return get_layout_map<TType>().begin();
75}
76
77template <class TType>
79layouts_begin() const
80{
81 return get_layout_map<TType>().begin();
82}
83
84template <class TType>
87{
88 return get_layout_map<TType>().end();
89}
90
91template <class TType>
93layouts_end() const
94{
95 return get_layout_map<TType>().end();
96}
97
98template <class TType>
101{
102 typename Types<TType>::Map& m = get_layout_map<TType>();
103 typename Types<TType>::Map::iterator tIter = iter++;
104 m.erase(tIter);
105 return iter;
106}
107
108template <class TType>
110erase_layout(const Key& key)
111{
112 typename Types<TType>::Map& m = get_layout_map<TType>();
113 typename Types<TType>::Map::iterator iter = m.find(key);
114 if(iter != m.end())
115 m.erase(iter);
116}
117
125
126template <class TType>
129{
130 TType* dummy = NULL;// set to NULL to avoid warnings
131 return get_layout_map(dummy);
132}
133
134template <class TType>
136get_layout_map() const
137{
138 TType* dummy = NULL;// set to NULL to avoid warnings
139 return get_layout_map(dummy);
140}
141
147
153
159
165
171
177
183
189
190}// end of namespace
191
192#endif
Base-class for edges.
Definition grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition grid_base_objects.h:510
Types< TType >::Map::iterator erase_layout(typename Types< TType >::Map::iterator iter)
erases the specified layout
Definition parallel_grid_layout_impl.hpp:100
Types< Face >::Map m_faceLayoutMap
Definition parallel_grid_layout.h:261
Types< TType >::Map::iterator layouts_end()
end-iterator to the layout-map for the given type.
Definition parallel_grid_layout_impl.hpp:86
bool has_layout(const Key &key) const
checks whether the layout associated with the given key exists for the given type.
Definition parallel_grid_layout_impl.hpp:44
Types< Vertex >::Map m_vertexLayoutMap
Definition parallel_grid_layout.h:259
Types< Edge >::Map m_edgeLayoutMap
Definition parallel_grid_layout.h:260
Types< TType >::Map & get_layout_map()
Definition parallel_grid_layout_impl.hpp:128
int Key
Definition parallel_grid_layout.h:154
Types< TType >::Layout & get_layout(const Key &key)
creates the required layout if it doesn't exist already.
Definition parallel_grid_layout_impl.hpp:52
void clear()
Definition parallel_grid_layout_impl.hpp:118
Types< TType >::Map::iterator layouts_begin()
begin-iterator to the layout-map for the given type.
Definition parallel_grid_layout_impl.hpp:72
Types< Volume >::Map m_volumeLayoutMap
Definition parallel_grid_layout.h:262
Base-class for all vertex-types.
Definition grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition grid_base_objects.h:754
#define UG_THROW(msg)
Definition error.h:57
the ug namespace
defines the types that are used by a LayoutMap for a given TType.
Definition parallel_grid_layout.h:159
pcl::MultiLevelLayout< Interface > Layout
Definition parallel_grid_layout.h:161
std::map< Key, Layout > Map
Definition parallel_grid_layout.h:163