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