Psi4
stre.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 
33 #ifndef _opt_stretch_h_
34 #define _opt_stretch_h_
35 
36 #include "simple_base.h"
37 
38 namespace opt {
39 
40 class STRE : public SIMPLE_COORDINATE {
41 
42  bool hbond; // whether stretch is a hydrogen bond
43  bool inverse_stre; // whether stretch is really 1/R
44 
45  public:
46 
47  STRE(int A_in, int B_in, bool freeze_in=false);
48 
49  ~STRE() { } // also calls ~SIMPLE_COORDINATE()
50 
51  double value(GeomType geom) const;
52 
53  // compute and return array of first derivative (B matrix elements)
54  // returned matrix is [atom][x,y,z]
55  double **DqDx(GeomType geom) const;
56 
57  // compute and return array of second derivative (B' matrix elements)
58  // returned matrix is order 3N cart by 3N cart
59  double **Dq2Dx2(GeomType geom) const;
60 
61  void print(std::string psi_fp, FILE *qc_fp, GeomType geom, int atom_offset=0) const;
62  void print_intco_dat(std::string psi_fp, FILE *qc_fp, int atom_offset=0) const;
63  void print_s(std::string psi_fp, FILE *qc_fp, GeomType geom) const;
64  void print_disp(std::string psi_fp, FILE *qc_fp, const double old_q, const double f_q,
65  const double dq, const double new_q, int atom_offset = 0) const;
66  bool operator==(const SIMPLE_COORDINATE & s2) const;
67  std::string get_definition_string(int atom_offset=0) const;
68 
69  void set_hbond(bool val) { hbond = val; }
70  bool is_hbond(void) const { return hbond; }
71  void make_inverse_stre(void) { inverse_stre = true; }
72  bool is_inverse_stre(void) const { return inverse_stre; }
73 
74 };
75 
76 }
77 
78 #endif
const double *const *const GeomType
Definition: simple_base.h:44
Definition: stre.h:40
simple internal coordinate base class
double value(GeomType geom) const
Definition: stre.cc:67
void set_hbond(bool val)
Definition: stre.h:69
Definition: simple_base.h:46
bool is_hbond(void) const
Definition: stre.h:70
STRE(int A_in, int B_in, bool freeze_in=false)
Definition: stre.cc:49
~STRE()
Definition: stre.h:49
void print_s(std::string psi_fp, FILE *qc_fp, GeomType geom) const
Definition: stre.cc:215
void print_disp(std::string psi_fp, FILE *qc_fp, const double old_q, const double f_q, const double dq, const double new_q, int atom_offset=0) const
Definition: stre.cc:197
void make_inverse_stre(void)
Definition: stre.h:71
bool operator==(const SIMPLE_COORDINATE &s2) const
Definition: stre.cc:224
void print(std::string psi_fp, FILE *qc_fp, GeomType geom, int atom_offset=0) const
Definition: stre.cc:150
bool is_inverse_stre(void) const
Definition: stre.h:72
bool hbond
Definition: stre.h:42
double ** Dq2Dx2(GeomType geom) const
Definition: stre.cc:113
void print_intco_dat(std::string psi_fp, FILE *qc_fp, int atom_offset=0) const
Definition: stre.cc:178
bool inverse_stre
Definition: stre.h:43
double ** DqDx(GeomType geom) const
Definition: stre.cc:88
std::string get_definition_string(int atom_offset=0) const
Definition: stre.cc:161