2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008,2009 Oliver Gloth +
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 "checksurfaceintegrity.h"
24 // #include "egvtkobject.h"
26 CheckSurfaceIntegrity::CheckSurfaceIntegrity() : SurfaceOperation()
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()
44 l2g_t nodes
= getPartNodes();
45 g2l_t _nodes
= getPartLocalNodes();
46 l2l_t n2n
= getPartN2N();
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
);
63 if(edge_cells
.size()!=2) BadCells
.unite(edge_cells
);
66 if( Nmin
==2 && Nmax
==2 ) return(true);