gs2crmod 0.10.22 → 0.10.23
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/gs2crmod.gemspec +2 -5
- data/lib/gs2crmod/graphs.rb +4 -22
- data/lib/gs2crmod/gsl_data.rb +11 -3
- metadata +2 -18
data/Gemfile
CHANGED
@@ -4,7 +4,7 @@ source "http://rubygems.org"
|
|
4
4
|
gem "coderunner", ">= 0.13.13"
|
5
5
|
gem "rubyhacks", ">= 0.1.2"
|
6
6
|
# It seems necessary to have the following line un-commented on some systems but commented out on other systems:
|
7
|
-
gem "ruby-netcdf", ">= 0.6.6.1"
|
7
|
+
#gem "ruby-netcdf", ">= 0.6.6.1"
|
8
8
|
|
9
9
|
# Add dependencies to develop your gem here.
|
10
10
|
# Include everything needed to run rake, tests, features, etc.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.23
|
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.10.
|
8
|
+
s.version = "0.10.23"
|
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 = "2013-11-
|
12
|
+
s.date = "2013-11-21"
|
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"]
|
@@ -87,7 +87,6 @@ Gem::Specification.new do |s|
|
|
87
87
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
88
88
|
s.add_runtime_dependency(%q<coderunner>, [">= 0.13.13"])
|
89
89
|
s.add_runtime_dependency(%q<rubyhacks>, [">= 0.1.2"])
|
90
|
-
s.add_runtime_dependency(%q<ruby-netcdf>, [">= 0.6.6.1"])
|
91
90
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
92
91
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
93
92
|
s.add_development_dependency(%q<bundler>, ["> 1.0.0"])
|
@@ -95,7 +94,6 @@ Gem::Specification.new do |s|
|
|
95
94
|
else
|
96
95
|
s.add_dependency(%q<coderunner>, [">= 0.13.13"])
|
97
96
|
s.add_dependency(%q<rubyhacks>, [">= 0.1.2"])
|
98
|
-
s.add_dependency(%q<ruby-netcdf>, [">= 0.6.6.1"])
|
99
97
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
100
98
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
101
99
|
s.add_dependency(%q<bundler>, ["> 1.0.0"])
|
@@ -104,7 +102,6 @@ Gem::Specification.new do |s|
|
|
104
102
|
else
|
105
103
|
s.add_dependency(%q<coderunner>, [">= 0.13.13"])
|
106
104
|
s.add_dependency(%q<rubyhacks>, [">= 0.1.2"])
|
107
|
-
s.add_dependency(%q<ruby-netcdf>, [">= 0.6.6.1"])
|
108
105
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
109
106
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
110
107
|
s.add_dependency(%q<bundler>, ["> 1.0.0"])
|
data/lib/gs2crmod/graphs.rb
CHANGED
@@ -317,24 +317,6 @@ module GraphKits
|
|
317
317
|
options[:imrc] ||= :real
|
318
318
|
ep options
|
319
319
|
options.convert_to_index(self, :ky)
|
320
|
-
#ep 'converted options: ', options
|
321
|
-
|
322
|
-
#decode naming scheme
|
323
|
-
#mag = nil
|
324
|
-
#options[:imrc] = :real
|
325
|
-
#case name
|
326
|
-
#when /im/
|
327
|
-
#options[:imrc] = :im
|
328
|
-
#when /mag/
|
329
|
-
#options[:imrc] = :mag
|
330
|
-
#options[:mag] = true
|
331
|
-
#when /corr/
|
332
|
-
#options[:imrc] = :corr
|
333
|
-
#end
|
334
|
-
#options[:flip] = true if name =~ /flip/
|
335
|
-
#options[:norm] = true if name =~ /norm/
|
336
|
-
#options[:rev] = true if name =~ /rev/
|
337
|
-
#options[:z] = true if name =~ /z/
|
338
320
|
|
339
321
|
|
340
322
|
kit = GraphKit.autocreate({x: axiskit('theta_along_field_line', options), y: axiskit('phi_along_field_line', options)})
|
@@ -348,10 +330,10 @@ module GraphKits
|
|
348
330
|
kit.data[0].with = "linespoints"
|
349
331
|
# kit.data[0].axes[:x].data *= -1 #if options[:rev]
|
350
332
|
#(eputs 'reversing'; gets)
|
351
|
-
if (@s_hat_input||@shat).abs >= 1.0e-5
|
352
|
-
range = options[:range] == 0 ? nil : (options[:range] or options[:z] ? 1 / (@s_hat_input||@shat) : 2 * Math::PI / (@s_hat_input||@shat))
|
353
|
-
kit.xrange = [-range, range] if range
|
354
|
-
end
|
333
|
+
#if (@s_hat_input||@shat).abs >= 1.0e-5
|
334
|
+
#range = options[:range] == 0 ? nil : (options[:range] or options[:z] ? 1 / (@s_hat_input||@shat) : 2 * Math::PI / (@s_hat_input||@shat))
|
335
|
+
#kit.xrange = [-range, range] if range
|
336
|
+
#end
|
355
337
|
return kit
|
356
338
|
end
|
357
339
|
end
|
data/lib/gs2crmod/gsl_data.rb
CHANGED
@@ -602,7 +602,7 @@ module GSLVectors
|
|
602
602
|
options.convert_to_index(self, :ky, :kx)
|
603
603
|
nkx = netcdf_file.var('kx').dims[0].length
|
604
604
|
# p nkx
|
605
|
-
stride = @jtwist * (options[:ky_index] )
|
605
|
+
stride = @jtwist * (options[:ky_index] -1 )
|
606
606
|
#stride = 3
|
607
607
|
nlinks = [(nkx / stride).floor, 1].max
|
608
608
|
theta0 = options[:kx_index] % @jtwist #(options[:theta0] || 0)
|
@@ -619,7 +619,7 @@ module GSLVectors
|
|
619
619
|
# jump = 0
|
620
620
|
#end
|
621
621
|
ep 'stride', stride, 'nlinks', nlinks, 'theta0', theta0
|
622
|
-
|
622
|
+
ep GSL::Vector.indgen(nlinks / 2, nkx + theta0 - nlinks / 2 * stride, stride).connect(GSL::Vector.indgen(nlinks / 2, theta0, stride)).reverse if nlinks > 1
|
623
623
|
#return [7,5,3,1,34].to_gslv
|
624
624
|
return GSL::Vector.alloc([theta0 % jtwist]) if nlinks ==1
|
625
625
|
return GSL::Vector.indgen(nlinks / 2, nkx + theta0 - nlinks / 2 * stride, stride).connect(GSL::Vector.indgen(nlinks / 2, theta0, stride)).reverse
|
@@ -726,7 +726,11 @@ module GSLVectors
|
|
726
726
|
theta_vector = gsl_vector(:theta)
|
727
727
|
when "box"
|
728
728
|
#eputs "Start theta_along_field_line"
|
729
|
+
|
729
730
|
kx_elements = gsl_vector('linked_kx_elements', options).to_a
|
731
|
+
#if @grid_option == "range"
|
732
|
+
#kx_elements = kx_elements.to_gslv.from_box_order.to_a
|
733
|
+
#end
|
730
734
|
ep 'kx_elements', kx_elements.to_a
|
731
735
|
# ep list(:kx).keys.max
|
732
736
|
# ep kx_elements[0], list(:kx)[(kx_elements[0] + 1).to_i]
|
@@ -987,6 +991,10 @@ module GSLVectorComplexes
|
|
987
991
|
case @grid_option
|
988
992
|
when "single"
|
989
993
|
temp = GSL::Vector.alloc(netcdf_file.var('phi_t').get({'start' => [0,0,0,0, options[:t_index] - 1], 'end' => [-1,-1,0,0, options[:t_index] - 1]}).to_a[0][0][0].flatten)
|
994
|
+
when "range"
|
995
|
+
a = netcdf_file.var('phi_t').get({'start' => [0, 0, options[:kx_index]-1, options[:ky_index] - 1, options[:t_index] - 1], 'end' => [-1, -1, options[:kx_index]-1, options[:ky_index] - 1, options[:t_index]-1]})
|
996
|
+
#temp = GSL::Vector.alloc(a.to_a[0].values_at(*kx_elements).flatten)
|
997
|
+
temp = GSL::Vector.alloc(a.to_a[0][0].flatten)
|
990
998
|
when "box"
|
991
999
|
options.convert_to_index(self, :ky, :kx)
|
992
1000
|
kx_elements = gsl_vector('linked_kx_elements', options).to_a
|
@@ -1082,7 +1090,7 @@ module GSLMatrices
|
|
1082
1090
|
def spectrum_over_ky_over_kx_gsl_matrix(options)
|
1083
1091
|
Dir.chdir(@directory) do
|
1084
1092
|
raise "Spectrum makes no sense for single modes" if @grid_option == "single"
|
1085
|
-
options.convert_to_index(:t) if options[:t] or options[:t_element]
|
1093
|
+
options.convert_to_index(:t) if options[:t] or options[:t_element]
|
1086
1094
|
options[:t_index] ||= list(:t).keys.max
|
1087
1095
|
#phi2_by_mode index order (in Fortran) is kx, ky, t
|
1088
1096
|
phi_narray = netcdf_file.var("phi2_by_mode").get('start' => [0, 0, options[:t_index] - 1], 'end' => [-1, -1, options[:t_index] - 1])
|
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.10.
|
4
|
+
version: 0.10.23
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-11-
|
13
|
+
date: 2013-11-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coderunner
|
@@ -44,22 +44,6 @@ dependencies:
|
|
44
44
|
- - ! '>='
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 0.1.2
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: ruby-netcdf
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.6.6.1
|
55
|
-
type: :runtime
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
|
-
requirements:
|
60
|
-
- - ! '>='
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 0.6.6.1
|
63
47
|
- !ruby/object:Gem::Dependency
|
64
48
|
name: shoulda
|
65
49
|
requirement: !ruby/object:Gem::Requirement
|