added sphere tutorial
[engrid.git] / src / guieditboundaryconditions.h
blob95c8b643b1f65008ea7d3cf3585587ff2ee84a9e
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008-2010 enGits GmbH +
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 #ifndef guieditboundaryconditions_H
24 #define guieditboundaryconditions_H
26 class GuiEditBoundaryConditions;
28 #include "boundarycondition.h"
29 #include "physicalboundarycondition.h"
30 #include "dialogoperation.h"
31 #include "guivolumedelegate.h"
32 #include "filetemplate.h"
33 #include "multipagewidgetpage.h"
34 #include "volumedefinition.h"
35 #include "multipagewidget.h"
37 #include "ui_guieditboundaryconditions.h"
39 // tabs:
40 // boundary conditions -> add/del/update
41 // boundary types -> add/del/update + change/load/save
42 // solver ->setup/save
43 // MPI -> add/del/update
45 class GuiEditBoundaryConditions : public DialogOperation<Ui::GuiEditBoundaryConditions, Operation>
48 Q_OBJECT;
50 private: // attributes
52 // variables to store settings locally while changing them. They will be copied over to their GuiMainWindow counterparts once OK is clicked.
53 QMap<int, BoundaryCondition> *m_BcMap;
54 QMap<QString, VolumeDefinition> m_VolMap;
55 QMap<QString, PhysicalBoundaryCondition> m_PhysicalBoundaryConditionsMap;
57 private: // utility attributes
59 GuiVolumeDelegate *delegate;
60 QVector <MultiPageWidgetPage*> m_page_vector;
61 PhysicalBoundaryCondition m_PBC_current;
63 MultiPageWidget* m_multipagewidget_Solver;
65 /// vector to hold the binaries
66 QVector <QString> m_SolverBinary;
68 public:
70 GuiEditBoundaryConditions();
71 virtual ~GuiEditBoundaryConditions();
72 void setMap(QMap<int, BoundaryCondition> *a_bcmap) { m_BcMap = a_bcmap; }
74 private:
76 virtual void before();
79 protected: // methods
81 virtual void operate();
84 // Boundary conditions tab
86 protected:
88 void updateVol();
90 protected slots:
92 void addVol();
93 void delVol();
96 // Boundary types tab
98 protected:
100 void updatePhysicalBoundaryConditions();
101 void loadPhysicalValues();
102 void savePhysicalValues();
104 protected slots:
105 void addBoundaryType();
106 void deleteBoundaryType();
107 void changePhysicalValues();
110 // Solver tab
112 protected:
114 void setupSolvers();
115 void saveSolverParameters();
117 protected slots:
120 // MPI configuration tab
122 protected:
124 void loadMpiParameters();
125 void saveMpiParameters();
126 QString tableToString();
127 void stringToTable(QString hostfile_txt);
129 protected slots:
131 void addProcess();
132 void deleteProcess();
133 void importHostFile();
134 void exportHostFile();
139 #endif