-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptimizernwchem.h
More file actions
64 lines (53 loc) · 1.58 KB
/
optimizernwchem.h
File metadata and controls
64 lines (53 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef OPTIMIZERNWCHEM_H
#define OPTIMIZERNWCHEM_H
#include "linebuffer.h"
#include "nwchemconfiguration.h"
#include "optimizer.h"
#include "qzipreader.h"
#include "qzipwriter.h"
#include <memory>
class QTemporaryDir;
class QProcess;
namespace NWChem {
class Parser;
}
class OptimizerNWChem : public Optimizer
{
Q_OBJECT
public:
explicit OptimizerNWChem(QObject *parent = nullptr);
~OptimizerNWChem();
void saveToProjFile(QZipWriter &zipfile, QString dirname) const;
static std::unique_ptr<OptimizerNWChem> fromProjFile(QString const &filename, QString dirname, MolStruct m);
void setConfiguration(NWChemConfiguration config);
NWChemConfiguration getConfiguration();
void requestSurface(QString name);
void setStructure(MolStruct m) override;
MolStruct getStructure() override;
MolDocument getResults() override;
QString getLogFile() override;
bool run() override;
void kill() override;
QString getError() override;
protected:
bool initializeOutputDirectory();
bool initializeLogFile();
QByteArray readAndLogOutput();
enum class NWChemTask {
None,
GeometryOpt,
SurfaceGen
};
NWChemTask state = NWChemTask::None;
bool optimized = false;
std::unique_ptr<QProcess> optimizeProcess;
std::unique_ptr<QTemporaryDir> dir;
NWChemConfiguration nwchemConfig;
MolDocument document;
QString error;
QList<QString> pendingSurfaces;
std::unique_ptr<NWChem::Parser> parser;
std::unique_ptr<QFile> outputFile;
LineBuffer outputLineBuffer;
};
#endif // OPTIMIZERNWCHEM_H