2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008-2013 enGits GmbH +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #include "nodelayeriterator.h"
25 void NodeLayerIterator::operate()
28 getSurfaceCells(m_BoundaryCodes
, surface_cells
, m_Grid
);
29 getNodesFromCells(surface_cells
, surf_nodes
, m_Grid
);
30 createNodeMapping(surf_nodes
, _surf_nodes
, m_Grid
);
31 mark2
.fill(false, nodes
.size());
33 // create pairs for first layer
34 pair
.resize(surf_nodes
.size());
35 for (int i
= 0; i
< surf_nodes
.size(); ++i
) {
37 pair
[i
].item2
= surf_nodes
[i
];
38 pair
[i
].terminate
= false;
42 while (pair
.size() > 0) {
43 mark1
.fill(false, nodes
.size());
45 for (int i
= 0; i
< pair
.size(); ++i
) {
46 if (!pair
[i
].terminate
) {
47 mark1
[_nodes
[pair
[i
].item2
]] = true;
50 for (int i
= 0; i
< pair
.size(); ++i
) {
51 if (pair
[i
].terminate
) {
52 mark1
[_nodes
[pair
[i
].item2
]] = false;
57 for (int i
= 0; i
< nodes
.size(); ++i
) {
66 for (int i
= 0; i
< nodes
.size(); ++i
) {
74 foreach (vtkIdType nodeId
, item
) {
75 mark2
[_nodes
[nodeId
]] = true;
79 for (int i
= 0; i
< item
.size(); ++i
) {
80 foreach (int j
, n2n
[_nodes
[item
[i
]]]) {
88 for (int i
= 0; i
< item
.size(); ++i
) {
89 foreach (int j
, n2n
[_nodes
[item
[i
]]]) {
91 pair
[N
].item1
= item
[i
];
92 pair
[N
].item2
= nodes
[j
];
93 pair
[N
].terminate
= false;