deactivated deprecated start_engrid copy
[engrid.git] / src / checksurfaceintegrity.cpp
blobea2d07a61ed22e0cdd43e46b1f36186386aeafcf
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008,2009 Oliver Gloth +
7 // + +
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. +
12 // + +
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. +
17 // + +
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/>. +
20 // + +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #include "checksurfaceintegrity.h"
24 // #include "egvtkobject.h"
26 CheckSurfaceIntegrity::CheckSurfaceIntegrity() : SurfaceOperation()
28 EG_TYPENAME;
31 void CheckSurfaceIntegrity::operate()
33 cout<<"this->isWaterTight()="<<this->isWaterTight()<<endl;
34 cout<<"this->Nmin="<<this->Nmin<<endl;
35 cout<<"this->Nmax="<<this->Nmax<<endl;
36 cout<<"this->BadCells="<<this->BadCells<<endl;
39 bool CheckSurfaceIntegrity::isWaterTight()
41 setAllSurfaceCells();
42 BadCells.clear();
44 l2g_t nodes = getPartNodes();
45 g2l_t _nodes = getPartLocalNodes();
46 l2l_t n2n = getPartN2N();
48 bool first = true;
49 foreach(vtkIdType id_node1, nodes) {
50 foreach(int i_node2, n2n[_nodes[id_node1]]) {
51 vtkIdType id_node2 = nodes[i_node2];
52 QSet <vtkIdType> edge_cells;
53 int N = getEdgeCells(id_node1, id_node2,edge_cells);
54 if(first) {
55 first = false;
56 Nmin = N;
57 Nmax = N;
59 else {
60 Nmin = min(Nmin,N);
61 Nmax = max(Nmax,N);
63 if(edge_cells.size()!=2) BadCells.unite(edge_cells);
66 if( Nmin==2 && Nmax==2 ) return(true);
67 else return(false);