updated to modern VTK
[engrid-github.git] / src / libengrid / solvertools.h
blobe0ca261676feb1b90a5ca1b2020caa884d02bbc7
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 OPENFOAMTOOLS_H
22 #define OPENFOAMTOOLS_H
24 #include <QObject>
25 #include <QProcess>
27 #include "egvtkobject.h"
28 #include "solverobject.h"
30 class SolverTools : public QObject, public EgVtkObject, public SolverObject
33 Q_OBJECT;
35 private: // attributes
37 QProcess* m_SolverProcess;
38 QProcess* m_ToolsProcess;
39 QString m_SolverBinary;
40 QString m_StrippedSolverBinary;
41 QString m_WorkingDirectory;
42 int m_NumProcesses;
43 QString m_HostFile;
44 QString m_SolverBinPath;
45 QString m_OpenFoamArch;
46 QString m_ParaviewPath;
47 QString m_MainHost;
49 QString m_Program_Solver;
50 QStringList m_Arguments_Solver;
52 QString m_Program_Tools;
53 QStringList m_Arguments_Tools;
55 QString m_FullCommand_Solver;
56 QString m_FullCommand_Tools;
58 private: // methods
60 int getArguments();
61 void runTool(QString path, QString name, QStringList args = QStringList());
62 QString getBinary(QString name) { return m_SolverBinPath + "/" + name; }
64 public:
66 SolverTools(QObject *parent = 0);
67 ~SolverTools();
69 public: // methods
73 public slots:
75 void runSolver();
76 void runDecomposePar();
77 void runPostProcessingTools();
78 void runImportFluentCase();
79 void runParaview();
80 void setCaseDirectory();
82 void stopSolverProcess();
84 // handlers Solver
85 void finishedHandler_Solver(int exitCode, QProcess::ExitStatus exitStatus);
86 void readFromStderr_Solver();
87 void readFromStdout_Solver();
88 void startedHandler_Solver();
90 // handlers Tools
91 void finishedHandler_Tools(int exitCode, QProcess::ExitStatus exitStatus);
92 void readFromStderr_Tools();
93 void readFromStdout_Tools();
94 void startedHandler_Tools();
98 #endif