~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/global/X/xregion_pixregion.c

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#if HAVE_CONFIG_H
2
 
#   include "config.h"
3
 
#endif
4
 
 
5
 
#include "xregion.h"
6
 
 
7
 
void UpdatePixRegion(int ilo, int ihi, int jlo, int jhi, int increment, 
8
 
                    double time)
9
 
{
10
 
  register int i, j, k, l, index;
11
 
  register u_char *from, *to, *tempk, *tempkl, value, *pflag;
12
 
  register double *pintegr, *pltime, corr;
13
 
  
14
 
  for (i = ilo; i < ihi + 1; i++)
15
 
  {
16
 
    for (j = jlo; j < jhi + 1; j++) 
17
 
    {
18
 
      to = pict + (i * pict_width * scale + j) * scale; 
19
 
      from = grid + (i * pict_width + j);
20
 
      pflag = flag + (i * pict_width + j);
21
 
      pintegr = integr + (i * pict_width + j);
22
 
      pltime = ltime  + (i * pict_width + j);
23
 
 
24
 
      /* increment == 0 means animation is done and displaying integrals */
25
 
 
26
 
      if (animation)
27
 
      {
28
 
        corr = *from > 1 ? *from - 1 : 0;
29
 
        corr = corr  * (time - *pltime);
30
 
 
31
 
        if(corr < 0.0)
32
 
        {
33
 
          fprintf(stderr, "error: time =%f ltime =%f height =%d \n",
34
 
                  time,*pltime,*from);
35
 
        }
36
 
 
37
 
        *pintegr += corr;
38
 
 
39
 
        *pltime   = time;
40
 
 
41
 
        *from = *from + increment;
42
 
        index = *from;
43
 
        index = GA_MIN(index,MAX_COL-1);
44
 
 
45
 
        if(increment)
46
 
        {
47
 
          *pflag = 1;
48
 
        }
49
 
 
50
 
        /*  calculate max value of integrals */
51
 
        if(*pintegr > maxval)
52
 
        {
53
 
          maxval = *pintegr;
54
 
        }
55
 
      }
56
 
      else /* done with animation display integral */
57
 
      {
58
 
        index = (int) (((*pintegr) / maxval) * MAX_COL);
59
 
        index = GA_MIN(index, MAX_COL - 1);
60
 
        if(!index && *pflag)
61
 
        {
62
 
          index = MAX_COL;  /* sets the "accessed" color */
63
 
        }
64
 
      }
65
 
          
66
 
      value = cmap[index];
67
 
 
68
 
      for (k = 0, tempk = to; k < scale; k++, tempk += pict_width * scale)
69
 
      {
70
 
        for (l = 0, tempkl = tempk; l < scale; l++, tempkl++)
71
 
        {
72
 
          *tempkl = value;
73
 
        }
74
 
      }
75
 
 
76
 
    }  /* end for j */
77
 
  } /* end for i */
78
 
}
79
 
 
80
 
 
81
 
void DisplayPixRegion(int ilo, int ihi, int jlo, int jhi)
82
 
{
83
 
  int count, x, y, height, width;
84
 
 
85
 
  y = ilo * scale;
86
 
  x = jlo * scale;
87
 
  height = (ihi - ilo + 1) * scale;
88
 
  width = (jhi - jlo + 1) * scale;
89
 
  
90
 
  XPutImage(display, window, gc, image, x, y, x, y, width, height);
91
 
  XFlush(display);
92
 
 
93
 
/*
94
 
  for(count = 0; count < rows; count++)
95
 
  {
96
 
    XDrawLine(display, XtWindow(canvas_widget), gc, 0, 
97
 
             (overlay_row[count] - 1 - top_edge) * scale,
98
 
              pict_width * scale - 1, 
99
 
             (overlay_row[count] - 1 - top_edge) * scale);
100
 
  }
101
 
  for(count = 0; count < cols; count++)
102
 
  {
103
 
    XDrawLine(display, XtWindow(canvas_widget), gc, 
104
 
             (overlay_col[count] - 1 - left_edge) * scale, 0, 
105
 
             (overlay_col[count] - 1 - left_edge) * scale, 
106
 
              pict_height * scale - 1);
107
 
  }
108
 
*/
109
 
 
110
 
  for(count = 0; count < rows; count++)
111
 
  {
112
 
    XDrawLine(display, XtWindow(canvas_widget), gc, 0,
113
 
             (overlay_row[count]  - top_edge + .5) * scale,
114
 
              pict_width * scale - 1,
115
 
             (overlay_row[count] - top_edge + .5) * scale);
116
 
  }
117
 
  for(count = 0; count < cols; count++)
118
 
  {
119
 
    XDrawLine(display, XtWindow(canvas_widget), gc,
120
 
             (overlay_col[count]  - left_edge + .5) * scale, 0,
121
 
             (overlay_col[count]  - left_edge + .5) * scale,
122
 
              pict_height * scale - 1);
123
 
  }
124
 
 
125
 
 
126
 
}
127