Psi4
combo_coordinates.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_combo_coordinates_h_
34 #define _opt_combo_coordinates_h_
35 
36 #include <vector>
37 #include <string>
38 
39 using std::vector;
40 using std::string;
41 
42 namespace opt {
43 
45 
46  private:
47 
48  vector<SIMPLE_COORDINATE *> simples; // collection of simple and/or cartesian coordinates
49  vector<vector<int> > index; // collection of coordinate index for linear combination
50  vector<vector<double> > coeff; // collection of coefficients for linear combination
51 
52  public:
53 
54  friend class FRAG; // these can all add coordinates
55  friend class FB_FRAG;
56  friend class INTERFRAG;
57 
58  // Get all values.
59  double *values(GeomType geom) const;
60 
61  // Get one value.
62  double value(GeomType geom, int lookup) const;
63 
64  // Fills in a provided B matrix row for one coordinate.
65  // If the desired cartesian column indices/dimension spans the molecule, i.e.,
66  // possibly more than just one fragment, then provide the atom offset.
67  bool DqDx(GeomType geom, int lookup, double *dqdx, int frag_atom_offset=0) const;
68 
69  // Fills in a B' derivative matrix for one coordinate.
70  // If the desired cartesian indices/dimension spans the molecule, i.e.,
71  // possibly more than just one fragment, then provide the atom offset.
72  bool Dq2Dx2(GeomType geom, int lookup, double **dq2dx2, int frag_atom_offset=0) const;
73 
74  // For error message reporting, describe coordinate briefly
75  string get_coord_definition(int lookup, int frag_atom_offset) const;
76 
77  // Clear current combination coordinates. Leave simples in place.
78  void clear_combos(void);
79 
80  // Remove a particular combination coordinate by index.
81  void erase_combo(int cc);
82 
83  // Print s vectors.
84  void print_s(std::string psi_fp, FILE *qc_fp, GeomType geom) const;
85 
86  // Print one coordinate
87  void print(std::string psi_fp, FILE *qc_fp, int cc, GeomType geom, int off) const;
88 
89  // Function to print the change in a combo coordinate
90  void print_disp(std::string psi_fp, FILE *qc_fp, int lookup, const double q_orig, const double f_q,
91  const double dq, const double new_q, int atom_offset) const;
92 
93  // Transform vector from simples to combination via linear combination
94  double * transform_simples_to_combo(double *arr_simples) const;
95 
96  // Transform vector from simples to combination via linear combination
97  double ** transform_simples_to_combo(double **mat_simples) const;
98 
99  int Nsimples(void) const { return simples.size(); }
100 
101 };
102 
103 }
104 
105 #endif
const double *const *const GeomType
Definition: simple_base.h:44
Definition: fb_frag.h:55
int Nsimples(void) const
Definition: combo_coordinates.h:99
double value(GeomType geom, int lookup) const
Definition: combo_coordinates.cc:43
void print_s(std::string psi_fp, FILE *qc_fp, GeomType geom) const
Definition: combo_coordinates.cc:135
A group of atoms, its geometry, and its internal coordinates.
Definition: frag.h:53
void print_disp(std::string psi_fp, FILE *qc_fp, int lookup, const double q_orig, const double f_q, const double dq, const double new_q, int atom_offset) const
Definition: combo_coordinates.cc:160
double * values(GeomType geom) const
Definition: combo_coordinates.cc:53
Definition: combo_coordinates.h:44
bool Dq2Dx2(GeomType geom, int lookup, double **dq2dx2, int frag_atom_offset=0) const
Definition: combo_coordinates.cc:91
vector< SIMPLE_COORDINATE * > simples
Definition: combo_coordinates.h:48
double * transform_simples_to_combo(double *arr_simples) const
Definition: combo_coordinates.cc:191
void print(std::string psi_fp, FILE *qc_fp, int cc, GeomType geom, int off) const
Definition: combo_coordinates.cc:147
void erase_combo(int cc)
Definition: combo_coordinates.cc:127
bool DqDx(GeomType geom, int lookup, double *dqdx, int frag_atom_offset=0) const
Definition: combo_coordinates.cc:65
vector< vector< int > > index
Definition: combo_coordinates.h:49
vector< vector< double > > coeff
Definition: combo_coordinates.h:50
Definition: interfrag.h:68
void clear_combos(void)
Definition: combo_coordinates.cc:117
string get_coord_definition(int lookup, int frag_atom_offset) const
Definition: combo_coordinates.cc:176