1 |
|
---|
2 | #ifdef __GNUC__
|
---|
3 | #pragma interface
|
---|
4 | #endif
|
---|
5 |
|
---|
6 | #ifndef _chemistry_qc_psi_exenv_h
|
---|
7 | #define _chemistry_qc_psi_exenv_h
|
---|
8 |
|
---|
9 | using namespace std;
|
---|
10 |
|
---|
11 | #include <string>
|
---|
12 | #include <chemistry/qc/psi/psiinput.h>
|
---|
13 | #include <chemistry/qc/psi/psifile11.h>
|
---|
14 |
|
---|
15 | namespace sc {
|
---|
16 |
|
---|
17 | /// PsiExEnv specifies a Psi calculation
|
---|
18 |
|
---|
19 | class PsiExEnv: public DescribedClass {
|
---|
20 |
|
---|
21 | // Static Psi info
|
---|
22 | static string inputname_;
|
---|
23 | static string file11name_;
|
---|
24 | static int ckptfile_;
|
---|
25 |
|
---|
26 | // Defaults
|
---|
27 | static string defaultpsiprefix_;
|
---|
28 | static string defaultcwd_;
|
---|
29 | static string defaultfileprefix_;
|
---|
30 | static string defaultstdout_;
|
---|
31 | static string defaultstderr_;
|
---|
32 |
|
---|
33 | // Calculation-specific info
|
---|
34 | string psiprefix_;
|
---|
35 | string cwd_; // working directory where all files will be placed
|
---|
36 | string fileprefix_;
|
---|
37 | string stdout_; // Standard output of psi modules
|
---|
38 | string stderr_; // Standard error of psi modules
|
---|
39 | int nscratch_;
|
---|
40 | string *scratch_;
|
---|
41 | Ref<PsiInput> psiinput_;
|
---|
42 | Ref<PsiFile11> psifile11_;
|
---|
43 |
|
---|
44 | // Add the following to the PATH environmental variable
|
---|
45 | void add_to_path(const string &);
|
---|
46 |
|
---|
47 | public:
|
---|
48 | PsiExEnv(const Ref<KeyVal>&);
|
---|
49 | PsiExEnv(char *cwd, char *fileprefix, int nscratch, char **scratch);
|
---|
50 | ~PsiExEnv();
|
---|
51 |
|
---|
52 | /// Returns the PsiInput object which PsiExEnv uses
|
---|
53 | Ref<PsiInput> get_psi_input() const { return psiinput_;};
|
---|
54 | /// Returns the PsiFile11 object which PsiExEnv uses
|
---|
55 | Ref<PsiFile11> get_psi_file11() const { return psifile11_;};
|
---|
56 |
|
---|
57 | /// Executes Psi input+driver
|
---|
58 | int run_psi();
|
---|
59 | /// Executes a Psi module
|
---|
60 | int run_psi_module(char *);
|
---|
61 |
|
---|
62 | /// Returns current working directory
|
---|
63 | string get_cwd() const { return cwd_;};
|
---|
64 | /// Returns the Psi file prefix
|
---|
65 | string get_fileprefix() const { return fileprefix_; };
|
---|
66 | /// Returns the number of scratch locations
|
---|
67 | int get_nscratch() const { return nscratch_; };
|
---|
68 | /// Returns the ith scratch location
|
---|
69 | string get_scratch(int i) const { return scratch_[i]; };
|
---|
70 |
|
---|
71 | void print(std::ostream&o=ExEnv::out0()) const;
|
---|
72 | };
|
---|
73 |
|
---|
74 | }
|
---|
75 |
|
---|
76 | #endif
|
---|