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