Psi4
process.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 PROCESS_H_
29 #define PROCESS_H_
30 
31 #include <string>
32 #include <map>
33  #include "psi4/pragma.h"
34  PRAGMA_WARNING_PUSH
35  PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS
36  #include <memory>
39 #include "psi4/libmints/typedefs.h"
40 
41 namespace psi{
42 class Molecule;
43 class Wavefunction;
44 class PointGroup;
45 class ExternalPotential;
46 class Matrix;
47 class Vector;
48 
49 namespace efp {
50  class EFP;
51 }
52 
53 class Process
54 {
55 public:
57  {
58  std::map<std::string, std::string> environment_;
59  unsigned long int memory_;
60  int nthread_;
61 
62  std::shared_ptr<Molecule> molecule_;
64  std::shared_ptr<efp::EFP> efp_;
66  std::shared_ptr<Vector> frequencies_;
67  std::shared_ptr<PointGroup> parent_symmetry_;
68 
69  std::shared_ptr<Molecule> legacy_molecule_;
70  std::shared_ptr<Wavefunction> legacy_wavefunction_;
71  public:
72  void initialize();
73 
75  std::shared_ptr<PointGroup> parent_symmetry() { return parent_symmetry_; }
77  void set_parent_symmetry(std::shared_ptr<PointGroup> pg) { parent_symmetry_ = pg; }
78  const std::string& operator()(const std::string& key) const;
79  std::string operator()(const std::string& key);
80  const std::string set(const std::string& key, const std::string& value);
81 
83  void set_molecule(const std::shared_ptr<Molecule>& molecule);
85  std::shared_ptr<Molecule> molecule() const;
86 
87 
90  void set_legacy_molecule(const std::shared_ptr<Molecule>& molecule);
92  std::shared_ptr<Molecule> legacy_molecule() const;
93 
95  void set_legacy_wavefunction(const std::shared_ptr<Wavefunction>& wavefunction);
97  std::shared_ptr<Wavefunction> legacy_wavefunction() const;
98 
99 
101  void set_gradient(const SharedMatrix g) { gradient_ = g; }
103  SharedMatrix gradient() const { return gradient_; }
104 
106  void set_frequencies(const std::shared_ptr<Vector> f) { frequencies_ = f; }
108  std::shared_ptr<Vector> frequencies() const { return frequencies_; }
109 
111  void set_efp(const std::shared_ptr<psi::efp::EFP>& efp) { efp_ = efp; }
113  std::shared_ptr<psi::efp::EFP> get_efp() const { return efp_; }
114 
116  void set_efp_torque(const SharedMatrix g) { efp_torque_ = g; }
118  SharedMatrix efp_torque() const { return efp_torque_; }
119 
121  std::map<std::string, double> globals;
122 
124  std::map<std::string, std::shared_ptr<Matrix> > arrays;
125 
127  int get_n_threads() const;
128  void set_n_threads(int nthread);
129 
131  unsigned long int get_memory() const;
132  void set_memory(unsigned long int m);
133 
136  };
137 
139 
140  static Environment get_environment();
141 };
142 }
143 
144 
145 
146 #endif /* PROCESS_H_ */
std::map< std::string, std::shared_ptr< Matrix > > arrays
Map containing current arrays.
Definition: process.h:124
void set_n_threads(int nthread)
Definition: process.cc:85
std::shared_ptr< efp::EFP > efp_
Definition: process.h:64
std::shared_ptr< Molecule > molecule_
Definition: process.h:62
void set_efp_torque(const SharedMatrix g)
Set EFP gradient manually.
Definition: process.h:116
std::shared_ptr< Wavefunction > legacy_wavefunction() const
Get wavefunction.
Definition: process.cc:169
SharedMatrix gradient() const
Get gradient manually.
Definition: process.h:103
std::shared_ptr< PointGroup > parent_symmetry_
Definition: process.h:67
void set_memory(unsigned long int m)
Definition: process.cc:182
SharedMatrix gradient_
Definition: process.h:63
std::map< std::string, double > globals
Map containing current energies.
Definition: process.h:121
const std::string set(const std::string &key, const std::string &value)
Definition: process.cc:123
Definition: process.h:56
std::shared_ptr< Molecule > molecule() const
Return active molecule.
Definition: process.cc:149
Definition: process.h:53
static Environment get_environment()
Definition: process.cc:174
static Environment environment
Definition: process.h:138
void initialize()
Definition: process.cc:59
const std::string & operator()(const std::string &key) const
Definition: process.cc:101
std::shared_ptr< PointGroup > parent_symmetry()
The symmetry of the molecule, before any displacements have been made.
Definition: process.h:75
std::shared_ptr< Vector > frequencies_
Definition: process.h:66
void set_gradient(const SharedMatrix g)
Set gradient manually.
Definition: process.h:101
std::shared_ptr< Wavefunction > legacy_wavefunction_
Definition: process.h:70
PRAGMA_WARNING_PUSH PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS PRAGMA_WARNING_POP
Definition: integraliter.cc:42
std::shared_ptr< Vector > frequencies() const
Get frequencies manually.
Definition: process.h:108
void set_legacy_wavefunction(const std::shared_ptr< Wavefunction > &wavefunction)
Set wavefunction.
Definition: process.cc:164
void set_frequencies(const std::shared_ptr< Vector > f)
Set frequencies manually.
Definition: process.h:106
Definition: liboptions.h:359
Options options
&quot;Global&quot; liboptions object.
Definition: process.h:135
int nthread_
Definition: process.h:60
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
void set_efp(const std::shared_ptr< psi::efp::EFP > &efp)
Set EFP.
Definition: process.h:111
void set_parent_symmetry(std::shared_ptr< PointGroup > pg)
Set the &quot;parent&quot; symmetry.
Definition: process.h:77
std::shared_ptr< psi::efp::EFP > get_efp() const
Get EFP.
Definition: process.h:113
int get_n_threads() const
Number of threads per process.
Definition: process.cc:185
unsigned long int get_memory() const
Memory in bytes.
Definition: process.cc:179
void set_molecule(const std::shared_ptr< Molecule > &molecule)
Set active molecule.
Definition: process.cc:144
std::shared_ptr< Molecule > legacy_molecule_
Definition: process.h:69
std::shared_ptr< Molecule > legacy_molecule() const
Return active molecule.
Definition: process.cc:159
SharedMatrix efp_torque_
Definition: process.h:65
SharedMatrix efp_torque() const
Get EFP gradient manually.
Definition: process.h:118
std::map< std::string, std::string > environment_
Definition: process.h:58
void set_legacy_molecule(const std::shared_ptr< Molecule > &molecule)
Definition: process.cc:154
unsigned long int memory_
Definition: process.h:59