diff --git a/openmc/settings.py b/openmc/settings.py index 84f77312d9..5f8b53075c 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -964,7 +964,7 @@ class Settings(object): def _create_cutoff_subelement(self, root): if self._cutoff is not None: element = ET.SubElement(root, "cutoff") - for key, value in self.items(): + for key, value in self._cutoff.items(): subelement = ET.SubElement(element, key) subelement.text = str(value) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index e6930247f3..84c70b87b3 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -624,6 +624,10 @@ contains end if if (check_for_node(node_cutoff, "energy_neutron")) then call get_node_value(node_cutoff, "energy_neutron", energy_cutoff(1)) + elseif (check_for_node(node_cutoff, "energy")) then + call warning("The use of an cutoff is deprecated and should & + &be replaced by .") + call get_node_value(node_cutoff, "energy", energy_cutoff(1)) end if if (check_for_node(node_cutoff, "energy_photon")) then call get_node_value(node_cutoff, "energy_photon", energy_cutoff(2)) diff --git a/src/physics_mg.F90 b/src/physics_mg.F90 index b5d34838c2..198809994f 100644 --- a/src/physics_mg.F90 +++ b/src/physics_mg.F90 @@ -250,6 +250,9 @@ contains ! Bank source neutrons by copying particle data bank_array(i) % xyz = p % coord(1) % xyz + ! Set particle as neutron + bank_array(i) % particle = NEUTRON + ! Set weight of fission bank site bank_array(i) % wgt = ONE/weight diff --git a/tests/test_energy_cutoff/inputs_true.dat b/tests/test_energy_cutoff/inputs_true.dat index 17851b05ad..bb02369dc5 100644 --- a/tests/test_energy_cutoff/inputs_true.dat +++ b/tests/test_energy_cutoff/inputs_true.dat @@ -27,7 +27,7 @@ - 4.0 + 4.0 diff --git a/tests/test_energy_cutoff/test_energy_cutoff.py b/tests/test_energy_cutoff/test_energy_cutoff.py index 3aa3400c7a..ceefa79055 100755 --- a/tests/test_energy_cutoff/test_energy_cutoff.py +++ b/tests/test_energy_cutoff/test_energy_cutoff.py @@ -41,7 +41,7 @@ class EnergyCutoffTestHarness(PyAPITestHarness): settings_file.run_mode = 'fixed source' settings_file.batches = 10 settings_file.particles = 100 - settings_file.cutoff = {'energy': energy_cutoff} + settings_file.cutoff = {'energy_neutron': energy_cutoff} bounds = [-1, -1, -1, 1, 1, 1] uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:]) watt_dist = openmc.stats.Watt()