gs2crmod 0.9.10 → 0.9.11

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.10
1
+ 0.9.11
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.9.10"
8
+ s.version = "0.9.11"
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-08-16"
12
+ s.date = "2013-08-19"
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"]
@@ -23,6 +23,8 @@ def auto_axiskits(name, options)
23
23
  'tpar2_by_mode_over_time' => ["(delta T_parallel)^2 by mode", '%'],
24
24
  'tperp2_by_mode_over_time' => ["(delta T_perp)^2 by mode", '%'],
25
25
  'hflux_tot' => ['Total Heat Flux', ''],
26
+ 'es_heat_par' => ['Parallel electrostatic heat flux', ''],
27
+ 'es_heat_perp' => ['Perpendicular electrostatic heat flux', ''],
26
28
  'ky' => ['ky', "1/rho_#{species_letter}"],
27
29
  'kx' => ['kx', "1/rho_#{species_letter}"],
28
30
  'kpar' => ['kpar', "2 pi/qR"],
@@ -75,6 +77,13 @@ def axiskit(name, options={})
75
77
  units = ''
76
78
  return GraphKit::AxisKit.autocreate(data: gsl_vector('es_heat_flux_over_time', options), title: "#{type} Heat Flux", units: units)
77
79
  # when 'spectrum_by_ky'
80
+ # return AxisKit.autocreate(data: gsl_vector('spectrum_by_ky', options), title: "Phi^2 at t = #{list(:t)[options[:t_index]]}", units: '')
81
+ when 'es_heat_par'
82
+ puts "heat par"
83
+ type = species_type(options[:species_index]).capitalize
84
+ units = ''
85
+ return GraphKit::AxisKit.autocreate(data: gsl_vector('es_heat_par_over_time', options), title: "#{type} parallel es heat flux", units: units)
86
+ # when 'spectrum_by_ky'
78
87
  # return AxisKit.autocreate(data: gsl_vector('spectrum_by_ky', options), title: "Phi^2 at t = #{list(:t)[options[:t_index]]}", units: '')
79
88
  end
80
89
  raise CRError.new("Unknown axis kit: #{name}")
@@ -404,6 +413,41 @@ module GraphKits
404
413
  end
405
414
  end
406
415
 
416
+ def es_heat_par_vs_time_graphkit(options={})
417
+ case options[:command]
418
+ when :help
419
+ return "Graph of parallel electrostatic heat flux vs time."
420
+ when :options
421
+ return [:t_index_window, :species_index]
422
+ else
423
+ kit = GraphKit.autocreate({x: axiskit('t', options), y: axiskit('es_heat_par', options)})
424
+ kit.data[0].title = "#{species_type(options[:species_index])} es_heat_par: #@run_name"
425
+ kit.data[0].with = "l" #"lines"
426
+ kit.file_name = options[:graphkit_name]
427
+ # kit.log_axis = 'y'
428
+ kit
429
+ end
430
+ end
431
+
432
+ def es_heat_perp_vs_time_graphkit(options={})
433
+ case options[:command]
434
+ when :help
435
+ return "Graph of perpendicular electrostatic heat flux vs time."
436
+ when :options
437
+ return [:t_index_window, :species_index]
438
+ else
439
+ kit = GraphKit.autocreate({x: axiskit('t', options), y: axiskit('es_heat_perp', options)})
440
+ kit.data[0].title = "#{species_type(options[:species_index])} es_heat_perp: #@run_name"
441
+ kit.data[0].with = "l" #"lines"
442
+ kit.file_name = options[:graphkit_name]
443
+ # kit.log_axis = 'y'
444
+ kit
445
+ end
446
+ end
447
+ def es_heat_all_vs_time_graphkit(options={})
448
+ es_heat_par_vs_time_graphkit(options)
449
+ es_heat_perp_vs_time_graphkit(options)
450
+ end
407
451
  def es_mom_flux_vs_time_graphkit(options={})
408
452
  case options[:command]
409
453
  when :help
@@ -731,6 +731,29 @@ module GSLVectors
731
731
  return GSL::Vector.alloc(netcdf_file.var('es_heat_flux').get('start' => [options[:species_index].to_i - 1, options[:begin_element]], 'end' => [options[:species_index].to_i - 1, options[:end_element]]).to_a.flatten)
732
732
  end
733
733
  end
734
+ def es_heat_par_over_time_gsl_vector(options)
735
+ Dir.chdir(@directory) do
736
+
737
+ options.setup_time_window
738
+ return GSL::Vector.alloc(netcdf_file.var('es_heat_par').get('start' => [options[:species_index].to_i - 1, options[:begin_element]], 'end' => [options[:species_index].to_i - 1, options[:end_element]]).to_a.flatten)
739
+ end
740
+ end
741
+ alias :es_heat_par_gsl_vector :es_heat_par_over_time_gsl_vector
742
+ def es_heat_perp_over_time_gsl_vector(options)
743
+ Dir.chdir(@directory) do
744
+
745
+ options.setup_time_window
746
+ return GSL::Vector.alloc(netcdf_file.var('es_heat_perp').get('start' => [options[:species_index].to_i - 1, options[:begin_element]], 'end' => [options[:species_index].to_i - 1, options[:end_element]]).to_a.flatten)
747
+ end
748
+ end
749
+ alias :es_heat_perp_gsl_vector :es_heat_perp_over_time_gsl_vector
750
+ def es_heat_flux_over_time_gsl_vector(options)
751
+ Dir.chdir(@directory) do
752
+
753
+ options.setup_time_window
754
+ return GSL::Vector.alloc(netcdf_file.var('es_heat_flux').get('start' => [options[:species_index].to_i - 1, options[:begin_element]], 'end' => [options[:species_index].to_i - 1, options[:end_element]]).to_a.flatten)
755
+ end
756
+ end
734
757
  def es_mom_flux_over_time_gsl_vector(options)
735
758
  Dir.chdir(@directory) do
736
759
 
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.10
4
+ version: 0.9.11
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-08-16 00:00:00.000000000 Z
13
+ date: 2013-08-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coderunner