Psi4
fb_frag.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 
28 #ifndef _opt_fb_frag_h_
29 #define _opt_fb_frag_h_
30 
31 /* This class will define a fragment for use in situations where a fragment
32 is defined by space-fixed coordinates: 3 center-of-mass and 3 Euler angle
33 coordinates.
34 
35 This class is intended to be used for fixed-body EFP optimizations in QChem.
36 In QChem, the gradient is already computed in these space-fixed coordinates.
37 Thus, it is not necessary to write the code for the B-matrix to do an
38 optimization. Eventually, a B-matrix will be necessary in order to, for
39 example, transform a cartesian analytic Hessian into internal coordinates for
40 these optimizations.
41 
42 Since the angular coodinates could be described as linear combinations of
43 positions of atoms. We might be able to use the principle axes to define the
44 coordinates (derived by WDA), but we would still have to relate these to the
45 space-fixed coordinates of the gradient computed by QChem.
46 */
47 
48 #include "package.h"
49 
50 #include "frag.h"
51 #include "mem.h"
52 
53 namespace opt {
54 
55 class FB_FRAG : public FRAG {
56 
57  // values and forces are provided by QChem, not computed by optking
58  // they will be of dimension 6
59  double *values;
60  double *forces;
61 
62  public:
63  // we will build a dummy fragment with no atoms
64  FB_FRAG() : FRAG(0) {
65  values = init_array(6);
66  forces = init_array(6);
67  }
68 
72  }
73 
74  void set_values(double * values_in);
75  void set_forces(double * forces_in);
76 
77  double * get_values_pointer(void) const { return values; }
78  double * get_forces_pointer(void) const { return forces; }
79 
80  // we don't have a valid B matrix for these
81  // add 6 bogus stretches
82  void add_dummy_coords(int ndummy);
83 
84 // We will assign a value of 0 to these on the first iteration; subsequently, the
85 // values will be calculated as total Delta(q) from the start of the optimization
86  void print_intcos(std::string psi_fp, FILE *qc_fp);
87 
88 /* Add function to return a string definition of FB fragment, if needed
89  // return string of intco definition
90  std::string get_coord_definition(int coord_index, int atom_offset_A=0, int atom_offset_B=0);
91 */
92 
93  double **H_guess(void);
94 
95  // Tell QChem to update rotation matrix and com for FB fragment
96  void displace (int fb_frag_index, double *dq);
97 
98 };
99 
100 }
101 
102 #endif
Definition: fb_frag.h:55
void print_intcos(std::string psi_fp, FILE *qc_fp)
Definition: fb_frag.cc:66
void add_dummy_coords(int ndummy)
Definition: fb_frag.cc:56
A group of atoms, its geometry, and its internal coordinates.
Definition: frag.h:53
~FB_FRAG()
Definition: fb_frag.h:69
FB_FRAG()
Definition: fb_frag.h:64
double * get_forces_pointer(void) const
Definition: fb_frag.h:78
void free_array(double *f)
Definition: mem.cc:88
void displace(int fb_frag_index, double *dq)
Definition: fb_frag.cc:88
double ** H_guess(void)
Definition: fb_frag.cc:78
double * init_array(long int m)
Definition: mem.cc:59
double * values
Definition: fb_frag.h:59
double * forces
Definition: fb_frag.h:60
void set_values(double *values_in)
Definition: fb_frag.cc:44
double * get_values_pointer(void) const
Definition: fb_frag.h:77
void set_forces(double *forces_in)
Definition: fb_frag.cc:49