~ubuntu-branches/ubuntu/precise/psicode/precise

« back to all changes in this revision

Viewing changes to src/bin/optking/grad_energy.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*** GRAD_ENERGY computes a file11 entry from energies in chkpt Rollin King, 2002 ***/ 
2
 
 
3
 
#if HAVE_CMATH
4
 
# include <cmath>
5
 
#else
6
 
# include <math.h>
7
 
#endif
8
 
 
9
 
extern "C" {
10
 
#include <stdio.h>
 
1
/*! \file
 
2
    \ingroup OPTKING
 
3
    \brief GRAD_ENERGY computes a file11 entry from energies in chkpt Rollin King, 2002
 
4
*/
 
5
 
 
6
#include <cmath>
 
7
#include <cstdio>
11
8
#include <libchkpt/chkpt.h>
12
 
#include <stdlib.h>
13
 
#include <string.h>
14
 
#include <ctype.h>
 
9
#include <cstdlib>
 
10
#include <cstring>
 
11
#include <cctype>
15
12
#include <libciomr/libciomr.h>
16
13
#include <libipv1/ip_lib.h>
17
14
#include <physconst.h>
18
15
#include <libpsio/psio.h>
19
16
#include <psifiles.h>
20
 
}
21
17
 
22
18
#define EXTERN
23
19
#include "opt.h"
28
24
#include "bond_lengths.h"
29
25
#define MAX_LINE 132
30
26
 
 
27
namespace psi { namespace optking {
 
28
 
31
29
double **compute_B(internals &simples, salc_set &symm);
32
30
 
33
31
void grad_energy(cartesians &carts, internals &simples, salc_set &symm) {
60
58
    fp_energy_dat = fopen("energy.dat", "r");
61
59
    rewind (fp_energy_dat);
62
60
    line1 = new char[MAX_LINE+1];
63
 
    for (i=0; i<num_disps; ++i) {
64
 
      fgets(line1, MAX_LINE, fp_energy_dat);
65
 
      sscanf(line1, "%lf", &(energies[i]));
 
61
    // ACS (11/06) Allow external program to be used to compute energies
 
62
    if(optinfo.external_energies){
 
63
      /* Read the first energy and dump it as the reference energy */
 
64
      double temp;
 
65
      fscanf(fp_energy_dat,"%lf",&temp);
 
66
      open_PSIF();
 
67
      psio_write_entry(PSIF_OPTKING, "OPT: Reference energy",(char *) &(temp), sizeof(double));
 
68
      close_PSIF();
 
69
    }
 
70
    for (i=0; i<num_disps; i++) {
 
71
      fscanf(fp_energy_dat,"%lf",&(energies[i]));
66
72
    }
67
73
    fclose(fp_energy_dat);
68
74
    delete [] line1;
79
85
  for (i=0;i<symm.get_num();++i) {
80
86
    fprintf(outfile,"Coordinate %d: ",i);
81
87
    for (j=0;j<optinfo.points-1;++j)
82
 
      fprintf(outfile,"%15.10lf",energies[++cnt]);
 
88
      fprintf(outfile,"%15.10lf ",energies[++cnt]);
83
89
    fprintf(outfile,"\n");
84
90
  }
85
91
  fflush(outfile);
179
185
  */
180
186
}
181
187
 
 
188
}} /* namespace psi::optking */
 
189