trinitycrmod 0.4.6 → 0.4.7
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/chease.rb +12 -0
- data/lib/trinitycrmod/namelists.rb +13 -0
- data/lib/trinitycrmod/trinity.rb +6 -2
- data/lib/trinitycrmod/trinity_gs2.rb +34 -0
- data/trinitycrmod.gemspec +5 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de402b01828cad54befc2cd1b24c844708baad52
|
4
|
+
data.tar.gz: 62fcd6580cb2ea81fdb18a3ccf15f0f92d6f2e4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33d8abf68a7dfa234bf550e9abb82cb669feae70660932630c062982372bca8adab0b846ec82bd5fd7d9f82a897ab1de4d7e9f13364024459e91cdaad33f67b5
|
7
|
+
data.tar.gz: 5db951cf9ea54d1e94dedd2a11fc33f40d16b7bab10bca1da7c14eb0fa1b2d508ed66808ca4073030300421507b7b2f629330ff4aa5baf984f82f8f376342dd1
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.7
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CodeRunner::Trinity
|
2
|
+
def uses_chease?
|
3
|
+
@geo_option == "chease" or @init_option == "chease" or @species_option == "chease"
|
4
|
+
end
|
5
|
+
def setup_chease
|
6
|
+
ep "Setting up chease files..."
|
7
|
+
FileUtils.mkdir('chease')
|
8
|
+
origfile = @runner.root_folder + '/ogyropsi.dat'
|
9
|
+
FileUtils.cp(origfile, 'chease/ogyropsi.dat') if FileTest.exist? origfile
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -227,6 +227,19 @@
|
|
227
227
|
:explanation=>
|
228
228
|
"This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
|
229
229
|
:type=>:Fortran_Bool,
|
230
|
+
:autoscanned_defaults=>[".false."]},
|
231
|
+
:evolve_geometry=>
|
232
|
+
{:should_include=>"true",
|
233
|
+
:description=>
|
234
|
+
" if true, recalculate the magnetic equilibrium at each timestep",
|
235
|
+
:help=>
|
236
|
+
" if true, recalculate the magnetic equilibrium at each timestep",
|
237
|
+
:code_name=>:evolve_geometry,
|
238
|
+
:must_pass=>
|
239
|
+
[{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
|
240
|
+
:explanation=>
|
241
|
+
"This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
|
242
|
+
:type=>:Fortran_Bool,
|
230
243
|
:autoscanned_defaults=>[".false."]}}},
|
231
244
|
:species=>
|
232
245
|
{:description=>"",
|
data/lib/trinitycrmod/trinity.rb
CHANGED
@@ -21,12 +21,13 @@ class CodeRunner
|
|
21
21
|
@variables += [:flux_pars]
|
22
22
|
require 'trinitycrmod/output_files'
|
23
23
|
require 'trinitycrmod/graphs'
|
24
|
-
require 'trinitycrmod/trinity_gs2'
|
25
24
|
require 'trinitycrmod/check_parameters'
|
26
25
|
require 'trinitycrmod/actual_parameter_values'
|
26
|
+
require 'trinitycrmod/chease'
|
27
27
|
|
28
28
|
# Setup gs2 in case people are using it
|
29
29
|
CodeRunner.setup_run_class('gs2')
|
30
|
+
require 'trinitycrmod/trinity_gs2'
|
30
31
|
|
31
32
|
################################################
|
32
33
|
# Quantities that are read or determined by CodeRunner
|
@@ -144,6 +145,7 @@ class CodeRunner
|
|
144
145
|
if @restart_id
|
145
146
|
@runner.run_list[@restart_id].restart(self)
|
146
147
|
end
|
148
|
+
setup_chease if uses_chease?
|
147
149
|
write_input_file
|
148
150
|
generate_gs2_input_files if @flux_option == "gs2"
|
149
151
|
end
|
@@ -297,7 +299,8 @@ class CodeRunner
|
|
297
299
|
if not component
|
298
300
|
#p "HEELO"
|
299
301
|
#p [i, '3,', component, '4', @component_runs.size]
|
300
|
-
component = @component_runs[i] = Gs2.new(@runner).create_component
|
302
|
+
component = @component_runs[i] = Gs2::TrinityComponent.new(@runner, self).create_component
|
303
|
+
#component.instance_variable_set(:@output_file, output_file)
|
301
304
|
#p [i, '3,', component, '4', @component_runs.size]
|
302
305
|
if i > 0 and @component_runs[i-1]
|
303
306
|
component.rcp.variables.each do |var|
|
@@ -326,6 +329,7 @@ class CodeRunner
|
|
326
329
|
Dir.chdir(compdir){component.process_directory} if FileTest.exist? compdir
|
327
330
|
#}
|
328
331
|
component.component_runs = []
|
332
|
+
component.trinity_run = self
|
329
333
|
#@component_runs.push component
|
330
334
|
component.real_id = @id
|
331
335
|
#@gs2_run_list[i] = component
|
@@ -7,6 +7,40 @@
|
|
7
7
|
#end
|
8
8
|
#end
|
9
9
|
class CodeRunner
|
10
|
+
class Gs2
|
11
|
+
class TrinityComponent < Gs2
|
12
|
+
attr_accessor :trinity_run
|
13
|
+
def initialize(runner, trinity_run)
|
14
|
+
super(runner)
|
15
|
+
@trinity_run = trinity_run
|
16
|
+
self
|
17
|
+
end
|
18
|
+
def output_file
|
19
|
+
#@output_file ||= '../' + self.class.to_s
|
20
|
+
'../' + @trinity_run.output_file
|
21
|
+
#'aa'
|
22
|
+
end
|
23
|
+
def error_file
|
24
|
+
'../' + @trinity_run.error_file
|
25
|
+
#'aa'
|
26
|
+
end
|
27
|
+
def dup
|
28
|
+
return self.class.new(@runner, @trinity_run).learn_from(self)
|
29
|
+
end
|
30
|
+
def save
|
31
|
+
#p ['output_file', output_file]
|
32
|
+
#p ['ancestors', self.class.ancestors]
|
33
|
+
trinrun, @trinity_run = @trinity_run, nil
|
34
|
+
component_runs.each{|cr| cr.trinity_run = nil}
|
35
|
+
#@trinity_run = nil
|
36
|
+
#@output_file = nil
|
37
|
+
#GC.start
|
38
|
+
#p self.instance_variables.find_all{|v| instance_variable_get(v).class.to_s =~ /NumRu::NetCDF/}
|
39
|
+
super
|
40
|
+
@trinity_run = trinrun
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
10
44
|
class Trinity
|
11
45
|
|
12
46
|
# This function creates a new Trinity defaults file, with Trinity parameters taken from
|
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.4.
|
5
|
+
# stub: trinitycrmod 0.4.7 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "trinitycrmod"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.7"
|
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-
|
14
|
+
s.date = "2014-06-20"
|
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 = [
|
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"VERSION",
|
28
28
|
"lib/trinitycrmod.rb",
|
29
29
|
"lib/trinitycrmod/actual_parameter_values.rb",
|
30
|
+
"lib/trinitycrmod/chease.rb",
|
30
31
|
"lib/trinitycrmod/check_parameters.rb",
|
31
32
|
"lib/trinitycrmod/deleted_variables.rb",
|
32
33
|
"lib/trinitycrmod/graphs.rb",
|
@@ -40,7 +41,7 @@ Gem::Specification.new do |s|
|
|
40
41
|
]
|
41
42
|
s.homepage = "http://github.com/edmundhighcock/trinitycrmod"
|
42
43
|
s.licenses = ["GPLv3"]
|
43
|
-
s.rubygems_version = "2.2.
|
44
|
+
s.rubygems_version = "2.2.2"
|
44
45
|
s.summary = "CodeRunner module for the Trinity simulation software."
|
45
46
|
|
46
47
|
if s.respond_to? :specification_version then
|
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.4.
|
4
|
+
version: 0.4.7
|
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-
|
11
|
+
date: 2014-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coderunner
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- VERSION
|
127
127
|
- lib/trinitycrmod.rb
|
128
128
|
- lib/trinitycrmod/actual_parameter_values.rb
|
129
|
+
- lib/trinitycrmod/chease.rb
|
129
130
|
- lib/trinitycrmod/check_parameters.rb
|
130
131
|
- lib/trinitycrmod/deleted_variables.rb
|
131
132
|
- lib/trinitycrmod/graphs.rb
|
@@ -156,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
157
|
version: '0'
|
157
158
|
requirements: []
|
158
159
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.2.
|
160
|
+
rubygems_version: 2.2.2
|
160
161
|
signing_key:
|
161
162
|
specification_version: 4
|
162
163
|
summary: CodeRunner module for the Trinity simulation software.
|