trinitycrmod 0.3.11 → 0.3.12
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 +38 -0
- data/trinitycrmod.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a84258c4e74cbad84b2cd657f8aea092d9cc7bf4
|
4
|
+
data.tar.gz: f1a9bec20a809cf64c63ad0a808edb6ae931e4da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14b7f43998e0d4707f6e77a929bcca7395f54a464740b5402c5e5e49a575b4e690e11bc5b6b71f4cea90bba67f1950e7ea68b1c1e34ef4f0a22e5721f7778f14
|
7
|
+
data.tar.gz: 687755340f32f4cc6e59925f338c227c400aa20ed4709f39ebf68023d18a1c558a46306eee2c600cb8fe34b79dcbddb56471867945dcdd2b81a1b5968c362243
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.12
|
data/lib/trinitycrmod/trinity.rb
CHANGED
@@ -18,6 +18,7 @@ class CodeRunner
|
|
18
18
|
|
19
19
|
# Use the Run::FortranNamelist tools to process the variable database
|
20
20
|
setup_namelists(@code_module_folder)
|
21
|
+
@variables += [:flux_pars]
|
21
22
|
require 'trinitycrmod/output_files'
|
22
23
|
require 'trinitycrmod/graphs'
|
23
24
|
require 'trinitycrmod/trinity_gs2'
|
@@ -95,6 +96,43 @@ class CodeRunner
|
|
95
96
|
end
|
96
97
|
|
97
98
|
|
99
|
+
# Update submission parameters in the normal way then deal with parameters
|
100
|
+
# for the flux code. Each flux code will behave differently.
|
101
|
+
#
|
102
|
+
# * Gs2
|
103
|
+
# flux_pars: {nx: 43, delt: {1=> 0.01, 2=>0.05}}
|
104
|
+
# will set nx for all runs to be 43, and delt for run 1 to 0.01, delt
|
105
|
+
# for run 2 to be 0.05
|
106
|
+
def update_submission_parameters(parameters, start_from_defaults=true)
|
107
|
+
super(parameters, start_from_defaults)
|
108
|
+
if @flux_pars
|
109
|
+
@flux_pars.each do |par, val|
|
110
|
+
if @flux_option == "gs2"
|
111
|
+
if val.kind_of? Hash
|
112
|
+
val.each{|n,v| gs2_runs[n].set(par, v)}
|
113
|
+
else
|
114
|
+
gs2_runs.each{|r| r.set(par, val)}
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
self
|
120
|
+
end
|
121
|
+
|
122
|
+
# Override CodeRunner::Run method to deal with flux_pars properly
|
123
|
+
# when generating run_name
|
124
|
+
def generate_run_name
|
125
|
+
@run_name = %[v#@version] + @naming_pars.inject("") do |str, par|
|
126
|
+
case par
|
127
|
+
when :flux_pars
|
128
|
+
str+="_flx_#{send(par).map{|k,v| "#{k}_#{v.to_s[0..8]}"}.join("_")}}"
|
129
|
+
else
|
130
|
+
str+="_#{par}_#{send(par).to_s[0...8]}"
|
131
|
+
end
|
132
|
+
end
|
133
|
+
@run_name = @run_name.gsub(/\s+/, "_").gsub(/[\/{}]/, '') + "_id_#@id"
|
134
|
+
end
|
135
|
+
|
98
136
|
# The number of separate flux tube results needed for the jacobian
|
99
137
|
def n_flux_tubes
|
100
138
|
d1 = dflx_stencil_actual - 1
|
data/trinitycrmod.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
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.12 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.12"
|
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"]
|