Psi4
extern.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 _psi_src_lib_libmints_extern_potential_h_
30 #define _psi_src_lib_libmints_extern_potential_h_
31 
32 #include <vector>
33 #include <utility>
34 #include <string>
35 #include <tuple>
36 #include "typedefs.h"
37 
38 namespace psi {
39 
40 class Matrix;
41 class Molecule;
42 class BasisSet;
43 
50 protected:
51 
53  int debug_;
55  int print_;
56 
58  std::string name_;
60  std::vector<std::tuple<double,double,double,double> > charges_;
62  std::vector<std::pair<std::shared_ptr<BasisSet>, SharedVector> > bases_;
63 
64 public:
69 
71  void setName(const std::string & name) { name_ = name; }
72 
74  void addCharge(double Z,double x, double y, double z);
76  void addBasis(std::shared_ptr<BasisSet> basis, SharedVector coefs);
77 
79  void clear();
80 
82  SharedMatrix computePotentialMatrix(std::shared_ptr<BasisSet> basis);
84  SharedMatrix computePotentialGradients(std::shared_ptr<BasisSet> basis, std::shared_ptr<Matrix> Dt);
86  double computeNuclearEnergy(std::shared_ptr<Molecule> mol);
87 
89  void print(std::string out_fname = "outfile") const;
90 
92  void py_print() const { print("outfile"); }
93 
95  void set_print(int print) { print_ = print; }
97  void set_debug(int debug) { debug_ = debug; }
98 
99 };
100 
101 }
102 
103 #endif
void set_print(int print)
Print flag.
Definition: extern.h:95
std::string name_
Name of potential.
Definition: extern.h:58
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
int debug_
Debug flag.
Definition: extern.h:53
double computeNuclearEnergy(std::shared_ptr< Molecule > mol)
Compute the contribution to the nuclear repulsion energy for the given molecule.
Definition: extern.cc:328
~ExternalPotential()
Destructor, does nothing.
Definition: extern.cc:53
std::vector< std::pair< std::shared_ptr< BasisSet >, SharedVector > > bases_
Auxiliary basis sets (with accompanying molecules and coefs) of diffuse charges.
Definition: extern.h:62
void print(std::string out_fname="outfile") const
Print a trace of the external potential.
Definition: extern.cc:73
void addCharge(double Z, double x, double y, double z)
Add a charge Z at (x,y,z)
Definition: extern.cc:63
SharedMatrix computePotentialGradients(std::shared_ptr< BasisSet > basis, std::shared_ptr< Matrix > Dt)
Compute the gradients due to the external potential.
Definition: extern.cc:182
void clear()
Reset the field to zero (eliminates all entries)
Definition: extern.cc:57
Definition: extern.h:49
void set_debug(int debug)
Debug flag.
Definition: extern.h:97
void addBasis(std::shared_ptr< BasisSet > basis, SharedVector coefs)
Add a basis of S auxiliary functions with DF coefficients.
Definition: extern.cc:68
SharedMatrix computePotentialMatrix(std::shared_ptr< BasisSet > basis)
Compute the external potential matrix in the given basis set.
Definition: extern.cc:109
void setName(const std::string &name)
Set name.
Definition: extern.h:71
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
ExternalPotential()
Constructur, does nothing.
Definition: extern.cc:48
void py_print() const
Python print helper.
Definition: extern.h:92
int print_
Print flag.
Definition: extern.h:55
std::shared_ptr< Vector > SharedVector
Definition: adc.h:51
std::vector< std::tuple< double, double, double, double > > charges_
&lt;Z,x,y,z&gt; array of charges
Definition: extern.h:60