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

« back to all changes in this revision

Viewing changes to src/bin/input/freeze_orbs.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
 
2
    \ingroup INPUT
 
3
    \brief Enter brief description of file here
 
4
*/
 
5
#define EXTERN
 
6
#include <cstdio>
 
7
#include <cstring>
 
8
#include <cstdlib>
 
9
#include <libipv1/ip_lib.h>
 
10
#include <libciomr/libciomr.h>
 
11
#include "input.h"
 
12
#include "global.h"
 
13
#include "defines.h"
 
14
 
 
15
namespace psi { namespace input {
 
16
 
 
17
void freeze_core()
 
18
{
 
19
  int large = 0;
 
20
  int atom;
 
21
 
 
22
  if (!strcmp(frozen_core,"FALSE") ||
 
23
      !strcmp(frozen_core,"NO")) {
 
24
    nfzc = 0;
 
25
    return;
 
26
  }
 
27
  else if (!strcmp(frozen_core,"TRUE") ||
 
28
           !strcmp(frozen_core,"YES") ||
 
29
           !strcmp(frozen_core,"SMALL") ||
 
30
           !strcmp(frozen_core,"LARGE")) {
 
31
 
 
32
      if (!strcmp(frozen_core,"LARGE"))
 
33
        large = 1;
 
34
 
 
35
      nfzc = 0;
 
36
      for(atom=0; atom<num_atoms; atom++) {
 
37
        /* H - He */
 
38
        if (nuclear_charges[atom] < 2.1)
 
39
          continue;
 
40
        /* Li - Ne */
 
41
        else if (nuclear_charges[atom] > 2.9 && nuclear_charges[atom] < 10.1)
 
42
          nfzc++;
 
43
        /* Na - Ar */
 
44
        else if (nuclear_charges[atom] > 10.9 && nuclear_charges[atom] < 18.1)
 
45
          if (large)
 
46
            nfzc += 5;
 
47
          else
 
48
            nfzc++;
 
49
        else
 
50
          punt("Cannot freeze core automatically for fourth and higher row elements yet");
 
51
      }
 
52
  }
 
53
  else if (frozen_core[0] >= '0' && frozen_core[0] <= '9') {
 
54
    nfzc = atoi(frozen_core);
 
55
  }
 
56
  else
 
57
    punt("Invalid value for FREEZE_CORE");
 
58
 
 
59
}
 
60
 
 
61
 
 
62
void freeze_virt()
 
63
{
 
64
  if (!strcmp(frozen_virt,"FALSE") ||
 
65
      !strcmp(frozen_virt,"NO")) {
 
66
    nfzv = 0;
 
67
    return;
 
68
  }
 
69
  else if (frozen_virt[0] >= '0' && frozen_virt[0] <= '9') {
 
70
    nfzv = atoi(frozen_virt);
 
71
  }
 
72
  else
 
73
    punt("Invalid value for FREEZE_VIRT");
 
74
 
 
75
}
 
76
 
 
77
}} // namespace psi::input