trinitycrmod 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/trinitycrmod/trinity.rb +3 -0
- data/lib/trinitycrmod/trinity_gs2.rb +22 -2
- data/trinitycrmod.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bc69720254ce2556f354d010a077aca3ee8ea76
|
4
|
+
data.tar.gz: 4e9f6850f1f4a7e71ea6ea8fcb95e203a3d464ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b22d130f1233dad7876ddcb8c2023e03b2bec58f5f105a8064f7390e12ff1a8f08cec3b192e4b86109f4ae74471829bd9cc1732612dcf23a35f6343c242eda4
|
7
|
+
data.tar.gz: 33eca2219135e6fe9f2a86c4f1d835497172110998afac8ba6ffb92f98414b1da9c9ba4550ea67aa9dde57106b1f8e468b8ae1cfeb69cef04e7068d536780c77
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
data/lib/trinitycrmod/trinity.rb
CHANGED
@@ -7,6 +7,9 @@ class CodeRunner
|
|
7
7
|
# It generates the Trinity input file, and both analyses the results and allows easy plotting of them. It also interfaces with the GS2 CodeRunner module to allow analysis of the individual GS2 results if GS2 is being used as the flux code.
|
8
8
|
class Trinity < Run::FortranNamelist
|
9
9
|
#include CodeRunner::SYSTEM_MODULE
|
10
|
+
#
|
11
|
+
|
12
|
+
class FluxOptionError < StandardError; end
|
10
13
|
|
11
14
|
|
12
15
|
|
@@ -44,7 +44,11 @@ EOF2
|
|
44
44
|
|
45
45
|
end
|
46
46
|
|
47
|
+
# Generates the component runs for GS2 and returns the hash
|
48
|
+
# Raises an error if flux_option != "gs2"
|
47
49
|
def gs2_runs
|
50
|
+
raise FluxOptionError.new("gs2_runs called and flux_option != gs2") if not flux_gs2?
|
51
|
+
|
48
52
|
#puts "2@COMMMMMMMMMMMMMPOOOOOOOOOOOOOONNNETN", @component_runs
|
49
53
|
generate_component_runs if not (@component_runs and @component_runs.size > 0)
|
50
54
|
#p ["@COMMMMMMMMMMMMMPOOOOOOOOOOOOOONNNETN", @component_runs]
|
@@ -62,15 +66,31 @@ EOF2
|
|
62
66
|
# Override standard CodeRunner method to allow for Gs2 variables
|
63
67
|
def evaluate_defaults_file(filename)
|
64
68
|
text = File.read(filename)
|
69
|
+
instance_eval(text)
|
65
70
|
text.scan(/^\s*@(\w+)/) do
|
66
71
|
var_name = $~[1].to_sym
|
67
72
|
next if var_name == :defaults_file_description
|
68
|
-
unless rcp.variables.include? var_name or Gs2.rcp.variables.include? var_name
|
73
|
+
unless rcp.variables.include? var_name or (flux_gs2? and Gs2.rcp.variables.include? var_name)
|
69
74
|
warning("---#{var_name}---, specified in #{File.expand_path(filename)}, is not a variable. This could be an error")
|
70
75
|
end
|
71
76
|
end
|
72
|
-
instance_eval(text)
|
73
77
|
end
|
74
78
|
|
79
|
+
# An array of arrays containing the GS2 run times for each iteration.
|
80
|
+
# Produced unscientifically by scanning the stdout.
|
81
|
+
def gs2_run_times
|
82
|
+
raise FluxOptionError.new("gs2_run_times called and flux_option != gs2") if not flux_gs2?
|
83
|
+
run_times = []
|
84
|
+
File.open(@directory + '/' + output_file, "r").each_line{|l| l.scan(/Job.*timer.*(\d+\.\d+)/){run_times.push $~[1].to_f}}
|
85
|
+
sz = run_times.size.to_f
|
86
|
+
return run_times.pieces((sz / n_flux_tubes.to_f).ceil)
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
# Is the flux tube code being used gs2?
|
91
|
+
def flux_gs2?
|
92
|
+
@flux_option == "gs2"
|
93
|
+
end
|
75
94
|
end
|
95
|
+
|
76
96
|
end
|
data/trinitycrmod.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: trinitycrmod 0.3.
|
5
|
+
# stub: trinitycrmod 0.3.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "trinitycrmod"
|
9
|
-
s.version = "0.3.
|
9
|
+
s.version = "0.3.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Edmund Highcock"]
|
14
|
-
s.date = "2014-02-
|
14
|
+
s.date = "2014-02-11"
|
15
15
|
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."
|
16
16
|
s.email = "edmundhighcock@sourceforge.net"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trinitycrmod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Highcock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coderunner
|