~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/cartrep.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 14:01:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060910140133-ib2j86trekykfsfv
Tags: upstream-3.2.3
ImportĀ upstreamĀ versionĀ 3.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
  \file cartrep.c
 
3
  \ingroup (CHKPT)
 
4
*/
 
5
 
 
6
#include <stdio.h>
 
7
#include <stdlib.h>
 
8
#include "chkpt.h"
 
9
#include <psifiles.h>
 
10
#include <libpsio/psio.h>
 
11
#include <libciomr/libciomr.h>
 
12
 
 
13
/*!
 
14
** chkpt_rd_cartrep():  Reads the point group representation in the basis of
 
15
**     cartesian unit vectors.
 
16
**
 
17
**   takes no arguments.
 
18
**
 
19
**   returns: double **cartrep  a vector of block matrices of doubles. Each 
 
20
**     row corresponds to a particular symmetry operation, each column is 
 
21
**     a 3x3 block matrix.
 
22
**  \ingroup (CHKPT)
 
23
*/
 
24
 
 
25
double **chkpt_rd_cartrep(void)
 
26
{
 
27
  int i, nirrep;
 
28
  double **cartrep;
 
29
  psio_address ptr;
 
30
 
 
31
  nirrep = chkpt_rd_nirreps();
 
32
 
 
33
  ptr = PSIO_ZERO;
 
34
  cartrep = block_matrix(nirrep,9);
 
35
 
 
36
  psio_read_entry(PSIF_CHKPT, "::Cart. Repr. Matrices", (char *) cartrep[0], 
 
37
                  9*nirrep*sizeof(double));
 
38
 
 
39
  return cartrep;
 
40
}
 
41
 
 
42
 
 
43
/*!
 
44
** chkpt_wt_cartrep():  Writes the point group representation in the basis of
 
45
**     cartesian unit vectors.
 
46
**
 
47
** \param cartrep = a vector of block matrices of doubles. Each row 
 
48
**                  corresponds to a particular symmetry operation, each 
 
49
**                  column is a 3x3 block matrix.
 
50
**
 
51
** returns nothing.
 
52
** \ingroup (CHKPT)
 
53
*/
 
54
 
 
55
void chkpt_wt_cartrep(double **cartrep)
 
56
{
 
57
  int i, nirrep;
 
58
  psio_address ptr;
 
59
 
 
60
  nirrep = chkpt_rd_nirreps();
 
61
 
 
62
  ptr = PSIO_ZERO;
 
63
  for(i=0; i < nirrep; i++)
 
64
    psio_write(PSIF_CHKPT, "::Cart. Repr. Matrices", (char *) cartrep[i], 
 
65
               9*sizeof(double), ptr, &ptr);
 
66
}