gs2crmod 0.11.24 → 0.11.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.24
1
+ 0.11.26
data/ext/extconf.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'mkmf'
2
2
 
3
- $CFLAGS = " -Wall -I../include "
3
+ #Need to link with C GSL libraries to use in C extensions
4
+ gsl_inc = `gsl-config --cflags`
5
+
6
+ $CFLAGS = " -Wall -I../include #{gsl_inc}"
4
7
 
5
8
  srcs = Dir.glob("*.c")
6
9
 
data/ext/gs2crmod_ext.c CHANGED
@@ -2,7 +2,6 @@
2
2
  #include <math.h>
3
3
  #include <string.h>
4
4
  #include <gsl/gsl_spline.h>
5
- #include <gsl/gsl_spline.h>
6
5
 
7
6
  VALUE gs2crmod_tensor_complexes_field_gsl_tensor_complex_2(VALUE self, VALUE options)
8
7
  {
@@ -409,9 +408,9 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
409
408
  //Write some as floats to avoid flooring to wrong (lower) number later
410
409
  float *lx_bin, *ly_bin, *lz_bin, *lt_bin;
411
410
  float lxmin, lxmax, lymin, lymax, lzmin, lzmax, ltmin, ltmax, lx, ly, lz, *lt;
412
- double *x, *y, *z, *t, *field, *coarray, *corr_norm, amin;
411
+ double *x, *y, *z, *t, *field, *coarray, *corr_norm;
413
412
  int *c_shape, tot_size, ith, ix, iy, it, t_size, first=1;
414
- int index, i, i2, i3, i4, tot_bins, *count;
413
+ int index, i2, i3, i4, tot_bins, *count;
415
414
  long int i1;
416
415
 
417
416
  printf("Starting correlation analysis\n");
@@ -427,12 +426,6 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
427
426
  t[it] = NUM2DBL(CR_TELMT_R1(t_gsl_vector, it));
428
427
  }
429
428
 
430
- //Read from options
431
- if(RTEST(CR_HKS(options, "amin")))
432
- amin = NUM2DBL(CR_HKS(options, "amin"));
433
- else
434
- amin = 1.0;
435
-
436
429
  VALUE nbins_array=CR_HKS(options, "nbins_array");
437
430
  int *nbins;
