limited volume meshing to boundary layer only
[engrid-github.git] / src / libengrid / createboundarylayershell.h
blob127e7dc1dc9fed7e21d23bc1aa9cd3fb36610a25
1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // + +
3 // + This file is part of enGrid. +
4 // + +
5 // + Copyright 2008-2014 enGits GmbH +
6 // + +
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. +
11 // + +
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. +
16 // + +
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/>. +
19 // + +
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;
34 int m_NumIterations;
35 bool m_RemovePoints;
36 double m_RelativeHeight;
37 double m_AbsoluteHeight;
38 double m_Blending;
39 QString m_VolumeName;
40 bool m_Success;
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
64 protected:
66 QList<vtkIdType> m_BadNodes;
67 virtual bool checkEdge(vtkIdType id_node1, vtkIdType id_node2);
69 public:
71 DeleteBadNodes(QList<vtkIdType> bad_nodes);
75 friend class DeleteBadNodes;
78 private: // methods
80 QList<vtkIdType> findBadNodes(int bc);
81 QList<vtkIdType> correctAdjacentBC(int bc, int num_levels = 10);
82 void prepare();
83 void createLayerNodes(vtkIdType id_node);
84 void createPrismaticGrid();
87 protected: // methods
89 virtual void operate();
91 void reduceSurface();
92 void smoothSurface();
95 public: // methods
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