gs2crmod 0.11.86 → 0.11.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/.document +0 -0
  2. data/Gemfile +0 -0
  3. data/LICENSE.txt +0 -0
  4. data/README.md +0 -0
  5. data/README.rdoc +0 -0
  6. data/Rakefile +0 -0
  7. data/VERSION +1 -1
  8. data/ext/extconf.rb +0 -0
  9. data/ext/gs2crmod_ext.c +0 -0
  10. data/gs2crmod.gemspec +2 -2
  11. data/include/gs2crmod_ext.h +0 -0
  12. data/lib/gs2crmod/astrogk/astrogk.rb +0 -0
  13. data/lib/gs2crmod/astrogk/calculations.rb +0 -0
  14. data/lib/gs2crmod/astrogk/check_convergence.rb +0 -0
  15. data/lib/gs2crmod/astrogk/deleted_variables.rb +0 -0
  16. data/lib/gs2crmod/astrogk/graphs.rb +0 -0
  17. data/lib/gs2crmod/astrogk/gsl_data.rb +0 -0
  18. data/lib/gs2crmod/astrogk/gsl_tools.rb +0 -0
  19. data/lib/gs2crmod/astrogk/ingen.rb +0 -0
  20. data/lib/gs2crmod/astrogk/input_file_tools.rb +0 -0
  21. data/lib/gs2crmod/astrogk/namelist_tools.rb +0 -0
  22. data/lib/gs2crmod/astrogk/namelists.rb +0 -0
  23. data/lib/gs2crmod/astrogk/properties.rb +0 -0
  24. data/lib/gs2crmod/astrogk/species_dependent_namelists.rb +0 -0
  25. data/lib/gs2crmod/astrogk/test_gs2.rb +0 -0
  26. data/lib/gs2crmod/astrogk.rb +0 -0
  27. data/lib/gs2crmod/calculations.rb +0 -0
  28. data/lib/gs2crmod/check_convergence.rb +0 -0
  29. data/lib/gs2crmod/cyclone_defaults.rb +0 -0
  30. data/lib/gs2crmod/deleted_variables.rb +0 -0
  31. data/lib/gs2crmod/graphs.rb +3 -3
  32. data/lib/gs2crmod/graphs_rdoc.rb +0 -0
  33. data/lib/gs2crmod/gs2.rb +3 -1
  34. data/lib/gs2crmod/gsl_data.rb +14 -18
  35. data/lib/gs2crmod/gsl_data_3d.rb +0 -0
  36. data/lib/gs2crmod/gsl_tools.rb +0 -0
  37. data/lib/gs2crmod/ingen.rb +0 -0
  38. data/lib/gs2crmod/namelists.rb +0 -0
  39. data/lib/gs2crmod/properties.rb +0 -0
  40. data/lib/gs2crmod/read_netcdf.rb +0 -0
  41. data/lib/gs2crmod/species_dependent_namelists.rb +0 -0
  42. data/lib/gs2crmod/spectrogk/deleted_variables.rb +0 -0
  43. data/lib/gs2crmod/spectrogk/namelists.rb +0 -0
  44. data/lib/gs2crmod/spectrogk.rb +0 -0
  45. data/lib/gs2crmod/test_gs2.rb +0 -0
  46. data/lib/gs2crmod.rb +0 -0
  47. data/lib/gs2crmod_extension.rb +0 -0
  48. data/sync_mediawiki/helper.rb +0 -0
  49. data/sync_mediawiki/sync_mediawiki.rb +0 -0
  50. data/sync_variables/copy_help.rb +0 -0
  51. data/sync_variables/helper.rb +0 -0
  52. data/sync_variables/sync_variables.rb +0 -0
  53. data/sync_variables_sgk/helper.rb +0 -0
  54. data/sync_variables_sgk/sync_variables_sgk.rb +0 -0
  55. metadata +2 -2
data/.document CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/README.rdoc CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.86
1
+ 0.11.87
data/ext/extconf.rb CHANGED
File without changes
data/ext/gs2crmod_ext.c CHANGED
File without changes
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.86"
8
+ s.version = "0.11.87"
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 = "2015-01-27"
12
+ s.date = "2015-02-12"
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"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -58,7 +58,7 @@ def auto_axiskits(name, options)
58
58
  'es_mom_flux_over_time' => ["#{species_type((options[:species_index] or 1)).capitalize} Momentum Flux", '', 1],