438
431
  if(RTEST(nbins_array) && RTEST(rb_obj_is_kind_of(nbins_array, RGET_CLASS_TOP("Array")))){
@@ -471,6 +464,7 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
471
464
 
472
465
  if(first)
473
466
  {
467
+ //ALLOC_N is used since it works correctly with ruby garbage collector
474
468
  tot_size = c_shape[0]*c_shape[1]*c_shape[2]*t_size;
475
469
  x = ALLOC_N(double, tot_size);
476
470
  y = ALLOC_N(double, tot_size);
@@ -496,8 +490,8 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
496
490
 
497
491
 
498
492
  /******************************
499
- * GSL Interpolation of field *
500
- * in time *
493
+ * GSL Interpolation of *
494
+ * field in time *
501
495
  *****************************/
502
496
  //Read t interp from options (default is 100)
503
497
  int nt_reg;
@@ -508,7 +502,6 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
508
502
  int idx, ti;
509
503
  double *x_reg, *y_reg, *z_reg, *t_reg, *field_reg, delta_t_reg, *y1;
510
504
  tot_size = c_shape[0]*c_shape[1]*c_shape[2]*nt_reg;
511
- //printf("Start interpolation, %d, %d, %d, %d, %d\n", c_shape[0], c_shape[1], c_shape[2], nt_reg, tot_size);
512
505
  delta_t_reg = (t[t_size-1]-t[0])/(nt_reg-1);
513
506
 
514
507
  y1 = ALLOC_N(double, t_size);
@@ -520,11 +513,9 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
520
513
 
521
514
  for(i1=0; i1<c_shape[0]*c_shape[1]*c_shape[2]*t_size; i1+=t_size)
522
515
  {
523
- //printf("%d, %d\n", i1, c_shape[0]*c_shape[1]*c_shape[2]*t_size);
524
516
  for (i2 = 0; i2 < t_size; i2++)
525
517
  {
526
518
  y1[i2] = field[i1+i2];
527
- //printf ("%d, %lf %lf\n", i2, t[i2], y1[i2]);
528
519
  }
529
520
 
530
521
  gsl_interp_accel *acc
@@ -534,7 +525,6 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
534
525
 
535
526
  gsl_spline_init (spline, t, y1, t_size);
536
527
 
537
- //printf("Interpolated:\n");
538
528
  for (ti = 0; ti < nt_reg; ti++)
539
529
  {
540
530
  t_reg[ti] = t[0]+ti*delta_t_reg;
@@ -549,7 +539,7 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
549
539
 
550
540
  }
551
541
 
552
- //Can now free the original pointers
542
+ //Can now free the original pointers since redefined variables on a regular grid
553
543
  free(x); x=0;
554
544
  free(y); y=0;
555
545
  free(z); z=0;
@@ -567,7 +557,6 @@ VALUE gs2crmod_tensor_field_correlation_gsl_tensor(VALUE self, VALUE options)
567
557
  * since the binning will be done at each step since there is too much*
568
558
  * info to store. *
569
559
  * ********************************************************************/
570
- double lx_pos_min=20;
571
560
  i3=0;
572
561
  lxmin=0; lymin=0; lzmin=0;
573
562
  for(i1=0; i1<tot_size; i1+=nt_reg){
data/gs2crmod.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gs2crmod"
8
- s.version = "0.11.24"
8
+ s.version = "0.11.26"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edmund Highcock", "Ferdinand van Wyk"]
12
- s.date = "2014-03-12"
12
+ s.date = "2014-03-14"
13
13
  s.description = "GS2 is a gyrokinetic flux tube initial value turbulence code which can be used for fusion or astrophysical plasmas. CodeRunner is a framework for the automated running and analysis of large simulations. This module allows GS2 (and its sister code AstroGK) to harness the power of the CodeRunner framework."
14
14
  s.email = "edmundhighcock@sourceforge.net"
15
15
  s.extensions = ["ext/extconf.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gs2crmod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.24
4
+ version: 0.11.26
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-12 00:00:00.000000000 Z
13
+ date: 2014-03-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coderunner
17
- requirement: &16185280 !ruby/object:Gem::Requirement
17
+ requirement: &10326280 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.14.10
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *16185280
25
+ version_requirements: *10326280
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rubyhacks
28
- requirement: &16184640 !ruby/object:Gem::Requirement
28
+ requirement: &10325680 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.1.2
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *16184640
36
+ version_requirements: *10325680
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: ruby-netcdf-updated
39
- requirement: &16184000 !ruby/object:Gem::Requirement
39
+ requirement: &10325060 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 0.6.6.1
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *16184000
47
+ version_requirements: *10325060
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: shoulda
50
- requirement: &16183340 !ruby/object:Gem::Requirement
50
+ requirement: &10324220 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *16183340
58
+ version_requirements: *10324220
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rdoc
61
- requirement: &16182800 !ruby/object:Gem::Requirement
61
+ requirement: &10323080 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '3.12'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *16182800
69
+ version_requirements: *10323080
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: bundler
72
- requirement: &16182300 !ruby/object:Gem::Requirement
72
+ requirement: &10322500 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>'
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: 1.0.0
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *16182300
80
+ version_requirements: *10322500
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: jeweler
83
- requirement: &16181760 !ruby/object:Gem::Requirement
83
+ requirement: &10321640 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,7 +88,7 @@ dependencies:
88
88
  version: 1.8.4
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *16181760
91
+ version_requirements: *10321640
92
92
  description: GS2 is a gyrokinetic flux tube initial value turbulence code which can
93
93
  be used for fusion or astrophysical plasmas. CodeRunner is a framework for the automated
94
94
  running and analysis of large simulations. This module allows GS2 (and its sister