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 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 PROCESS_H_
30 #define PROCESS_H_
31 
32 #include <string>
33 #include <map>
34  #include "psi4/pragma.h"
35  PRAGMA_WARNING_PUSH
36  PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS
37  #include <memory>
40 #include "psi4/libmints/typedefs.h"
42 
43  namespace psi {
44  class Molecule;
45  class Wavefunction;
46  class PointGroup;
47  class Matrix;
48  class Vector;
49 
50  namespace efp {
51  class EFP;
52  }
53 
54  class Process {
55  public:
56  class Environment {
57  std::map<std::string, std::string> environment_;
58  size_t memory_;
59  int nthread_;
60 
61  std::shared_ptr<Molecule> molecule_;
63  std::shared_ptr<efp::EFP> efp_;
65  std::shared_ptr<Vector> frequencies_;
66  std::shared_ptr<PointGroup> parent_symmetry_;
67 
68  std::shared_ptr<Molecule> legacy_molecule_;
69  std::shared_ptr<Wavefunction> legacy_wavefunction_;
70 
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 
89  void set_legacy_molecule(const std::shared_ptr<Molecule>& molecule);
91  std::shared_ptr<Molecule> legacy_molecule() const;
92 
94  void set_legacy_wavefunction(const std::shared_ptr<Wavefunction>& wavefunction);
96  std::shared_ptr<Wavefunction> legacy_wavefunction() const;
97 
99  void set_gradient(const SharedMatrix g) { gradient_ = g; }
101  SharedMatrix gradient() const { return gradient_; }
102 
104  void set_frequencies(const std::shared_ptr<Vector> f) { frequencies_ = f; }
106  std::shared_ptr<Vector> frequencies() const { return frequencies_; }
107 
109  void set_efp(const std::shared_ptr<psi::efp::EFP>& efp) { efp_ = efp; }
111  std::shared_ptr<psi::efp::EFP> get_efp() const { return efp_; }
112 
114  void set_efp_torque(const SharedMatrix g) { efp_torque_ = g; }
116  SharedMatrix efp_torque() const { return efp_torque_; }
117 
119  std::map<std::string, double> globals;
120 
122  std::map<std::string, std::shared_ptr<Matrix> > arrays;
123 
125  int get_n_threads() const;
126  void set_n_threads(int nthread);
127 
129  size_t get_memory() const;
130  void set_memory(size_t m);
131 
134  };
135 
137 
138  static Environment get_environment();
139  };
140  }
141 
142 #endif /* PROCESS_H_ */
std::map< std::string, std::shared_ptr< Matrix > > arrays
Map containing current arrays.
Definition: process.h:122
void set_n_threads(int nthread)
Definition: process.cc:87
std::shared_ptr< efp::EFP > efp_
Definition: process.h:63
std::shared_ptr< Molecule > molecule_
Definition: process.h:61
void set_efp_torque(const SharedMatrix g)
Set EFP gradient manually.
Definition: process.h:114
std::shared_ptr< Wavefunction > legacy_wavefunction() const
Get wavefunction.
Definition: process.cc:159
SharedMatrix gradient() const
Get gradient manually.
Definition: process.h:101
size_t get_memory() const
Memory in bytes.
Definition: process.cc:165
std::shared_ptr< PointGroup > parent_symmetry_
Definition: process.h:66
SharedMatrix gradient_
Definition: process.h:62
std::map< std::string, double > globals
Map containing current energies.
Definition: process.h:119
const std::string set(const std::string &key, const std::string &value)
Definition: process.cc:122
Definition: process.h:56
std::shared_ptr< Molecule > molecule() const
Return active molecule.
Definition: process.cc:146
Definition: process.h:54
static Environment get_environment()
Definition: process.cc:163
static Environment environment
Definition: process.h:136
void initialize()
Definition: process.cc:63
const std::string & operator()(const std::string &key) const
Definition: process.cc:102
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:65
void set_gradient(const SharedMatrix g)
Set gradient manually.
Definition: process.h:99
std::shared_ptr< Wavefunction > legacy_wavefunction_
Definition: process.h:69
PRAGMA_WARNING_PUSH PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS PRAGMA_WARNING_POP
Definition: integraliter.cc:43
std::shared_ptr< Vector > frequencies() const
Get frequencies manually.
Definition: process.h:106
void set_legacy_wavefunction(const std::shared_ptr< Wavefunction > &wavefunction)
Set wavefunction.
Definition: process.cc:154
void set_frequencies(const std::shared_ptr< Vector > f)
Set frequencies manually.
Definition: process.h:104
Definition: liboptions.h:355
Options options
&quot;Global&quot; liboptions object.
Definition: process.h:133
int nthread_
Definition: process.h:59
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
void set_efp(const std::shared_ptr< psi::efp::EFP > &efp)
Set EFP.
Definition: process.h:109
void set_parent_symmetry(std::shared_ptr< PointGroup > pg)
Set the &quot;parent&quot; symmetry.
Definition: process.h:77
size_t memory_
Definition: process.h:58
std::shared_ptr< psi::efp::EFP > get_efp() const
Get EFP.
Definition: process.h:111
int get_n_threads() const
Number of threads per process.
Definition: process.cc:169
void set_molecule(const std::shared_ptr< Molecule > &molecule)
Set active molecule.
Definition: process.cc:142
std::shared_ptr< Molecule > legacy_molecule_
Definition: process.h:68
std::shared_ptr< Molecule > legacy_molecule() const
Return active molecule.
Definition: process.cc:152
SharedMatrix efp_torque_
Definition: process.h:64
void set_memory(size_t m)
Definition: process.cc:167
SharedMatrix efp_torque() const
Get EFP gradient manually.
Definition: process.h:116
std::map< std::string, std::string > environment_
Definition: process.h:57
void set_legacy_molecule(const std::shared_ptr< Molecule > &molecule)
Definition: process.cc:148