fixed edge display for volume cells
[engrid-github.git] / src / libengrid / openfoamtools.h
blobe1b5386407c4550b49a7e3d3e1b65fe9539cefe8
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 "foamobject.h"
30 class OpenFOAMTools : public QObject, public EgVtkObject, public FoamObject {
31 Q_OBJECT;
33 private: // attributes
35 QProcess* m_SolverProcess;
36 QProcess* m_ToolsProcess;
37 QString m_SolverBinary;
38 QString m_StrippedSolverBinary;
39 QString m_WorkingDirectory;
40 int m_NumProcesses;
41 QString m_HostFile;
42 QString m_SolverBinPath;
43 QString m_OpenFoamArch;
44 QString m_ParaviewPath;
45 QString m_MainHost;
47 QString m_Program_Solver;
48 QStringList m_Arguments_Solver;
50 QString m_Program_Tools;
51 QStringList m_Arguments_Tools;
53 QString m_FullCommand_Solver;
54 QString m_FullCommand_Tools;
56 private: // methods
58 int getArguments();
59 void runTool(QString path, QString name, QStringList args = QStringList());
60 QString getBinary(QString name) { return m_SolverBinPath + "/" + name; }
62 public:
64 OpenFOAMTools(QObject *parent = 0);
65 ~OpenFOAMTools();
67 public: // methods
71 public slots:
73 void runSolver();
74 void runDecomposePar();
75 void runPostProcessingTools();
76 void runImportFluentCase();
77 void runParaview();
78 void setCaseDirectory();
80 void stopSolverProcess();
82 // handlers Solver
83 void finishedHandler_Solver(int exitCode, QProcess::ExitStatus exitStatus);
84 void readFromStderr_Solver();
85 void readFromStdout_Solver();
86 void startedHandler_Solver();
88 // handlers Tools
89 void finishedHandler_Tools(int exitCode, QProcess::ExitStatus exitStatus);
90 void readFromStderr_Tools();
91 void readFromStdout_Tools();
92 void startedHandler_Tools();
96 #endif