trinitycrmod 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/trinitycrmod/graphs.rb +4 -4
- data/lib/trinitycrmod/output_files.rb +10 -0
- data/trinitycrmod.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/trinitycrmod/graphs.rb
CHANGED
@@ -2,17 +2,17 @@ class CodeRunner::Trinity
|
|
2
2
|
module TrinityGraphKits
|
3
3
|
# Graphs plotting quantities from the '.nt' file vs rho for a given t_index
|
4
4
|
def nt_prof_graphkit(options)
|
5
|
-
prof_graphkit(options.dup.absorb({outfile:
|
5
|
+
prof_graphkit(options.dup.absorb({outfile: :nt}))
|
6
6
|
end
|
7
7
|
# Graphs plotting quantities from the '.fluxes' file vs rho for a given t_index
|
8
8
|
def fluxes_prof_graphkit(options)
|
9
|
-
prof_graphkit(options.dup.absorb({outfile:
|
9
|
+
prof_graphkit(options.dup.absorb({outfile: :fluxes, exclude_perturbed_fluxes: true}))
|
10
10
|
end
|
11
11
|
def prof_graphkit(options)
|
12
12
|
raise "Please specify t_index" unless options[:t_index]
|
13
13
|
it = options[:t_index] - 1
|
14
|
-
array = options[:outfile]
|
15
|
-
rho_array = options[:outfile]
|
14
|
+
array = get_2d_array_float(options[:outfile], options[:header], /1.*time/)[it]
|
15
|
+
rho_array = get_2d_array_float(options[:outfile], /2.*radius/, /1.*time/)[it]
|
16
16
|
if options[:exclude_perturbed_fluxes]
|
17
17
|
s = array.size
|
18
18
|
array = array.slice(0...nrad-1)
|
@@ -24,5 +24,15 @@ class CodeRunner
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
include OutputFiles
|
27
|
+
|
28
|
+
# Return a two-dimensional array of floatingpoint numbers from the file ending in outfile,
|
29
|
+
# from the column whose header matches column_header, indexed by index_header. See
|
30
|
+
# TextDataTools::Column::DataFile for more information. Outfile is a symbol, use e.g. :nt
|
31
|
+
# for data from 'run_name.nt'.
|
32
|
+
def get_2d_array_float(outfile, column_header, index_header)
|
33
|
+
cache[:array_2d] = {} unless [:Complete, :Failed].include? @status
|
34
|
+
cache[:array_2d] ||= {}
|
35
|
+
cache[:array_2d][[outfile, column_header, index_header]] ||= send(outfile + :_outfile).get_2d_array_float(column_header, index_header)
|
36
|
+
end
|
27
37
|
end
|
28
38
|
end
|
data/trinitycrmod.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "trinitycrmod"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
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"]
|
12
|
-
s.date = "2013-06-
|
12
|
+
s.date = "2013-06-19"
|
13
13
|
s.description = "This module allows Trinity, the Multiscale Gyrokinetic Turbulent Transport solver for Fusion Reactors, to harness the power of CodeRunner, a framework for the automated running and analysis of simulations."
|
14
14
|
s.email = "edmundhighcock@sourceforge.net"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trinitycrmod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: coderunner
|
@@ -151,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
segments:
|
153
153
|
- 0
|
154
|
-
hash:
|
154
|
+
hash: 38043125482508098
|
155
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
156
|
none: false
|
157
157
|
requirements:
|