Commit eb1f3dd5 authored by John Tourtellott's avatar John Tourtellott

Fix Track3PWriter to output TotalTime as integer (not boolean)

parent d79ab5fa
// Generated by CMB 29-May-2018 14:09
// Generated by CMB 28-Jun-2018 18:11
TotalTime: on
TotalTime: 20
FieldScales:
{
......@@ -21,7 +21,7 @@ NormalizedField:
Domain:
{
FieldDir: xyzzy
FieldDir: {NERSC folder}
ModeID1: 0
dt: 1.000000
MaxImpacts: 50
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -61,8 +61,11 @@ Side set 6 --------> Secondary
## Postprocess
Enhancement Counter ----------> on (checked)
SEY Surface 1 -----> on (checked)
Boundary Surface --> side set 6
SEY Filename ------> copper.dat
(in ACE3P/internal/test/track3p/pillbox/)
Minimum Enhancement Counter --> 1
SEY Surface 1 -----> on (checked)
Boundary Surface --> side set 6
SEY Filename ------> copper.dat
(in ACE3P/internal/test/track3p/pillbox/)
Minimum Enhancement Counter --> 1
## Save Simulation
pillbox.crf
......@@ -3,6 +3,9 @@
import os
import smtk
from smtk import attribute
from . import basewriter, cardformat
reload(basewriter)
reload(cardformat)
......@@ -20,13 +23,15 @@ class Track3PWriter(basewriter.BaseWriter):
'''
'''
self.scope = scope
self.write_inline_boolean('Domain', item_path='TotalTime')
# Write total time
self.write_inline_value('Domain', item_path='TotalTime')
self.write_field_scales()
self.write_domain()
self.write_inline_boolean('Domain', item_path='OutputImpacts')
self.write_inline_value('Domain', item_path='OutputImpacts')
self.write_emitters()
self.write_materials()
self.write_inline_boolean('SingleParticleTrajectory')
self.write_inline_value('SingleParticleTrajectory')
self.write_postprocess()
def write_field_scales(self):
......@@ -154,20 +159,26 @@ class Track3PWriter(basewriter.BaseWriter):
self.finish_command() # Domain
def write_inline_boolean(self, att_type, item_path=None, name=None):
'''Writes inline command consisting of single boolean
def write_inline_value(self, att_type, item_path=None, name=None):
'''Writes inline command consisting of single value
'''
att = self.get_attribute(att_type)
if not att:
print 'Did not find attribute type %s' % att_type
return
if item_path is None:
item_path = att_type
item = att.itemAtPath(item_path)
if not item:
print 'Did not find item at path \"%s\"" under attribute %s' % \
(att_type, item_path)
return
value = 'on' if item.isEnabled() else 'off'
if item.type() == smtk.attribute.Item.VoidType:
value = 'on' if item.isEnabled() else 'off'
else:
value = item.value()
self.scope.output.write('\n')
# Make sure name is defined
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment