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 #ifndef CREATEBOUNDARYLAYER_H
22 #define CREATEBOUNDARYLAYER_H
24 #include "boundarylayeroperation.h"
25 #include "guimainwindow.h"
27 class CreateBoundaryLayerShell
: public BoundaryLayerOperation
30 private: // attributes
32 QVector
<vtkIdType
> layer_cells
;
36 double m_RelativeHeight
;
37 double m_AbsoluteHeight
;
42 VolumeDefinition m_VolDef
;
43 vtkSmartPointer
<vtkUnstructuredGrid
> m_RestGrid
;
44 vtkSmartPointer
<vtkUnstructuredGrid
> m_OriginalGrid
;
45 vtkSmartPointer
<vtkUnstructuredGrid
> m_PrismaticGrid
;
48 /// Boundary codes of the surface we want to remove points on. Normally the one next to the prismatic boundary layer.
49 QSet
<int> m_LayerAdjacentBoundaryCodes
;
51 QVector
<vtkIdType
> m_ShellNodeMap
;
52 MeshPartition m_ShellPart
;
54 QMap
<int, vec3_t
> m_LayerAdjacentOrigins
;
55 QMap
<int, vec3_t
> m_LayerAdjacentNormals
;
57 QVector
<vec3_t
> m_OriginalNodeNormals
;
60 private: // data types
62 class DeleteBadNodes
: public RemovePoints
66 QList
<vtkIdType
> m_BadNodes
;
67 virtual bool checkEdge(vtkIdType id_node1
, vtkIdType id_node2
);
71 DeleteBadNodes(QList
<vtkIdType
> bad_nodes
);
75 friend class DeleteBadNodes
;
80 QList
<vtkIdType
> findBadNodes(int bc
);
81 QList
<vtkIdType
> correctAdjacentBC(int bc
, int num_levels
= 10);
83 void createLayerNodes(vtkIdType id_node
);
84 void createPrismaticGrid();
89 virtual void operate();
97 CreateBoundaryLayerShell();
99 void setVolumeName(QString name
) { m_VolumeName
= name
; }
100 vtkUnstructuredGrid
* getPrismaticGrid() { return m_PrismaticGrid
; }
101 QVector
<int> getBoundaryLayerCodes() { return m_BoundaryLayerCodes
; }
102 bool success() { return m_Success
; }
106 #endif // CREATEBOUNDARYLAYER_H