1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + This file is part of enGrid. +
5 // + Copyright 2008-2014 enGits GmbH +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #include "nodelayeriterator.h"
23 void NodeLayerIterator::operate()
26 getSurfaceCells(m_BoundaryCodes
, surface_cells
, m_Grid
);
27 getNodesFromCells(surface_cells
, surf_nodes
, m_Grid
);
28 createNodeMapping(surf_nodes
, _surf_nodes
, m_Grid
);
29 mark2
.fill(false, nodes
.size());
31 // create pairs for first layer
32 pair
.resize(surf_nodes
.size());
33 for (int i
= 0; i
< surf_nodes
.size(); ++i
) {
35 pair
[i
].item2
= surf_nodes
[i
];
36 pair
[i
].terminate
= false;
40 while (pair
.size() > 0) {
41 mark1
.fill(false, nodes
.size());
43 for (int i
= 0; i
< pair
.size(); ++i
) {
44 if (!pair
[i
].terminate
) {
45 mark1
[_nodes
[pair
[i
].item2
]] = true;
48 for (int i
= 0; i
< pair
.size(); ++i
) {
49 if (pair
[i
].terminate
) {
50 mark1
[_nodes
[pair
[i
].item2
]] = false;
55 for (int i
= 0; i
< nodes
.size(); ++i
) {
64 for (int i
= 0; i
< nodes
.size(); ++i
) {
72 foreach (vtkIdType nodeId
, item
) {
73 mark2
[_nodes
[nodeId
]] = true;
77 for (int i
= 0; i
< item
.size(); ++i
) {
78 foreach (int j
, n2n
[_nodes
[item
[i
]]]) {
86 for (int i
= 0; i
< item
.size(); ++i
) {
87 foreach (int j
, n2n
[_nodes
[item
[i
]]]) {
89 pair
[N
].item1
= item
[i
];
90 pair
[N
].item2
= nodes
[j
];
91 pair
[N
].terminate
= false;