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

« back to all changes in this revision

Viewing changes to src/bin/cints/Tools/symm.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
/*! \file symm.cc
 
2
    \ingroup CINTS
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
#include<cstdio>
 
6
#include<cstdlib>
 
7
#include<libipv1/ip_lib.h>
 
8
#include<libciomr/libciomr.h>
 
9
#include<libchkpt/chkpt.h>
 
10
 
 
11
#include<libint/libint.h>
 
12
#include"defines.h"
 
13
#define EXTERN
 
14
#include"global.h"
 
15
#include <stdexcept>
 
16
 
 
17
namespace psi { namespace CINTS {
 
18
 
 
19
/*-------------------------------
 
20
  Explicit function declarations
 
21
 -------------------------------*/
 
22
static void init_dp_table(void);
 
23
 
 
24
void init_symmetry()
 
25
{
 
26
  int i, j, count;
 
27
 
 
28
  Symmetry.symlabel = chkpt_rd_sym_label();
 
29
  Symmetry.nirreps = chkpt_rd_nirreps();
 
30
  Symmetry.num_so = chkpt_rd_nso();
 
31
  Symmetry.num_unique_atoms = chkpt_rd_num_unique_atom();
 
32
  Symmetry.num_unique_shells = chkpt_rd_num_unique_shell();
 
33
 
 
34
  Symmetry.atom_positions = chkpt_rd_atom_position();
 
35
  Symmetry.ua2a = chkpt_rd_ua2a();
 
36
  Symmetry.us2s = chkpt_rd_us2s();
 
37
  Symmetry.sopi = chkpt_rd_sopi();
 
38
  Symmetry.sym_oper = chkpt_rd_symoper();
 
39
  Symmetry.irr_labels = chkpt_rd_irr_labs();
 
40
  Symmetry.ict = chkpt_rd_ict();
 
41
  Symmetry.cartrep = chkpt_rd_cartrep();
 
42
  Symmetry.cdsalcpi = chkpt_rd_cdsalcpi();
 
43
  Symmetry.cdsalc2cd = chkpt_rd_cdsalc2cd();
 
44
  Symmetry.cdsalc_ioffset = init_int_array(Symmetry.nirreps);
 
45
  Symmetry.cdsalc_ioffset[0] = 0;
 
46
  for(i=1;i<Symmetry.nirreps;i++)
 
47
    Symmetry.cdsalc_ioffset[i] = Symmetry.cdsalc_ioffset[i-1] + Symmetry.cdsalcpi[i-1];
 
48
 
 
49
  if (Symmetry.nirreps) {
 
50
  /* Symmetry.dp_table = */ init_dp_table();
 
51
#if SCF_ONLY
 
52
    if (Symmetry.nirreps < 4)
 
53
      UserOptions.scf_only = 0;
 
54
    if (UserOptions.scf_only) {
 
55
      Symmetry.so2symblk = init_int_array(Symmetry.num_so);
 
56
      count = 0;
 
57
      for(i=0;i<Symmetry.nirreps;i++)
 
58
        for(j=0;j<Symmetry.sopi[i];j++)
 
59
          Symmetry.so2symblk[count++] = i;
 
60
    }
 
61
#endif
 
62
  }
 
63
 
 
64
  return;
 
65
}
 
66
 
 
67
 
 
68
void cleanup_symmetry()
 
69
{
 
70
  if (Symmetry.nirreps > 1)
 
71
    free_int_matrix(Symmetry.dp_table);
 
72
  free(Symmetry.sopi);
 
73
  free_block(Symmetry.usotao);
 
74
  free(Symmetry.us2s);
 
75
  free(Symmetry.atom_positions);
 
76
  free(Symmetry.cartrep);
 
77
 
 
78
  return;
 
79
}
 
80
 
 
81
 
 
82
/*!----------------------------------------------------------------------
 
83
  Compute direct product multiplication table for the given point group
 
84
  NOTE: This matrix is really pointless at the moment, I left it here
 
85
  just in case
 
86
 ----------------------------------------------------------------------*/
 
87
void init_dp_table(void)
 
88
{
 
89
  int i,j;
 
90
 
 
91
  Symmetry.dp_table = init_int_matrix(Symmetry.nirreps,
 
92
                                      Symmetry.nirreps);
 
93
  for(i=0;i<Symmetry.nirreps;i++)
 
94
    for(j=0;j<i;j++) {
 
95
      /*------------------------------------------------------------
 
96
        The line below works only in a case of Abelian point group!
 
97
        Have to do honest multiplication of rows of character table
 
98
        if non-Abelian groups to be used
 
99
       ------------------------------------------------------------*/
 
100
      Symmetry.dp_table[i][j] = Symmetry.dp_table[j][i] = i ^ j;
 
101
    }
 
102
 
 
103
  return;
 
104
}
 
105
};};