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