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