File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,21 @@ def cells(self):
116
116
if cell .material == self :
117
117
yield cell
118
118
119
+ def format_for_mcnp_input (self , mcnp_version ):
120
+ """
121
+ Creates a string representation of this MCNP_Object that can be
122
+ written to file.
123
+
124
+ :param mcnp_version: The tuple for the MCNP version that must be exported to.
125
+ :type mcnp_version: tuple
126
+ :return: a list of strings for the lines that this input will occupy.
127
+ :rtype: list
128
+ """
129
+ lines = super ().format_for_mcnp_input (mcnp_version )
130
+ if self .thermal_scattering is not None :
131
+ lines += self .thermal_scattering .format_for_mcnp_input (mcnp_version )
132
+ return lines
133
+
119
134
def add_thermal_scattering (self , law ):
120
135
"""
121
136
Adds thermal scattering law to the material
Original file line number Diff line number Diff line change @@ -138,6 +138,10 @@ def test_write_to_file(self):
138
138
for i , data in enumerate (self .simple_problem .data_inputs ):
139
139
if isinstance (data , material .Material ):
140
140
self .assertEqual (data .number , test_problem .data_inputs [i ].number )
141
+ if data .thermal_scattering is not None :
142
+ assert (
143
+ test_problem .data_inputs [i ].thermal_scattering is not None
144
+ )
141
145
elif isinstance (data , volume .Volume ):
142
146
self .assertEqual (str (data ), str (test_problem .data_inputs [i ]))
143
147
else :
You can’t perform that action at this time.
0 commit comments