From 391cb442ef22984af7459ab60e485a313f06693b Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Wed, 12 Jul 2017 11:53:50 -0400 Subject: [PATCH] Only put S(a,b) fraction in XML if not unity --- openmc/material.py | 3 ++- tests/test_asymmetric_lattice/inputs_true.dat | 18 +++++++++--------- tests/test_diff_tally/inputs_true.dat | 18 +++++++++--------- tests/test_filter_energyfun/inputs_true.dat | 18 +++++++++--------- tests/test_filter_mesh/inputs_true.dat | 18 +++++++++--------- tests/test_iso_in_lab/inputs_true.dat | 18 +++++++++--------- .../test_mgxs_library_ce_to_mg/inputs_true.dat | 2 +- .../test_mgxs_library_condense/inputs_true.dat | 2 +- .../inputs_true.dat | 2 +- tests/test_mgxs_library_hdf5/inputs_true.dat | 2 +- tests/test_mgxs_library_mesh/inputs_true.dat | 18 +++++++++--------- .../inputs_true.dat | 2 +- .../test_mgxs_library_nuclides/inputs_true.dat | 2 +- tests/test_multipole/inputs_true.dat | 2 +- tests/test_periodic/inputs_true.dat | 2 +- tests/test_salphabeta/inputs_true.dat | 10 +++++----- tests/test_tallies/inputs_true.dat | 18 +++++++++--------- tests/test_tally_aggregation/inputs_true.dat | 18 +++++++++--------- tests/test_tally_arithmetic/inputs_true.dat | 18 +++++++++--------- tests/test_tally_slice_merge/inputs_true.dat | 18 +++++++++--------- tests/test_triso/inputs_true.dat | 8 ++++---- tests/test_volume_calc/inputs_true.dat | 2 +- 22 files changed, 110 insertions(+), 109 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index 24cd3343aa..03ef7fbc42 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -982,7 +982,8 @@ class Material(IDManagerMixin): for sab in self._sab: subelement = ET.SubElement(element, "sab") subelement.set("name", sab[0]) - subelement.set("fraction", str(sab[1])) + if sab[1] != 1.0: + subelement.set("fraction", str(sab[1])) return element diff --git a/tests/test_asymmetric_lattice/inputs_true.dat b/tests/test_asymmetric_lattice/inputs_true.dat index 50803105d1..672f6bee12 100644 --- a/tests/test_asymmetric_lattice/inputs_true.dat +++ b/tests/test_asymmetric_lattice/inputs_true.dat @@ -78,7 +78,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -144,7 +144,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -174,7 +174,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -200,7 +200,7 @@ - + diff --git a/tests/test_diff_tally/inputs_true.dat b/tests/test_diff_tally/inputs_true.dat index a2c5638cfa..ff134bd5c3 100644 --- a/tests/test_diff_tally/inputs_true.dat +++ b/tests/test_diff_tally/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_filter_energyfun/inputs_true.dat b/tests/test_filter_energyfun/inputs_true.dat index d6f7c1f793..d857451cb0 100644 --- a/tests/test_filter_energyfun/inputs_true.dat +++ b/tests/test_filter_energyfun/inputs_true.dat @@ -171,7 +171,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -207,7 +207,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -267,7 +267,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -293,7 +293,7 @@ - + diff --git a/tests/test_filter_mesh/inputs_true.dat b/tests/test_filter_mesh/inputs_true.dat index 153f4dcd95..6d14f9e7e3 100644 --- a/tests/test_filter_mesh/inputs_true.dat +++ b/tests/test_filter_mesh/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_iso_in_lab/inputs_true.dat b/tests/test_iso_in_lab/inputs_true.dat index 2311d8588c..098056f5b0 100644 --- a/tests/test_iso_in_lab/inputs_true.dat +++ b/tests/test_iso_in_lab/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_mgxs_library_ce_to_mg/inputs_true.dat b/tests/test_mgxs_library_ce_to_mg/inputs_true.dat index 675ef50f1d..8e8cde2818 100644 --- a/tests/test_mgxs_library_ce_to_mg/inputs_true.dat +++ b/tests/test_mgxs_library_ce_to_mg/inputs_true.dat @@ -33,7 +33,7 @@ - + diff --git a/tests/test_mgxs_library_condense/inputs_true.dat b/tests/test_mgxs_library_condense/inputs_true.dat index 38a40c1cca..d2f28d0fe0 100644 --- a/tests/test_mgxs_library_condense/inputs_true.dat +++ b/tests/test_mgxs_library_condense/inputs_true.dat @@ -33,7 +33,7 @@ - + diff --git a/tests/test_mgxs_library_distribcell/inputs_true.dat b/tests/test_mgxs_library_distribcell/inputs_true.dat index 8b6522bdd3..d7a4a186ac 100644 --- a/tests/test_mgxs_library_distribcell/inputs_true.dat +++ b/tests/test_mgxs_library_distribcell/inputs_true.dat @@ -60,7 +60,7 @@ - + diff --git a/tests/test_mgxs_library_hdf5/inputs_true.dat b/tests/test_mgxs_library_hdf5/inputs_true.dat index 38a40c1cca..d2f28d0fe0 100644 --- a/tests/test_mgxs_library_hdf5/inputs_true.dat +++ b/tests/test_mgxs_library_hdf5/inputs_true.dat @@ -33,7 +33,7 @@ - + diff --git a/tests/test_mgxs_library_mesh/inputs_true.dat b/tests/test_mgxs_library_mesh/inputs_true.dat index 8bfcc64b61..4756b27bfb 100644 --- a/tests/test_mgxs_library_mesh/inputs_true.dat +++ b/tests/test_mgxs_library_mesh/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_mgxs_library_no_nuclides/inputs_true.dat b/tests/test_mgxs_library_no_nuclides/inputs_true.dat index 38a40c1cca..d2f28d0fe0 100644 --- a/tests/test_mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_no_nuclides/inputs_true.dat @@ -33,7 +33,7 @@ - + diff --git a/tests/test_mgxs_library_nuclides/inputs_true.dat b/tests/test_mgxs_library_nuclides/inputs_true.dat index 03e3b3ff6d..826eb5b623 100644 --- a/tests/test_mgxs_library_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_nuclides/inputs_true.dat @@ -33,7 +33,7 @@ - + diff --git a/tests/test_multipole/inputs_true.dat b/tests/test_multipole/inputs_true.dat index 4b349ecba4..0d1fe99bdc 100644 --- a/tests/test_multipole/inputs_true.dat +++ b/tests/test_multipole/inputs_true.dat @@ -25,7 +25,7 @@ - + diff --git a/tests/test_periodic/inputs_true.dat b/tests/test_periodic/inputs_true.dat index 26e700004f..61958701b2 100644 --- a/tests/test_periodic/inputs_true.dat +++ b/tests/test_periodic/inputs_true.dat @@ -16,7 +16,7 @@ - + diff --git a/tests/test_salphabeta/inputs_true.dat b/tests/test_salphabeta/inputs_true.dat index c42b90e8c1..02e6813f02 100644 --- a/tests/test_salphabeta/inputs_true.dat +++ b/tests/test_salphabeta/inputs_true.dat @@ -22,15 +22,15 @@ - + - - + + @@ -42,8 +42,8 @@ - - + + diff --git a/tests/test_tallies/inputs_true.dat b/tests/test_tallies/inputs_true.dat index 664e6e983f..a85491e943 100644 --- a/tests/test_tallies/inputs_true.dat +++ b/tests/test_tallies/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_tally_aggregation/inputs_true.dat b/tests/test_tally_aggregation/inputs_true.dat index 6ef6bdb4d6..7a8bf46133 100644 --- a/tests/test_tally_aggregation/inputs_true.dat +++ b/tests/test_tally_aggregation/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_tally_arithmetic/inputs_true.dat b/tests/test_tally_arithmetic/inputs_true.dat index e9c1562870..743ca3c582 100644 --- a/tests/test_tally_arithmetic/inputs_true.dat +++ b/tests/test_tally_arithmetic/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_tally_slice_merge/inputs_true.dat b/tests/test_tally_slice_merge/inputs_true.dat index 2c90e475a1..b1c089c965 100644 --- a/tests/test_tally_slice_merge/inputs_true.dat +++ b/tests/test_tally_slice_merge/inputs_true.dat @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -292,7 +292,7 @@ - + diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index 862c2db9aa..fdbc1cb5f1 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -403,12 +403,12 @@ - + - + @@ -420,12 +420,12 @@ - + - + diff --git a/tests/test_volume_calc/inputs_true.dat b/tests/test_volume_calc/inputs_true.dat index 35c8660289..28f1cbd9fc 100644 --- a/tests/test_volume_calc/inputs_true.dat +++ b/tests/test_volume_calc/inputs_true.dat @@ -16,7 +16,7 @@ - +