Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
manifold_assemble_util.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014-2015: G-CSC, Goethe University Frankfurt
3 * Author: Martin Stepniewski
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
34#ifndef __H_MANIFOLD_ASSEMBLE_UTIL__
35#define __H_MANIFOLD_ASSEMBLE_UTIL__
36
40
41// other ug4 modules
42#include "common/common.h"
47
48
49namespace ug {
50
51
59template <typename TElem>
61{
62 typedef typename Grid::traits<TElem>::iterator ElemIter;
63
64// Loop all elements and unmark H slaves
65 for(ElemIter eIter = grid.begin<TElem>(); eIter != grid.end<TElem>(); ++eIter)
66 {
67 TElem* e = *eIter;
69 bMarker.unmark(e);
70 else
71 bMarker.mark(e);
72 }
73}
74
83template <typename TAlgebra>
85{
86// TODO: encapsulate BoolMarker in SmartPtr in ass_tuner.h
87
88#ifdef UG_PARALLEL
89 BoolMarker* p_bMarker = new BoolMarker(grid);
90
91// Unmark H slaves in all element types
92 MarkAllElemsForAssemblyButHSlaves<Vertex>(grid, *p_bMarker);
93 MarkAllElemsForAssemblyButHSlaves<Edge>(grid, *p_bMarker);
94 MarkAllElemsForAssemblyButHSlaves<Face>(grid, *p_bMarker);
95 MarkAllElemsForAssemblyButHSlaves<Volume>(grid, *p_bMarker);
96
97// Set marker in assembly tuner
98 ass->ass_tuner()->set_marker(p_bMarker);
99#endif
100}
101
102} // end namespace ug
103
104#endif /*__H_MANIFOLD_ASSEMBLE_UTIL__*/
Definition smart_pointer.h:108
Allows to mark elements.
Definition bool_marker.h:64
void unmark(Vertex *e)
Definition bool_marker.h:120
void mark(Vertex *e, bool mark=true)
Definition bool_marker.h:109
bool contains_status(TGeomObj *o, byte status) const
returns true if the status of the given object contains the given status.
Definition distributed_grid.h:135
Manages the elements of a grid and their interconnection.
Definition grid.h:132
DistributedGridManager * distributed_grid_manager()
returns a pointer to the associated distributed grid manager.
Definition grid_impl.hpp:53
geometry_traits< TGeomObj >::iterator begin()
Definition grid_impl.hpp:164
geometry_traits< TGeomObj >::iterator end()
Definition grid_impl.hpp:175
Interface providing Jacobian and Defect of a discretization.
Definition assemble_interface.h:110
@ ES_H_SLAVE
Definition distributed_grid.h:59
the ug namespace
static void MarkAllElemsForAssemblyButHSlaves(Grid &grid, BoolMarker &bMarker)
Definition manifold_assemble_util.h:60
geometry_traits< TElem >::iterator iterator
Definition grid.h:143