59
59
  'es_part_flux_over_time' => ["#{species_type((options[:species_index] or 1)).capitalize} Particle Flux", '', 1],
60
60
  'zonal_spectrum' => ["Zonal spectrum at t = #{sprintf("%.3f" ,(options[:t] or list(:t)[options[:t_index]] or list(:t).values.max))}", '', 1],
61
- 'zonal_flow_velocity_over_x' => ['Zonal Flow Velocity', "", 1],
61
+ 'zf_velocity_over_x' => ['Zonal Flow Velocity', "", 1],
62
62
  'mean_flow_velocity_over_x' => ['Mean Flow Velocity', "", 1]
63
63
  }
64
64
  return hash[name]
@@ -2419,7 +2419,7 @@ module GraphKits
2419
2419
  end
2420
2420
  end
2421
2421
 
2422
- def zonal_flow_velocity_vs_x_graphkit(options={})
2422
+ def zf_velocity_vs_x_graphkit(options={})
2423
2423
  case options[:command]
2424
2424
  when :help
2425
2425
  return "zonal_flow_velocity_vs_x: Graph of the zonal flow velocity kxfac*IFT(i k_x phi). kxfac = (qinp/rhoc)*grho(rhoc)."
@@ -2427,7 +2427,7 @@ module GraphKits
2427
2427
  return [:t, :t_index, :theta_index, :kxfac, :add_mean_flow]
2428
2428
  else
2429
2429
  options[:ky_index]=0
2430
- kit = GraphKit.autocreate({x: axiskit('x', options), y: axiskit("zonal_flow_velocity_over_x", options)})
2430
+ kit = GraphKit.autocreate({x: axiskit('x', options), y: axiskit("zf_velocity_over_x", options)})
2431
2431
  if options[:add_mean_flow]
2432
2432
  kit.data[0].y.data += mean_flow_velocity_over_x_gsl_vector(options)
2433
2433
  end
File without changes
data/lib/gs2crmod/gs2.rb CHANGED
@@ -1252,7 +1252,7 @@ folder = File.dirname(File.expand_path(__FILE__)) # i.e. the directory this file
1252
1252
  def latex_graphs
1253
1253
  #will have a different set of graphs to look at depending on whether linear or nonlinear
1254
1254
  if @nonlinear_mode == "off"
1255
- #make up a list of graphs that are to be included. The order of the arguments is [code to generate graphkit, LaTeX description and ]
1255
+ #make up a list of graphs that are to be included. The order of the arguments is [code to generate graphkit, LaTeX description]
1256
1256
  graphs = [
1257
1257
  #[(kit = phi2_by_mode_vs_time({kx_index:1, ky_index:1}); kit.xlabel=%[TEST]; kit.gp.term = "post eps color enhanced size 3.5in,2.33in"; kit.gp.output = "test.eps"; kit), "This is a test graph written into a \LaTeX file. \n\n \\myfigure{test.eps}"]
1258
1258
  [(kit = phi2tot_vs_time_graphkit; kit.data[0].title=""; kit.gp.logscale="y"; kit.file_name = "phi2tot.eps"; kit), "Total $\\phi^2$ versus time."],
@@ -1277,6 +1277,8 @@ folder = File.dirname(File.expand_path(__FILE__)) # i.e. the directory this file
1277
1277
  [(kit = es_mom_flux_vs_time_graphkit(species_index:1); kit.file_name = "es_mom_flux_1_vs_time.eps"; kit), "Momentum flux for species 1 as a function of time."],
1278
1278
  if @nspec > 1 then [(kit = es_mom_flux_vs_time_graphkit(species_index:2); kit.file_name = "es_mom_flux_2_vs_time.eps"; kit), "Momentum flux for species 2 as a function of time."] end,
1279
1279
  [(kit = zonal_spectrum_graphkit; kit.gp.logscale="y"; kit.file_name = "zonal_spectrum.eps"; kit), "Zonal spectrum at the final time step."],
1280
+ if @write_eigenfunc == ".true." then [(kit = zf_velocity_vs_x_graphkit(theta_index:get_list_of(:theta).length/2); kit.file_name = "zonal_flow_velocity_vs_x.eps"; kit), "Zonal flow velocity avg over time versus x."] end,
1281
+ if @write_eigenfunc == ".true." and @g_exb then [(kit = zf_velocity_vs_x_graphkit(theta_index:get_list_of(:theta).length/2, add_mean_flow:true); kit.file_name = "zonal_flow_velocity_vs_x_with_mean_flow.eps"; kit), "Zonal flow velocity with mean flow added avg over time versus x."] end,
1280
1282
  ].compact
