MPQC  2.3.1
fdhess.h
1 //
2 // fdhess.h
3 //
4 // Copyright (C) 1997 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit 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 Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _chemistry_molecule_fdhess_h
29 #define _chemistry_molecule_fdhess_h
30 
31 #ifdef __GNUC__
32 #pragma interface
33 #endif
34 
35 #include <iostream>
36 
37 #include <chemistry/molecule/hess.h>
38 #include <chemistry/molecule/energy.h>
39 
40 namespace sc {
41 
46  protected:
48  // In case molecule must be given in lower symmetry, its actual
49  // symmetry and the symmetry used to compute displacements is this
50  Ref<PointGroup> displacement_point_group_;
51  // The molecule's original point group for restoration at the end.
52  Ref<PointGroup> original_point_group_;
53  // The molecule's original geometry for restoration at the end and
54  //computing displacements.
55  RefSCVector original_geometry_;
56  // the cartesian displacement size in bohr
57  double disp_;
58  // the accuracy for gradient calculations
59  double accuracy_;
60  // the number of completed displacements
61  int ndisp_;
62  // the number of irreps in the displacement point group
63  int nirrep_;
64  // whether or not to attempt a restart
65  int restart_;
66  // the name of the restart file
67  char *restart_file_;
68  // whether or not to checkpoint
69  int checkpoint_;
70  // the name of the checkpoint file
71  char *checkpoint_file_;
72  // only do the totally symmetric displacements
73  int only_totally_symmetric_;
74  // eliminate the cubic terms by doing an extra displacement for
75  //each of the totally symmetry coordinates
76  int eliminate_cubic_terms_;
77  // use the gradient at the initial geometry to remove first order terms
78  // (important if not at equilibrium geometry)
79  int do_null_displacement_;
80  // print flag
81  int debug_;
82  // a basis for the symmetrized cartesian coordinates
83  RefSCMatrix symbasis_;
84  // the gradients at each of the displacements
85  RefSCVector *gradients_;
86 
87  void get_disp(int disp, int &irrep, int &index, double &coef);
88  void do_hess_for_irrep(int irrep,
89  const RefSymmSCMatrix &dhessian,
90  const RefSymmSCMatrix &xhessian);
91  void init();
92  void restart();
93  public:
153  void save_data_state(StateOut&);
154 
158  int ndisplace() const;
159  int ndisplacements_done() const { return ndisp_; }
160  RefSCMatrix displacements(int irrep) const;
161  void displace(int disp);
162  void original_geometry();
163  void set_gradient(int disp, const RefSCVector &grad);
164  void checkpoint_displacements(StateOut&);
165  void restore_displacements(StateIn&);
166 
170 
172  void set_checkpoint(int c) { checkpoint_ = c; }
174  int checkpoint() const { return checkpoint_; }
175 
177  MolecularEnergy* energy() const;
178 
179  Ref<SCMatrixKit> matrixkit() const { return mole_->matrixkit(); }
180  RefSCDimension d3natom() const { return mole_->moldim(); }
181 };
182 
183 }
184 
185 #endif
186 
187 // Local Variables:
188 // mode: c++
189 // c-file-style: "CLJ"
190 // End:
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:261
sc::RefSCMatrix
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
sc::Ref
A template class that maintains references counts.
Definition: ref.h:332
sc::MolecularHessian
MolecularHessian is an abstract class that computes a molecule's second derivatives of the energy wit...
Definition: hess.h:47
sc::StateIn
Restores objects that derive from SavableState.
Definition: statein.h:70
sc::FinDispMolecularHessian::set_energy
void set_energy(const Ref< MolecularEnergy > &energy)
Some MolecularHessian specializations require a molecular energy object.
sc::MolecularEnergy
The MolecularEnergy abstract class inherits from the Function class.
Definition: energy.h:48
sc::FinDispMolecularHessian::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::RefSCVector
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
sc::StateOut
Serializes objects that derive from SavableState.
Definition: stateout.h:61
sc::FinDispMolecularHessian::compute_hessian_from_gradients
RefSymmSCMatrix compute_hessian_from_gradients()
These members are used to compute a cartesian hessian from gradients at finite displacements.
sc::FinDispMolecularHessian
Computes the molecular hessian by finite displacements of gradients.
Definition: fdhess.h:45
sc::FinDispMolecularHessian::set_checkpoint
void set_checkpoint(int c)
Set checkpoint option.
Definition: fdhess.h:172
sc::FinDispMolecularHessian::energy
MolecularEnergy * energy() const
This returns a MolecularEnergy object, if used by this specialization.
sc::FinDispMolecularHessian::cartesian_hessian
RefSymmSCMatrix cartesian_hessian()
This returns the cartesian hessian.
sc::FinDispMolecularHessian::checkpoint
int checkpoint() const
Return the current value of the checkpoint option.
Definition: fdhess.h:174

Generated at Sun Jan 26 2020 23:33:03 for MPQC 2.3.1 using the documentation package Doxygen 1.8.16.