gs2crmod 0.9.11 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.11
1
+ 0.10.0
data/gs2crmod.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gs2crmod"
8
- s.version = "0.9.11"
8
+ s.version = "0.10.0"
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"]
@@ -158,6 +158,10 @@ def gsl_vector(name, options={})
158
158
  #ep options; gets
159
159
  #vec = GSL::Vector.alloc(netcdf_file.var(name.to_s).get({'start' => [options[:thetamin]||0], 'end' => [options[:thetamax]||-1]}).to_a)
160
160
  vec = GSL::Vector.alloc(netcdf_file.var(name.to_s).get.to_a)
161
+ if gryfx? and options[:periodic]
162
+ #vec = vec.connect([2.0*vec[-1] - vec[-2]].to_gslv)
163
+ vec = vec.connect([-vec[0]].to_gslv)
164
+ end
161
165
  if ith = options[:interpolate_theta]
162
166
  osize = vec.size
163
167
  newsize = (osize-1)*ith+1
@@ -174,6 +178,7 @@ def gsl_vector(name, options={})
174
178
  end
175
179
  start = options[:thetamin]||0
176
180
  endv = options[:thetamax]||vec.size-1
181
+ #ep ['options', options, 'vec.size', vec.size]
177
182
  vec = vec.subvector(start, (endv-start+1)).dup
178
183
  return vec
179
184
  elsif name.to_sym == :t
@@ -205,6 +205,21 @@ class CodeRunner::Gs2
205
205
  arr = GSL::Tensor.new(arr.narray.expand(*shape, 0.0))
206
206
  end
207
207
 
208
+ if gryfx? and options[:periodic]
209
+ shape = arr.narray.shape
210
+ shape[1]+=1
211
+ arr = GSL::Tensor.new(arr.narray.expand(*shape, 0.0))
212
+ shpe = arr.shape
213
+ for i in 0...shpe[0]
214
+ for j in 0...shpe[1]
215
+ for r in 0...shpe[3]
216
+ arr[i, j, -1, r] = arr[i, j, 0, r]
217
+ end
218
+ end
219
+ end
220
+
221
+ end
222
+
208
223
  arr[0, true, true, true] = 0.0 if options[:no_zonal]
209
224
  #arr = arr[options[:nakx] ? 0...options[:nakx] : true, options[:naky] ? 0...options[:naky] : true, true, true] if options[:nakx] or options[:naky]
210
225
  return arr
@@ -614,8 +629,8 @@ class CodeRunner::Gs2
614
629
  end
615
630
  if [true,:y].include? options[:extra_points]
616
631
  ep "Extending y..."
617
- y = y.connect([2*y[-1] - y[-2]].to_gslv).dup
618
- raise "ly corrected incorrectly #{ly},#{y[-1]},#{y[0]},#{y[-1]-y[0]}" unless (ly-(y[-1] - y[0])).abs / ly.abs < 1.0e-8
632
+ y = y.connect([2.0*y[-1] - y[-2]].to_gslv).dup
633
+ raise "ly corrected incorrectly #{ly},#{y[-1]},#{y[0]},#{y[-1]-y[0]}" unless (ly-(y[-1] - y[0])).abs / ly.abs < 1.0e-6
619
634
  end
620
635
 
621
636
 
@@ -653,13 +668,15 @@ class CodeRunner::Gs2
653
668
  #ep options; gets
654
669
  theta = gsl_vector('theta', options)
655
670
  #ep theta; gets;
656
- #ep 'thsize', @ntheta, theta.size
671
+ ep 'thsize', @ntheta, theta.size
657
672
  correct_3d_options(options)
658
673
  rhoc = options[:rhoc_actual]
659
674
  q_actual = options[:q_actual]
660
675
  xfac = 1.0 / options[:rho_star_actual]
661
676
  yfac = rhoc / q_actual / options[:rho_star_actual]
662
677
  factors = geometric_factors_gsl_tensor(options)
678
+
679
+ #ep ['factors.shape', factors.shape]
663
680
 
664
681
 
665
682
 
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.9.11
4
+ version: 0.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: