Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
selector_grid_elem.h
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
35// ...
37
38#ifndef __H__LIBGRID__SELECTOR_GRID_ELEM__
39#define __H__LIBGRID__SELECTOR_GRID_ELEM__
40
41#include <cassert>
42#include "selector_grid.h"
43
44namespace ug
45{
46
52// TElemSelector
54
96template <class TBaseElem>
98{
99 public:
102
103
104 public:
106 {
108 switch(typId){
109 case VERTEX: this->enable_element_support(SE_VERTEX); break;
110 case EDGE: this->enable_element_support(SE_EDGE); break;
111 case FACE: this->enable_element_support(SE_FACE); break;
112 case VOLUME: this->enable_element_support(SE_VOLUME); break;
113 default: break;
114 }
115 }
116
118 {
120 switch(typId){
121 case VERTEX: this->enable_element_support(SE_VERTEX); break;
122 case EDGE: this->enable_element_support(SE_EDGE); break;
123 case FACE: this->enable_element_support(SE_FACE); break;
124 case VOLUME: this->enable_element_support(SE_VOLUME); break;
125 default: break;
126 }
127 }
128
129 using Selector::begin;// support for iteration over Edge, ConstrainedEdge, ...
130 inline iterator begin() {return Selector::begin<TBaseElem>();}
131 inline const_iterator begin() const {return Selector::begin<TBaseElem>();}
132
133 using Selector::end;// support for iteration over Edge, ConstrainedEdge, ...
134 inline iterator end() {return Selector::end<TBaseElem>();}
135 inline const_iterator end() const {return Selector::end<TBaseElem>();}
136
137};
138
140// typedefs of the four element-selectors
141
146
148}// end of namespace
149
150#endif
Manages the elements of a grid and their interconnection.
Definition grid.h:132
specialization of ISelector for a grid of class Grid.
Definition selector_grid.h:96
specialization of ISelector for a subset of the elements in a grid of class Grid.
Definition selector_grid_elem.h:98
geometry_traits< TBaseElem >::const_iterator const_iterator
Definition selector_grid_elem.h:101
iterator begin()
Definition selector_grid_elem.h:130
const_iterator end() const
Definition selector_grid_elem.h:135
TElemSelector(Grid &grid)
Definition selector_grid_elem.h:117
iterator end()
Definition selector_grid_elem.h:134
geometry_traits< TBaseElem >::iterator iterator
Definition selector_grid_elem.h:100
TElemSelector()
Definition selector_grid_elem.h:105
const_iterator begin() const
Definition selector_grid_elem.h:131
Definition grid_base_object_traits.h:68
@ SE_VOLUME
Definition selector_interface.h:62
@ SE_VERTEX
Definition selector_interface.h:59
@ SE_NONE
Definition selector_interface.h:58
@ SE_FACE
Definition selector_interface.h:61
@ SE_EDGE
Definition selector_interface.h:60
#define UG_API
Definition ug_config.h:65
the ug namespace
TElemSelector< Face > FaceSelector
Definition selector_grid_elem.h:144
TElemSelector< Volume > VolumeSelector
Definition selector_grid_elem.h:145
TElemSelector< Edge > EdgeSelector
Definition selector_grid_elem.h:143
TElemSelector< Vertex > VertexSelector
Definition selector_grid_elem.h:142
@ VOLUME
Definition grid_base_objects.h:63
@ VERTEX
Definition grid_base_objects.h:60
@ EDGE
Definition grid_base_objects.h:61
@ FACE
Definition grid_base_objects.h:62