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