Line data Source code
1 : /*
2 : * Copyright (c) 2015: G-CSC, Goethe University Frankfurt
3 : * Author: Markus Breit
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 : #include "shadow_copy_adjuster.h"
34 :
35 :
36 : namespace ug {
37 :
38 :
39 0 : ShadowCopyAdjuster::~ShadowCopyAdjuster()
40 0 : {}
41 :
42 :
43 0 : void ShadowCopyAdjuster:: ref_marks_changed
44 : (
45 : IRefiner& ref,
46 : const std::vector<Vertex*>& vrts,
47 : const std::vector<Edge*>& edges,
48 : const std::vector<Face*>& faces,
49 : const std::vector<Volume*>& vols
50 : )
51 : {
52 : Grid::face_traits::secure_container fl;
53 : const size_t nv = vols.size();
54 0 : for (size_t i = 0; i < nv; ++i)
55 : {
56 0 : Volume* vol = vols[i];
57 :
58 0 : if (!ref.marked_full(vol))
59 0 : continue;
60 :
61 : bool allSidesRefineable = true;
62 0 : ref.grid()->associated_elements(fl, vol);
63 : const size_t flSz = fl.size();
64 0 : for (size_t j = 0; j < flSz; ++j)
65 : {
66 : Face* f = fl[j];
67 0 : RefinementMark curMark = ref.get_mark(f);
68 0 : if (!ref.mark(f, RM_FULL))
69 : {
70 0 : ref.mark(f, curMark);
71 : allSidesRefineable = false;
72 : break;
73 : }
74 0 : ref.mark(f, curMark);
75 : }
76 :
77 : if (!allSidesRefineable)
78 0 : ref.mark(vol, RM_CLOSURE);
79 : }
80 :
81 : Grid::edge_traits::secure_container el;
82 : const size_t nf = faces.size();
83 0 : for (size_t i = 0; i < nf; ++i)
84 : {
85 0 : Face* f = faces[i];
86 :
87 0 : if (!ref.marked_full(f))
88 0 : continue;
89 :
90 : bool allSidesRefineable = true;
91 0 : ref.grid()->associated_elements(el, f);
92 : const size_t elSz = el.size();
93 0 : for (size_t j = 0; j < elSz; ++j)
94 : {
95 : Edge* e = el[j];
96 0 : RefinementMark curMark = ref.get_mark(e);
97 0 : if (!ref.mark(e, RM_FULL))
98 : {
99 0 : ref.mark(e, curMark);
100 : allSidesRefineable = false;
101 : break;
102 : }
103 0 : ref.mark(e, curMark);
104 : }
105 :
106 : if (!allSidesRefineable)
107 0 : ref.mark(f, RM_CLOSURE);
108 : }
109 0 : }
110 :
111 :
112 : } // namespace ug
113 :
114 :
|