1281
1283
  end
1282
1284
 
@@ -1037,16 +1037,23 @@ module GSLVectors
1037
1037
 
1038
1038
  #This function returns the zonal flow velocity as a function of x (the radial coordinate).
1039
1039
  #This is v_ZF = kxfac*IFT(i k_x phi_imag), where kxfac = (qinp/rhoc)*grho(rhoc).
1040
- def zonal_flow_velocity_over_x_gsl_vector(options)
1040
+ def zf_velocity_over_x_gsl_vector(options)
1041
1041
  Dir.chdir(@directory) do
1042
1042
  raise CRFatal.new("Need to specify a theta_index.") unless options[:theta_index]
1043
1043
  raise CRFatal.new("Need either qinp or pk and epsl specified in order to calculate kxfac.
1044
1044
  If using numerical equil use the option :kxfac to override calculation.") unless @qinp or (@pk and @epsl or options[:kxfac])
1045
- phi = gsl_vector_complex('phi_zonal', options)
1046
1045
 
1047
1046
  kx = gsl_vector(:kx).to_box_order
1048
1047
  _x = gsl_vector(:x)
1049
1048
  grho = gsl_vector('grho')[options[:theta_index]]
1049
+
1050
+ phi = GSL::Vector.alloc(kx.size)
1051
+ for it in 0...gsl_vector(:t).size
1052
+ options[:t_index] = it
1053
+ phi += gsl_vector_complex('phi_zonal', options)
1054
+ end
1055
+ phi /= gsl_vector(:t).size
1056
+
1050
1057
  if @qinp
1051
1058
  kxfac = (@qinp/@rhoc)*grho
1052
1059
  elsif @pk and @epsl
@@ -1164,25 +1171,14 @@ module GSLVectorComplexes
1164
1171
  #and time index if write_phi_over_time was enabled during the simulation
1165
1172
  def phi_zonal_gsl_vector_complex(options)
1166
1173
  Dir.chdir(@directory) do
1167
- if options[:t_index] or options[:t]
1168
- #extra option required is t_index
1169
- raise CRFatal.new("write_phi_over_time is not enabled so this function won't work") unless @write_phi_over_time
1170
-
1174
+ raise CRFatal.new("write_eigenfunc is not enabled so this function won't work") unless @write_eigenfunc
1171
1175
  options.convert_to_index(self, :t)
1172
- a = netcdf_file.var('phi_t').get({
1173
- 'start' => [0,options[:theta_index],0,0, options[:t_index] - 1],
1174
- 'end' => [-1,options[:theta_index],-1,0, options[:t_index] - 1]
1176
+ a = netcdf_file.var('phi0').get({
1177
+ 'start' => [0,0,0, options[:t_index] - 1],
1178
+ 'end' => [-1,-1,0, options[:t_index] - 1]
1175
1179
  })
1176
- vector = GSL::Vector::Complex.alloc(GSL::Vector.alloc(a[0,0,0..-1,0,0]), GSL::Vector.alloc(a[1,0,0..-1,0,0]))
1180
+ vector = GSL::Vector::Complex.alloc(GSL::Vector.alloc(a[0,0..-1,0,0]), GSL::Vector.alloc(a[1,0..-1,0,0]))
1177
1181
  return vector
1178
- else
1179
- a = netcdf_file.var('phi').get({
1180
- 'start' => [0, options[:theta_index], 0, 0],
1181
- 'end' => [-1, options[:theta_index], -1, 0]
1182
- })
1183
- vector = GSL::Vector::Complex.alloc(GSL::Vector.alloc(a[0,0,0..-1,0]), GSL::Vector.alloc(a[1,0,0..-1,0]))
1184
- return vector
1185
- end
1186
1182
  end
1187
1183
  end
1188
1184
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/gs2crmod.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
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.86
4
+ version: 0.11.87
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: 2015-01-27 00:00:00.000000000 Z
13
+ date: 2015-02-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coderunner