Psi4
bend.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_bend_h_
34 #define _opt_bend_h_
35 
36 #include "simple_base.h"
37 
38 namespace opt {
39 
40 class BEND : public SIMPLE_COORDINATE {
41 
42  int _bend_type; // 0 = ordinary bend
43  // 1 = linear bend - normal
44  // 2 = linear bend - orthogonal complement
45 
46  mutable double x[3]; // angle bisector for bend
47  mutable double w[3]; // orthogonal axis for bend
48  bool axes_fixed; // have w and x been fixed for displacements
49 
50  public:
51 
52  BEND(int A_in, int B_in, int C_in, bool freeze_in=false);
53 
54  ~BEND() { ; } //calls ~SIMPLE_COORDINATE()
55 
56  double value(GeomType geom) const;
57 
58  // compute and return array of first derivative (B marix elements)
59  double **DqDx(GeomType geom) const;
60 
61  // compute and return array of second derivative (B' matrix elements)
62  double **Dq2Dx2(GeomType geom) const;
63 
64  void print(std::string psi_fp, FILE *qc_fp, GeomType geom, int atom_offset=0) const;
65  void print_intco_dat(std::string psi_fp, FILE *qc_fp, int atom_offset=0) const;
66  void print_s(std::string psi_fp, FILE *qc_fp, GeomType geom) const;
67  void print_disp(std::string psi_fp, FILE *qc_fp, const double old_q, const double f_q,
68  const double dq, const double new_q, int atom_offset=0) const;
69  bool operator==(const SIMPLE_COORDINATE & s2) const;
70  std::string get_definition_string(int atom_offset=0) const;
71 
72  void make_lb_normal(void) { _bend_type = 1; }
73  void make_lb_complement(void) { _bend_type = 2; }
74 
75  bool is_linear_bend(void) const { return ((_bend_type == 1) || (_bend_type == 2)); }
76  bool is_lb_normal(void) const { return (_bend_type == 1); }
77  bool is_lb_complement(void) const { return (_bend_type == 2); }
78 
79  int g_bend_type(void) const { return _bend_type; }
80  void compute_axes(GeomType geom) const;
81  void fix_axes(void) { axes_fixed = true; }
82  void unfix_axes(void) { axes_fixed = false; }
83 
84 };
85 
86 }
87 
88 #endif
bool axes_fixed
Definition: bend.h:48
const double *const *const GeomType
Definition: simple_base.h:44
void make_lb_normal(void)
Definition: bend.h:72
simple internal coordinate base class
double x[3]
Definition: bend.h:46
int _bend_type
Definition: bend.h:42
Definition: simple_base.h:46
void print_intco_dat(std::string psi_fp, FILE *qc_fp, int atom_offset=0) const
Definition: bend.cc:310
void compute_axes(GeomType geom) const
Definition: bend.cc:73
void fix_axes(void)
Definition: bend.h:81
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: bend.cc:291
BEND(int A_in, int B_in, int C_in, bool freeze_in=false)
Definition: bend.cc:51
double ** DqDx(GeomType geom) const
Definition: bend.cc:180
std::string get_definition_string(int atom_offset=0) const
Definition: bend.cc:277
Definition: bend.h:40
bool is_lb_normal(void) const
Definition: bend.h:76
double value(GeomType geom) const
Definition: bend.cc:137
bool is_linear_bend(void) const
Definition: bend.h:75
void print(std::string psi_fp, FILE *qc_fp, GeomType geom, int atom_offset=0) const
Definition: bend.cc:265
void make_lb_complement(void)
Definition: bend.h:73
void unfix_axes(void)
Definition: bend.h:82
~BEND()
Definition: bend.h:54
bool operator==(const SIMPLE_COORDINATE &s2) const
Definition: bend.cc:349
double ** Dq2Dx2(GeomType geom) const
Definition: bend.cc:211
int g_bend_type(void) const
Definition: bend.h:79
double w[3]
Definition: bend.h:47
void print_s(std::string psi_fp, FILE *qc_fp, GeomType geom) const
Definition: bend.cc:334
bool is_lb_complement(void) const
Definition: bend.h:77