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

« back to all changes in this revision

Viewing changes to src/bin/cints/DFT/free_grid_structs.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 free_grid_structs.cc
 
2
    \ingroup CINTS
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
#include<cstdio>
 
6
#include<cstdlib>
 
7
#include<cmath>
 
8
#include<libciomr/libciomr.h>
 
9
 
 
10
#include"defines.h"
 
11
#define EXTERN
 
12
#include"global.h"
 
13
#include <stdexcept>
 
14
 
 
15
/* ---- Cleanup the primitive classes ---- */
 
16
 
 
17
namespace psi { namespace CINTS {
 
18
  void cleanup_sphere(leb_sphere_t sphere){
 
19
    
 
20
    free(sphere.points);
 
21
  }
 
22
 
 
23
  void cleanup_prim_chunk(prim_leb_chunk_t chunk){
 
24
    
 
25
    int i;
 
26
    
 
27
    for(i=0;i<chunk.size;i++)
 
28
        cleanup_sphere(chunk.spheres[i]);
 
29
  }
 
30
 
 
31
  void cleanup_prim_atomic_grid(prim_atomic_grid_t prim_atomic_grid){
 
32
    int i;
 
33
    
 
34
    for(i=0;i<prim_atomic_grid.chunk_num;i++)
 
35
        cleanup_prim_chunk(prim_atomic_grid.leb_chunk[i]);
 
36
  }
 
37
  
 
38
  void cleanup_prim_atomic_grid_array(prim_atomic_grid_t *prim_array, int n){
 
39
    
 
40
    int i;
 
41
    
 
42
    for(i=0;i<n;i++)
 
43
        cleanup_prim_atomic_grid(prim_array[i]);
 
44
    
 
45
    free(prim_array);
 
46
  }
 
47
 
 
48
  /* ---- Cleanup the concrete classes ---- */
 
49
 
 
50
  /*void cleanup_conc_chunk(struct leb_chunk_s *chunk){
 
51
    
 
52
  int i;
 
53
    
 
54
    for(i=0;i<chunk.size;i++)
 
55
        cleanup_sphere(chunk.spheres[i]);
 
56
        }*/
 
57
 
 
58
  void cleanup_conc_atomic_grid(struct atomic_grid_s atomic_grid){
 
59
    
 
60
    int i;
 
61
    
 
62
    free(atomic_grid.leb_chunk);
 
63
    /*for(i=0;i<atomic_grid.chunk_num;i++)
 
64
        cleanup_conc_chunk(atomic_grid.leb_chunk[i]);*/
 
65
  }
 
66
 
 
67
  void cleanup_grid_type(grid_t grid){
 
68
    
 
69
    int i;
 
70
    
 
71
    if(grid.pruned_flag)
 
72
        cleanup_prim_atomic_grid_array(grid.prim_pruned_atomic_grids,
 
73
                                       grid.pruned_info.n_param_sets);
 
74
    else
 
75
        cleanup_prim_atomic_grid(grid.prim_atomic_grid);
 
76
    
 
77
    for(i=0;i<Symmetry.num_unique_atoms;i++)
 
78
        cleanup_conc_atomic_grid(grid.atomic_grid[i]);
 
79
  }
 
80
};};