updated to modern VTK
[engrid-github.git] / src / libengrid / guicreatehexshell.h
blob3cf1caa4c80333d688b56571b2f014d559a93626
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 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 #ifndef GUICREATEHEXSHELL_H
23 #define GUICREATEHEXSHELL_H
25 #include "ui_guicreatehexshell.h"
26 #include "dialogoperation.h"
28 #include <QVector>
30 class GuiCreateHexShell : public DialogOperation<Ui::GuiCreateHexShell, Operation>
33 Q_OBJECT
35 private: // attributes
37 int m_NumICells;
38 int m_NumJCells;
39 int m_NumKCells;
40 int m_NumINodes;
41 int m_NumJNodes;
42 int m_NumKNodes;
43 int m_TotalNumberOfCells;
44 int m_InnerBC;
45 int m_OuterBC;
47 double m_Dx, m_Dy, m_Dz;
48 double m_X0, m_Y0, m_Z0;
49 double m_H;
50 QVector<vtkIdType> m_NodeIDs;
51 QVector<vtkIdType> m_CellIDs;
54 protected: // methods
56 virtual void before();
57 virtual void operate();
59 int indexCell(int i, int j, int k) { return i*m_NumJCells*m_NumKCells + j*m_NumKCells + k; }
60 int indexNode(int i, int j, int k) { return i*m_NumJNodes*m_NumKNodes + j*m_NumKNodes + k; }
61 void ijkCell(int idx, int& i, int& j, int& k);
62 void ijkNode(int idx, int& i, int& j, int& k);
63 void defineBoundaryCodes();
64 void createGridWithNodes(vtkUnstructuredGrid *grid);
65 void createHexCells(vtkUnstructuredGrid *grid);
66 void createOuterBoundary(vtkUnstructuredGrid *grid);
67 void createInnerBoundary(vtkUnstructuredGrid *grid);
68 void createSourceBox();
69 double x(int i) { return m_X0 + i*m_Dx; }
70 double y(int j) { return m_Y0 + j*m_Dy; }
71 double z(int k) { return m_Z0 + k*m_Dz; }
75 public: // methods
77 GuiCreateHexShell();
80 public slots:
82 void updateNumberOfCells(int = 0);
86 #endif // GUICREATEHEXSHELL_H