~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/emp2.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
/*!
 
2
  \file
 
3
  \ingroup CHKPT
 
4
*/
 
5
 
 
6
#include <cstdio>
 
7
#include <cstdlib>
 
8
#include <psifiles.h>
 
9
#include <libpsio/psio.hpp>
 
10
extern "C" {
 
11
#include <libchkpt/chkpt.h>
 
12
}
 
13
#include <libchkpt/chkpt.hpp>
 
14
 
 
15
using namespace psi;
 
16
 
 
17
double Chkpt::rd_emp2()
 
18
{
 
19
        double energy;
 
20
        char *keyword;
 
21
        keyword = build_keyword("MP2 Energy");
 
22
        
 
23
        // Read the energy in
 
24
        psio->read_entry(PSIF_CHKPT, keyword, (char*)&energy, sizeof(double));
 
25
                
 
26
        // Return the value to the user
 
27
        return energy;
 
28
}
 
29
 
 
30
void Chkpt::wt_emp2(double emp2)
 
31
{
 
32
        char *keyword;
 
33
        keyword = build_keyword("MP2 Energy");
 
34
        
 
35
        psio->write_entry(PSIF_CHKPT, keyword, (char*)&emp2, sizeof(double));
 
36
        
 
37
        free(keyword);
 
38
}
 
39
 
 
40
 
 
41
extern "C" {
 
42
/*!
 
43
** chkpt_rd_emp2(): Reads in the MP2 contribution to total energy.
 
44
**
 
45
**   takes no arguments.
 
46
**
 
47
**   returns: double emp2  the MP2 energy.
 
48
** \ingroup CHKPT
 
49
*/
 
50
        double chkpt_rd_emp2(void)
 
51
        {
 
52
                double emp2;
 
53
                emp2 = _default_chkpt_lib_->rd_emp2();
 
54
                return emp2;
 
55
        }
 
56
 
 
57
/*!
 
58
** chkpt_wt_emp2(): Writes out the MP2 contribution to total energy.
 
59
**
 
60
** \param emp2 = the MP2 energy.
 
61
**
 
62
** returns: none
 
63
** \ingroup CHKPT
 
64
*/
 
65
        void chkpt_wt_emp2(double emp2)
 
66
        {
 
67
                _default_chkpt_lib_->wt_emp2(emp2);
 
68
        }
 
69
}