-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnwchem.h
More file actions
86 lines (67 loc) · 2.24 KB
/
nwchem.h
File metadata and controls
86 lines (67 loc) · 2.24 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef NWCHEM_H
#define NWCHEM_H
#include "molstruct.h"
#include "moldocument.h"
#include "linebuffer.h"
#include "nwchemconfiguration.h"
#include <QByteArray>
#include <regex>
namespace NWChem {
QByteArray molToOptimize(MolStruct mol, QString name, NWChemConfiguration configuration);
MolDocument molFromOutputPath(QString path);
MolDocument molFromOutput(QByteArray data);
class Parser {
public:
Parser(LineBuffer &b) : buffer(b) {
}
void parse();
// Incrementally parse new data after appending it to the linebuffer,
// returns true if a new section was parsed.
bool parseIncremental(QByteArray const &data);
bool findSections(int startLine = 0, int endLine = -1);
void findTasks();
int taskForSection(int sectionIdx);
// Parse an geometry optimization or energy task
void parseGeomEnergyTask(int start, int end);
void parseFrequencyTask(int start, int end);
void parseInputSection(int sectionIdx);
void parseEnergySection(int sectionIdx);
void parseGradientSection(int sectionIdx);
void parseFrequencySection(int sectionIdx);
bool parseGeometry(int start, int end);
bool parseConnectivity(int start, int end);
bool parseOrbitals(int start, int end);
enum class SectionType {
Frequency,
GeometryOpt,
ModuleDFT,
ModuleSCF,
ModuleInput,
GradientDFT,
GradientSCF,
ModuleCPHF,
Terminate,
Invalid
};
struct SectionStartQuery {
SectionStartQuery(const char *reStr, SectionType type) : re(reStr), type(type) {}
std::regex re;
SectionType type;
};
struct SectionInfo {
SectionType type = SectionType::Invalid;
int start = -1;
};
struct TaskInfo {
SectionType type = SectionType::Invalid;
int section = -1;
int end = -1;
};
LineBuffer &buffer;
std::vector<SectionInfo> sections;
std::vector<TaskInfo> tasks;
QList<QString> optimizationSteps;
MolDocument document;
};
}
#endif // NWCHEM_H