Psi4
writer.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef WRITER_H
29 #define WRITER_H
30 
31  #include "psi4/pragma.h"
32  PRAGMA_WARNING_PUSH
33  PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS
34  #include <memory>
36 #include "psi4/libmints/vector.h"
37 #include <string>
38 #include "typedefs.h"
39 
40 namespace psi {
41 
42 class Molecule;
43 class Matrix;
44 class BasisSet;
45 class Wavefunction;
46 class Options;
47 
49  std::shared_ptr<Molecule> molecule_;
50  const Matrix &gradient_;
51 
52  public:
53  GradientWriter(std::shared_ptr<Molecule> mol, const Matrix &grad);
54 
55  void write(const std::string &filename);
56 };
57 
58 class FCHKWriter {
59  private:
62  std::shared_ptr<Wavefunction> wavefunction_;
63  FILE *chk_;
64  void write_number(const char *label, int value);
65  void write_number(const char *label, double value);
66  void write_sym_matrix(const char *label, const SharedMatrix &mat);
67  void write_matrix(const char *label, const SharedVector &mat);
68  void write_matrix(const char *label, const SharedMatrix &mat);
69  void write_matrix(const char *label, const std::vector<double> &mat);
70  void write_matrix(const char *label, const std::vector<int> &mat);
71 
72  public:
73  FCHKWriter(std::shared_ptr<Wavefunction> wavefunction);
74  void write(const std::string &filename);
75 };
76 
77 class MoldenWriter {
78  std::shared_ptr<Wavefunction> wavefunction_;
79 
80  public:
81  MoldenWriter(std::shared_ptr<Wavefunction> wavefunction);
82 
83  void write(const std::string &filename, std::shared_ptr<Matrix> Ca, std::shared_ptr<Matrix> Cb,
84  std::shared_ptr<Vector> Ea, std::shared_ptr<Vector> Eb, std::shared_ptr<Vector> OccA,
85  std::shared_ptr<Vector> OccB, bool dovirtual);
86 };
87 
88 class MOWriter {
89  std::shared_ptr<Wavefunction> wavefunction_;
91 
92  private:
93  double *Ca_pointer, *eps;
94  int *map, *sym, *occ, nmo, nso;
95  void write_mos(Molecule &mol);
96 
97  public:
98  MOWriter(std::shared_ptr<Wavefunction> wavefunction);
99  void write();
100 };
101 
102 class NBOWriter {
103  std::shared_ptr<Wavefunction> wavefunction_;
104 
105  public:
106  NBOWriter(std::shared_ptr<Wavefunction> wavefunction);
107 
108  void write(const std::string &filename);
109 };
110 }
111 
112 #endif // WRITER_H
MOWriter(std::shared_ptr< Wavefunction > wavefunction)
Definition: writer.cc:1061
void write_matrix(const char *label, const SharedVector &mat)
Definition: writer.cc:309
int nmo
Definition: writer.h:94
NBOWriter(std::shared_ptr< Wavefunction > wavefunction)
Definition: writer.cc:657
int * sym
Definition: writer.h:94
double * Ca_pointer
Definition: writer.h:93
MoldenWriter(std::shared_ptr< Wavefunction > wavefunction)
Definition: writer.cc:78
int * map
Definition: writer.h:94
void write(const std::string &filename)
Definition: writer.cc:377
FILE * chk_
Definition: writer.h:63
void write(const std::string &filename)
Definition: writer.cc:54
Definition: writer.h:58
void write()
Definition: writer.cc:1066
Definition: writer.h:102
Definition: writer.h:88
const Matrix & gradient_
Definition: writer.h:50
std::shared_ptr< Molecule > molecule_
Definition: writer.h:49
Definition: writer.h:48
void write_number(const char *label, int value)
Definition: writer.cc:286
std::shared_ptr< Wavefunction > wavefunction_
Definition: writer.h:103
void write(const std::string &filename, std::shared_ptr< Matrix > Ca, std::shared_ptr< Matrix > Cb, std::shared_ptr< Vector > Ea, std::shared_ptr< Vector > Eb, std::shared_ptr< Vector > OccA, std::shared_ptr< Vector > OccB, bool dovirtual)
Definition: writer.cc:83
std::shared_ptr< Wavefunction > wavefunction_
Definition: writer.h:89
void write_sym_matrix(const char *label, const SharedMatrix &mat)
Definition: writer.cc:291
PRAGMA_WARNING_PUSH PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS PRAGMA_WARNING_POP
Definition: integraliter.cc:42
double * eps
Definition: writer.h:93
Makes using matrices just a little easier.
Definition: libmints/matrix.h:71
int nso
Definition: writer.h:94
int * occ
Definition: writer.h:94
std::shared_ptr< Wavefunction > wavefunction_
Extracts information from a wavefunction object, and writes it into a formatted FCHK file...
Definition: writer.h:62
void write_mos(Molecule &mol)
Definition: writer.cc:1226
std::shared_ptr< Wavefunction > wavefunction_
Definition: writer.h:78
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
bool restricted_
Definition: writer.h:90
Molecule information class.
Definition: libmints/molecule.h:63
Definition: writer.h:77
FCHKWriter(std::shared_ptr< Wavefunction > wavefunction)
Definition: writer.cc:274
void write(const std::string &filename)
Definition: writer.cc:664
std::shared_ptr< Vector > SharedVector
Definition: adc.h:52
GradientWriter(std::shared_ptr< Molecule > mol, const Matrix &grad)
Definition: writer.cc:49