~ubuntu-branches/ubuntu/vivid/psicode/vivid

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/cdsalc2cd.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_cdsalc2cd(void)
 
18
{
 
19
  const int num_cd = 3*rd_natom();
 
20
  double **cdsalc2cd = matrix<double>(num_cd,num_cd);
 
21
  psio_address ptr = PSIO_ZERO;
 
22
  char *keyword = build_keyword("cartdisp->SALC matrix");
 
23
 
 
24
  psio->read(PSIF_CHKPT, keyword, (char *) cdsalc2cd[0], 
 
25
    num_cd*num_cd*sizeof(double), ptr, &ptr);
 
26
 
 
27
  free(keyword);
 
28
  return cdsalc2cd;
 
29
}
 
30
 
 
31
void Chkpt::wt_cdsalc2cd(const double **cdsalc2cd)
 
32
{
 
33
  const int num_cd = 3*rd_natom();
 
34
  psio_address ptr = PSIO_ZERO;
 
35
  char *keyword = build_keyword("cartdisp->SALC matrix");
 
36
 
 
37
  psio->write(PSIF_CHKPT, keyword, (char *) cdsalc2cd[0], 
 
38
    num_cd*num_cd*sizeof(double), ptr, &ptr);
 
39
 
 
40
  free(keyword);
 
41
}
 
42
 
 
43
extern "C" {
 
44
/*!
 
45
** chkpt_rd_cdsalc2cd(): Read in (normalized) SALCs of cartesian displacements
 
46
**
 
47
** Parameters: none
 
48
**
 
49
** Returns: cdsalc2cd = A natom*3 by natom*3 blocked matrix of doubles. 
 
50
**   Columns correpond to symmetry-blocked SALCs
 
51
** 
 
52
** \ingroup CHKPT
 
53
*/
 
54
        double **chkpt_rd_cdsalc2cd(void)
 
55
        {
 
56
                double **cdsalc2cd;
 
57
                cdsalc2cd = _default_chkpt_lib_->rd_cdsalc2cd();
 
58
                return cdsalc2cd;
 
59
        }
 
60
 
 
61
 
 
62
/*!
 
63
** chkpt_wt_cdsalc2cd(): Writes (normalized) SALCs of cartesian displacements
 
64
**
 
65
** \param cdsalc2cd = A natom*3 by natom*3 blocked matrix of doubles. 
 
66
**   Columns correpond to symmetry-blocked SALCs
 
67
**
 
68
** Returns: none
 
69
**
 
70
** \ingroup CHKPT
 
71
*/
 
72
        void chkpt_wt_cdsalc2cd(const double **cdsalc2cd)
 
73
        {
 
74
                _default_chkpt_lib_->wt_cdsalc2cd(cdsalc2cd);
 
75
        }
 
76
}
 
77