Commit ff3e704c authored by John Tourtellott's avatar John Tourtellott

Recast Track3P materials into separate primary, secondary, & absorber types

* Primary material also has optional secondary
* Also fixed typo in TEM3P boundary condition (SymmetryFactor 2)
parent 83cbdd6b
......@@ -265,7 +265,7 @@ SMTK_AttributeSystem(Version="2")
DiscreteInfo(DefaultIndex=0)
Value(Enum="1 = Full Cell") 1
Value(Enum="0 = Half Cell") 0
Value(Enum="3 = Quarter Cell") 2
Value(Enum="2 = Quarter Cell") 2
String(Name="SurfaceResistance" Label="Surface Resistance")
BriefDescription Nonlinear surface resistance
......
......@@ -278,15 +278,43 @@ SMTK_AttributeSystem(Version="2")
String(Name="Placeholder" AdvanceLevel="99")
Categories #[Cat Track3P]
AttDef(Type="Track3PMaterialMultipactingPrimary" BaseType="Track3PMaterial" Label="Primary" Version="1")
ItemDefinitions
AttributeRef(Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0")
AttDef Emitter
Categories #[Cat Track3P]
Void(Name="Secondary" Label="Secondary" Optional="true" IsEnabledByDefault="false" Version="0")
Categories #[Cat Track3P]
AttDef(Type="Track3PMaterialMultipactingSecondary" BaseType="Track3PMaterial" Label="Secondary" Version="0")
ItemDefinitions
Group(Name="Primary" Label="Primary" Optional="true" IsEnabledByDefault="false" Version="0")
Void(Name="Placeholder" AdvanceLevel="99")
Categories #[Cat Track3P]
AttDef(Type="Track3PMaterialDarkCurrentPrimary" BaseType="Track3PMaterial" Label="Primary" Version="1")
ItemDefinitions
AttributeRef(Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0")
AttDef Emitter
Categories #[Cat Track3P]
Group(Name="Secondary" Label="Secondary" Optional="true" IsEnabledByDefault="false" Version="0")
ItemDefinitions
AttributeRef(Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0")
AttDef Emitter
File(Name="SEYFilename" Label="SEY Filename" Version="0" ShouldExist="true")
BriefDescription File containing secondary emission data for the selected surface
Categories #[Cat Track3P]
AttDef(Type="Track3PMaterialDarkCurrentSecondary" BaseType="Track3PMaterial" Label="Secondary" Version="0")
Int(Name="MinimumNumElectrons" Label="Minimum Number of Electrons" Version="0")
BriefDescription Minimum number of electrons in each secondary macro particle
Categories #[Cat Track3P]
DefaultValue 1000
RangeInfo #[Min(Inclusive="true") 1]
Int(Name="ElasticThreshold" Label="Elastic Threshold" Version="0")
BriefDescription Minimum number of electrons in each secondary reflected-type macro particle
Categories #[Cat Track3P]
DefaultValue 1000
RangeInfo #[Min(Inclusive="true") 1]
AttDef(Type="Track3PMaterialDarkCurrentSecondary" BaseType="Track3PMaterial" Label="Secondary" Version="1")
ItemDefinitions
File(Name="SEYFilename" Label="SEY Filename" Version="0" ShouldExist="true")
BriefDescription File containing secondary emission data for the selected surface
......@@ -303,12 +331,6 @@ SMTK_AttributeSystem(Version="2")
DefaultValue 1000
RangeInfo #[Min(Inclusive="true") 1]
Group(Name="Primary" Label="Primary" Optional="true" IsEnabledByDefault="false" Version="0")
ItemDefinitions
AttributeRef(Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0")
AttDef Emitter
Categories #[Cat Track3P]
// Selector attribute - used by selector view
AttDef(Type="Track3PModelSelectorAtt" Version="0")
ItemDefinitions
......@@ -445,11 +467,13 @@ SMTK_AttributeSystem(Version="2")
View(Type="ModelEntity" Title="Track3PMultipacting" ModelEntityFilter="rf")
AttributeTypes
Att(Type="Track3PMaterialMultipactingPrimary")
Att(Type="Track3PMaterialMultipactingSecondary")
Att(Type="Track3PAbsorber")
View(Type="ModelEntity" Title="Track3PDarkCurrent" ModelEntityFilter="rf")
AttributeTypes
Att(Type="Track3PMaterialDarkCurrentPrimary")
Att(Type="Track3PMaterialDarkCurrentSecondary")
Att(Type="Track3PAbsorber")
= '\n'
......
......@@ -482,7 +482,7 @@
<DiscreteInfo DefaultIndex="0">
<Value Enum="1 = Full Cell">1</Value>
<Value Enum="0 = Half Cell">0</Value>
<Value Enum="3 = Quarter Cell">2</Value>
<Value Enum="2 = Quarter Cell">2</Value>
</DiscreteInfo>
</Int>
<String Name="SurfaceResistance" Label="Surface Resistance">
......
......@@ -453,21 +453,71 @@
</String>
</ItemDefinitions>
</AttDef>
<AttDef Type="Track3PMaterialMultipactingPrimary" BaseType="Track3PMaterial" Label="Primary" Version="1">
<ItemDefinitions>
<AttributeRef Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0">
<AttDef>Emitter</AttDef>
<Categories>
<Cat>Track3P</Cat>
</Categories>
</AttributeRef>
<Void Name="Secondary" Label="Secondary" Optional="true" IsEnabledByDefault="false" Version="0">
<Categories>
<Cat>Track3P</Cat>
</Categories>
</Void>
</ItemDefinitions>
</AttDef>
<AttDef Type="Track3PMaterialMultipactingSecondary" BaseType="Track3PMaterial" Label="Secondary" Version="0">
<ItemDefinitions>
<Group Name="Primary" Label="Primary" Optional="true" IsEnabledByDefault="false" Version="0">
<Void Name="Placeholder" AdvanceLevel="99">
<Categories>
<Cat>Track3P</Cat>
</Categories>
</Void>
</ItemDefinitions>
</AttDef>
<AttDef Type="Track3PMaterialDarkCurrentPrimary" BaseType="Track3PMaterial" Label="Primary" Version="1">
<ItemDefinitions>
<AttributeRef Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0">
<AttDef>Emitter</AttDef>
<Categories>
<Cat>Track3P</Cat>
</Categories>
</AttributeRef>
<Group Name="Secondary" Label="Secondary" Optional="true" IsEnabledByDefault="false" Version="0">
<ItemDefinitions>
<AttributeRef Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0">
<AttDef>Emitter</AttDef>
<File Name="SEYFilename" Label="SEY Filename" Version="0" ShouldExist="true">
<BriefDescription>File containing secondary emission data for the selected surface</BriefDescription>
<Categories>
<Cat>Track3P</Cat>
</Categories>
</AttributeRef>
</File>
<Int Name="MinimumNumElectrons" Label="Minimum Number of Electrons" Version="0">
<BriefDescription>Minimum number of electrons in each secondary macro particle</BriefDescription>
<Categories>
<Cat>Track3P</Cat>
</Categories>
<DefaultValue>1000</DefaultValue>
<RangeInfo>
<Min Inclusive="true">1</Min>
</RangeInfo>
</Int>
<Int Name="ElasticThreshold" Label="Elastic Threshold" Version="0">
<BriefDescription>Minimum number of electrons in each secondary reflected-type macro particle</BriefDescription>
<Categories>
<Cat>Track3P</Cat>
</Categories>
<DefaultValue>1000</DefaultValue>
<RangeInfo>
<Min Inclusive="true">1</Min>
</RangeInfo>
</Int>
</ItemDefinitions>
</Group>
</ItemDefinitions>
</AttDef>
<AttDef Type="Track3PMaterialDarkCurrentSecondary" BaseType="Track3PMaterial" Label="Secondary" Version="0">
<AttDef Type="Track3PMaterialDarkCurrentSecondary" BaseType="Track3PMaterial" Label="Secondary" Version="1">
<ItemDefinitions>
<File Name="SEYFilename" Label="SEY Filename" Version="0" ShouldExist="true">
<BriefDescription>File containing secondary emission data for the selected surface</BriefDescription>
......@@ -495,16 +545,6 @@
<Min Inclusive="true">1</Min>
</RangeInfo>
</Int>
<Group Name="Primary" Label="Primary" Optional="true" IsEnabledByDefault="false" Version="0">
<ItemDefinitions>
<AttributeRef Name="Emitter" Label="Emitter" NumberOfRequiredValues="1" Version="0">
<AttDef>Emitter</AttDef>
<Categories>
<Cat>Track3P</Cat>
</Categories>
</AttributeRef>
</ItemDefinitions>
</Group>
</ItemDefinitions>
</AttDef>
<!-- Selector attribute - used by selector view-->
......@@ -689,12 +729,14 @@
</View>
<View Type="ModelEntity" Title="Track3PMultipacting" ModelEntityFilter="rf">
<AttributeTypes>
<Att Type="Track3PMaterialMultipactingPrimary"></Att>
<Att Type="Track3PMaterialMultipactingSecondary"></Att>
<Att Type="Track3PAbsorber"></Att>
</AttributeTypes>
</View>
<View Type="ModelEntity" Title="Track3PDarkCurrent" ModelEntityFilter="rf">
<AttributeTypes>
<Att Type="Track3PMaterialDarkCurrentPrimary"></Att>
<Att Type="Track3PMaterialDarkCurrentSecondary"></Att>
<Att Type="Track3PAbsorber"></Att>
</AttributeTypes>
......
// Generated by CMB 28-Jun-2018 18:11
// Generated by CMB 23-Jul-2018 15:52
TotalTime: 20
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -53,9 +53,9 @@ Simulation Model --> Multipacting
Side set 1 --------> Absorber
Side set 2 --------> Absorber
Side set 6 --------> Secondary
Primary ---------> on (checked)
Side set 6 --------> Primary
Emitter ---------> Emitter-0
Secondary -------> on (checked)
## Postprocess
......
......@@ -194,10 +194,7 @@ class Track3PWriter(basewriter.BaseWriter):
# Emitters are assigned to model entities via the material attributes
mat_list = self.scope.sim_atts.findAttributes('Track3PMaterial')
for mat_att in mat_list:
primary_item = mat_att.findGroup('Primary')
if primary_item is None or not primary_item.isEnabled():
continue
emitter_item = primary_item.find('Emitter')
emitter_item = mat_att.find('Emitter')
if emitter_item is None or not emitter_item.isSet(0):
continue
......@@ -294,28 +291,37 @@ class Track3PWriter(basewriter.BaseWriter):
# Traverse sorted_dict and write materials
for id_string, att in sorted_dict.iteritems():
# Look for primary material option
primary_item = att.findGroup('Primary')
if primary_item and primary_item.isEnabled():
if 'Primary' in att.type():
self.start_command('Material')
self.scope.output.write(' Type: Primary\n')
self.scope.output.write(' %s: %s\n' % (keyword, id_string))
self.finish_command()
# Write either Secondary or Absorber
self.start_command('Material')
if 'Secondary' in att.type():
# Primary type can include optional secondary item
secondary_item = att.find('Secondary')
if secondary_item is not None:
self.start_command('Material')
self.scope.output.write(' Type: Secondary\n')
self.scope.output.write(' %s: %s\n' % (keyword, id_string))
self._write_secondary_material_items(att, track3p_sim)
self.finish_command()
elif 'Secondary' in att.type():
self.start_command('Material')
self.scope.output.write(' Type: Secondary\n')
self.scope.output.write(' %s: %s\n' % (keyword, id_string))
self._write_secondary_material_items(att, track3p_sim)
self.finish_command()
elif 'Absorber' in att.type():
self.start_command('Material')
self.scope.output.write(' Type: Absorber\n')
self.scope.output.write(' %s: %s\n' % (keyword, id_string))
self.finish_command()
else:
raise Exception('Unrecognized material type %s' % att.type())
self.finish_command() # Material (Secondary or Absorber)
def _write_secondary_material_items(self, att, track3p_sim):
'''Offloads some of the logic from write_materials()
......
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