From facc1995e342fbfd8e0c13ff42550beabec5d4fe Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Wed, 5 Oct 2022 09:29:19 +0200 Subject: [PATCH 001/136] marks --- openmc/mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index a4c50a608..4059fee2d 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -165,7 +165,7 @@ class StructuredMesh(MeshBase): pass @property - def vertices(self): + def vertices(self): # TODO needs changing """Return coordinates of mesh vertices. Returns @@ -178,7 +178,7 @@ class StructuredMesh(MeshBase): return np.stack(np.meshgrid(*self._grids, indexing='ij'), axis=-1) @property - def centroids(self): + def centroids(self): # TODO needs changing """Return coordinates of mesh element centroids. Returns From 2a4c8bbb9b0253562131ddd207ebf1be523edc69 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 06:47:11 +0000 Subject: [PATCH 002/136] centre attribute to CylindricalMesh and SphericalMesh --- openmc/mesh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 4059fee2d..59d64a146 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1052,6 +1052,7 @@ class CylindricalMesh(StructuredMesh): self._r_grid = None self._phi_grid = [0.0, 2*pi] self._z_grid = None + self._centre = [0, 0, 0] @property def dimension(self): @@ -1284,6 +1285,7 @@ class SphericalMesh(StructuredMesh): self._r_grid = None self._theta_grid = [0, pi] self._phi_grid = [0, 2*pi] + self._centre = [0, 0, 0] @property def dimension(self): From c20b351a2fa26d8198f833b256d140178b4c4e9c Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 06:49:13 +0000 Subject: [PATCH 003/136] write to xml --- openmc/mesh.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 59d64a146..cc828acdc 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1161,6 +1161,9 @@ class CylindricalMesh(StructuredMesh): subelement = ET.SubElement(element, "z_grid") subelement.text = ' '.join(map(str, self.z_grid)) + subelement = ET.SubElement(element, "centre") + subelement.text = ' '.join(map(str, self.centre)) + return element @classmethod @@ -1184,6 +1187,8 @@ class CylindricalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] mesh.z_grid = [float(x) for x in get_text(elem, "z_grid").split()] + # TODO: add read centre + return mesh @property @@ -1394,6 +1399,9 @@ class SphericalMesh(StructuredMesh): subelement = ET.SubElement(element, "phi_grid") subelement.text = ' '.join(map(str, self.phi_grid)) + subelement = ET.SubElement(element, "centre") + subelement.text = ' '.join(map(str, self.centre)) + return element @classmethod @@ -1417,6 +1425,8 @@ class SphericalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.theta_grid = [float(x) for x in get_text(elem, "theta_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] + + # TODO: add read centre return mesh @property From 81ac9b0fd900df2d21cb194fbf242375844c9658 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 06:50:45 +0000 Subject: [PATCH 004/136] setters/getters --- openmc/mesh.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index cc828acdc..3efa1e114 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1064,6 +1064,10 @@ class CylindricalMesh(StructuredMesh): def n_dimension(self): return 3 + @property + def centre(self): + return self._centre + @property def r_grid(self): return self._r_grid @@ -1090,6 +1094,11 @@ class CylindricalMesh(StructuredMesh): for p in range(1, np + 1) for r in range(1, nr + 1)) + @centre.setter + def centre(self, coords): + cv.check_type('mesh r_grid', coords, Iterable, Real) + self._centre = np.asarray(coords) + @r_grid.setter def r_grid(self, grid): cv.check_type('mesh r_grid', grid, Iterable, Real) @@ -1302,6 +1311,10 @@ class SphericalMesh(StructuredMesh): def n_dimension(self): return 3 + @property + def centre(self): + return self._centre + @property def r_grid(self): return self._r_grid @@ -1328,6 +1341,11 @@ class SphericalMesh(StructuredMesh): for t in range(1, nt + 1) for r in range(1, nr + 1)) + @centre.setter + def centre(self, coords): + cv.check_type('mesh r_grid', coords, Iterable, Real) + self._centre = np.asarray(coords) + @r_grid.setter def r_grid(self, grid): cv.check_type('mesh r_grid', grid, Iterable, Real) From f0f5e34b33e79fe5818ae227bd5da192a208bf40 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 06:55:56 +0000 Subject: [PATCH 005/136] read centre from xml --- src/mesh.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mesh.cpp b/src/mesh.cpp index d9ad0ce8a..8307e5fe8 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -955,6 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "phi_grid"); grid_[2] = get_node_array(node, "z_grid"); + centre = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -983,6 +984,11 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( mapped_r[1] += 2 * M_PI; } + // TODO: pass centre as argument + mapped_r[0] += centre[0] + mapped_r[1] += centre[1] + mapped_r[2] += centre[2] + MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); idx[1] = sanitize_phi(idx[1]); @@ -1187,6 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "theta_grid"); grid_[2] = get_node_array(node, "phi_grid"); + centre = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -1216,6 +1223,11 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[2] += 2 * M_PI; } + // TODO: pass centre as argument + mapped_r[0] += centre[0] + mapped_r[1] += centre[1] + mapped_r[2] += centre[2] + MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); idx[1] = sanitize_theta(idx[1]); From 5787616ae41593bac4d100da162da5a8f98a1cea Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 07:18:00 +0000 Subject: [PATCH 006/136] added two tests to check centre was written/read to/from xml --- tests/unit_tests/test_cylindrical_mesh.py | 30 +++++++++++++++++++++++ tests/unit_tests/test_spherical_mesh.py | 30 +++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 tests/unit_tests/test_cylindrical_mesh.py create mode 100644 tests/unit_tests/test_spherical_mesh.py diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py new file mode 100644 index 000000000..89322d704 --- /dev/null +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -0,0 +1,30 @@ +import openmc +import numpy as np + +def test_centre_read_write_to_xml(): + """Tests that the centre attribute can be written and read back to XML + """ + # build + mesh = openmc.CylindricalMesh() + mesh.phi_grid = [1, 2, 3] + mesh.z_grid = [1, 2, 3] + mesh.r_grid = [1, 2, 3] + + mesh.centre = [0.1, 0.2, 0.3] + + tally = openmc.Tally() + + mesh_filter = openmc.MeshFilter(mesh) + tally.filters.append(mesh_filter) + + tally.scores.append("heating") + + tallies = openmc.Tallies([tally]) + + tallies.export_to_xml() + + # read back + new_tallies = openmc.Tallies.from_xml() + new_tally = new_tallies[0] + new_mesh = new_tally.filters[0].mesh + assert np.allclose(new_mesh.centre, mesh.centre) \ No newline at end of file diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py new file mode 100644 index 000000000..cdeb188ec --- /dev/null +++ b/tests/unit_tests/test_spherical_mesh.py @@ -0,0 +1,30 @@ +import openmc +import numpy as np + +def test_centre_read_write_to_xml(): + """Tests that the centre attribute can be written and read back to XML + """ + # build + mesh = openmc.SphericalMesh() + mesh.phi_grid = [1, 2, 3] + mesh.theta_grid = [1, 2, 3] + mesh.r_grid = [1, 2, 3] + + mesh.centre = [0.1, 0.2, 0.3] + + tally = openmc.Tally() + + mesh_filter = openmc.MeshFilter(mesh) + tally.filters.append(mesh_filter) + + tally.scores.append("heating") + + tallies = openmc.Tallies([tally]) + + tallies.export_to_xml() + + # read back + new_tallies = openmc.Tallies.from_xml() + new_tally = new_tallies[0] + new_mesh = new_tally.filters[0].mesh + assert np.allclose(new_mesh.centre, mesh.centre) \ No newline at end of file From 16add87c05a2a228daabb4f99a3c09c0defe2b46 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 07:18:52 +0000 Subject: [PATCH 007/136] now reads back from xml --- openmc/mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 3efa1e114..abc46c70b 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1196,7 +1196,7 @@ class CylindricalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] mesh.z_grid = [float(x) for x in get_text(elem, "z_grid").split()] - # TODO: add read centre + mesh.centre = [float(x) for x in get_text(elem, "centre").split()] return mesh @@ -1443,8 +1443,8 @@ class SphericalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.theta_grid = [float(x) for x in get_text(elem, "theta_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] + mesh.centre = [float(x) for x in get_text(elem, "centre").split()] - # TODO: add read centre return mesh @property From 21200d9b6eb6f07c0dbb1e2885c6c367dea54100 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 07:42:34 +0000 Subject: [PATCH 008/136] offsets the write_to_vtk coordinates --- openmc/mesh.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index abc46c70b..8f47e4e7b 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1052,7 +1052,7 @@ class CylindricalMesh(StructuredMesh): self._r_grid = None self._phi_grid = [0.0, 2*pi] self._z_grid = None - self._centre = [0, 0, 0] + self._centre = [0., 0., 0.] @property def dimension(self): @@ -1251,6 +1251,11 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 0] = r * np.cos(phi) pts_cartesian[:, 1] = r * np.sin(phi) + # offset with centre + pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.centre[0] + pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.centre[1] + pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.centre[2] + return super().write_data_to_vtk( points=pts_cartesian, filename=filename, @@ -1299,7 +1304,7 @@ class SphericalMesh(StructuredMesh): self._r_grid = None self._theta_grid = [0, pi] self._phi_grid = [0, 2*pi] - self._centre = [0, 0, 0] + self._centre = [0., 0., 0.] @property def dimension(self): @@ -1500,6 +1505,11 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) * np.sin(theta) pts_cartesian[:, 2] = r * np.cos(phi) + # offset with centre + pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.centre[0] + pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.centre[1] + pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.centre[2] + return super().write_data_to_vtk( points=pts_cartesian, filename=filename, From 896ae2792ec6e1dfdaa2f7054dda5cb890d7e43f Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 08:40:04 +0000 Subject: [PATCH 009/136] centre to centre_ --- src/mesh.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 8307e5fe8..5fa46cd85 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -955,7 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "phi_grid"); grid_[2] = get_node_array(node, "z_grid"); - centre = get_node_array(node, "centre"); + centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -985,9 +985,9 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( } // TODO: pass centre as argument - mapped_r[0] += centre[0] - mapped_r[1] += centre[1] - mapped_r[2] += centre[2] + mapped_r[0] += centre_[0] + mapped_r[1] += centre_[1] + mapped_r[2] += centre_[2] MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); @@ -1193,7 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "theta_grid"); grid_[2] = get_node_array(node, "phi_grid"); - centre = get_node_array(node, "centre"); + centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -1224,9 +1224,9 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( } // TODO: pass centre as argument - mapped_r[0] += centre[0] - mapped_r[1] += centre[1] - mapped_r[2] += centre[2] + mapped_r[0] += centre_[0] + mapped_r[1] += centre_[1] + mapped_r[2] += centre_[2] MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); From d194e000803acc3c6e35c9e95d27859ae43d6b99 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 09:00:27 +0000 Subject: [PATCH 010/136] test if grid_ is defined in this scope --- src/mesh.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesh.cpp b/src/mesh.cpp index 5fa46cd85..7a0a243f0 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1223,6 +1223,9 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[2] += 2 * M_PI; } + // test + coucou = grid_[0] + // TODO: pass centre as argument mapped_r[0] += centre_[0] mapped_r[1] += centre_[1] From a104c1f890055f5822d2b93db08bdcad255a17a0 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 09:07:51 +0000 Subject: [PATCH 011/136] [skip ci] removed test --- src/mesh.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 7a0a243f0..5fa46cd85 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1223,9 +1223,6 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[2] += 2 * M_PI; } - // test - coucou = grid_[0] - // TODO: pass centre as argument mapped_r[0] += centre_[0] mapped_r[1] += centre_[1] From bdd13ba3f4c29512f0fc24d4cf856f010a982e1c Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 09:15:27 +0000 Subject: [PATCH 012/136] attempt #2 --- src/mesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 5fa46cd85..9fde3dbe1 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -955,7 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "phi_grid"); grid_[2] = get_node_array(node, "z_grid"); - centre_ = get_node_array(node, "centre"); + double centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -1193,7 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "theta_grid"); grid_[2] = get_node_array(node, "phi_grid"); - centre_ = get_node_array(node, "centre"); + double centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); From e394637f2f873ca3cec6417a02031f340650e368 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 09:32:08 +0000 Subject: [PATCH 013/136] declare variable with auto --- src/mesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 9fde3dbe1..ad67b2ba4 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -955,7 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "phi_grid"); grid_[2] = get_node_array(node, "z_grid"); - double centre_ = get_node_array(node, "centre"); + auto centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -1193,7 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "theta_grid"); grid_[2] = get_node_array(node, "phi_grid"); - double centre_ = get_node_array(node, "centre"); + auto centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); From 61b4f30dd4f1ce0bd44e339b59a7cfe31fef057f Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 10:59:35 +0000 Subject: [PATCH 014/136] declaring centre_ in C file --- include/openmc/mesh.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index eece0f1ff..e6f5ce98b 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -359,6 +359,8 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; + array centre_; + int set_grid(); @@ -413,6 +415,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; + array centre_; int set_grid(); From fc5aa68d732fb15e99e103d1543451dbb57f99ab Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 10:59:52 +0000 Subject: [PATCH 015/136] removed auto + ; --- src/mesh.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index ad67b2ba4..c049549eb 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -955,7 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "phi_grid"); grid_[2] = get_node_array(node, "z_grid"); - auto centre_ = get_node_array(node, "centre"); + centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -985,9 +985,9 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( } // TODO: pass centre as argument - mapped_r[0] += centre_[0] - mapped_r[1] += centre_[1] - mapped_r[2] += centre_[2] + mapped_r[0] += centre_[0]; + mapped_r[1] += centre_[1]; + mapped_r[2] += centre_[2]; MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); @@ -1193,7 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "theta_grid"); grid_[2] = get_node_array(node, "phi_grid"); - auto centre_ = get_node_array(node, "centre"); + centre_ = get_node_array(node, "centre"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -1224,9 +1224,9 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( } // TODO: pass centre as argument - mapped_r[0] += centre_[0] - mapped_r[1] += centre_[1] - mapped_r[2] += centre_[2] + mapped_r[0] += centre_[0]; + mapped_r[1] += centre_[1]; + mapped_r[2] += centre_[2]; MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); From e1dbe49bbbcae3c227190f48e2d6d89945b64187 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 11:06:24 +0000 Subject: [PATCH 016/136] correct type for centre_ --- include/openmc/mesh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index e6f5ce98b..ea6b01aa6 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -359,7 +359,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - array centre_; + vector centre_; int set_grid(); @@ -415,7 +415,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - array centre_; + vector centre_; int set_grid(); From 1ed096f6608b0caad5f2f17f4cfc34c278d78b95 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 7 Oct 2022 12:53:34 +0000 Subject: [PATCH 017/136] added centre tag to standard --- tests/regression_tests/filter_mesh/inputs_true.dat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/regression_tests/filter_mesh/inputs_true.dat b/tests/regression_tests/filter_mesh/inputs_true.dat index d0c481d60..c42f3cd43 100644 --- a/tests/regression_tests/filter_mesh/inputs_true.dat +++ b/tests/regression_tests/filter_mesh/inputs_true.dat @@ -57,11 +57,13 @@ 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 -7.5 -6.5625 -5.625 -4.6875 -3.75 -2.8125 -1.875 -0.9375 0.0 0.9375 1.875 2.8125 3.75 4.6875 5.625 6.5625 7.5 + 0.0 0.0 0.0 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 0.0 0.39269908169872414 0.7853981633974483 1.1780972450961724 1.5707963267948966 1.9634954084936207 2.356194490192345 2.748893571891069 3.141592653589793 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 + 0.0 0.0 0.0 1 From 94547f7c4b4128306a21a15d9adce1ac34d01c43 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 15:24:13 +0000 Subject: [PATCH 018/136] new type for centre_ --- include/openmc/mesh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index ea6b01aa6..8fdf62ecb 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -359,7 +359,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - vector centre_; + array centre_; int set_grid(); From 15f45bcd1d7f6edf48c37213f0305803b41b584c Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 15:29:10 +0000 Subject: [PATCH 019/136] substract before mapping --- src/mesh.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index c049549eb..36e4d5049 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -976,6 +976,11 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( mapped_r[0] = std::hypot(r.x, r.y); mapped_r[2] = r[2]; + + mapped_r[0] += centre_[0]; + mapped_r[1] += centre_[1]; + mapped_r[2] += centre_[2]; + if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; } else { @@ -984,11 +989,6 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( mapped_r[1] += 2 * M_PI; } - // TODO: pass centre as argument - mapped_r[0] += centre_[0]; - mapped_r[1] += centre_[1]; - mapped_r[2] += centre_[2]; - MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); idx[1] = sanitize_phi(idx[1]); @@ -1213,6 +1213,11 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( Position mapped_r; mapped_r[0] = r.norm(); + + mapped_r[0] += centre_[0]; + mapped_r[1] += centre_[1]; + mapped_r[2] += centre_[2]; + if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; mapped_r[2] = 0.0; @@ -1223,11 +1228,6 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[2] += 2 * M_PI; } - // TODO: pass centre as argument - mapped_r[0] += centre_[0]; - mapped_r[1] += centre_[1]; - mapped_r[2] += centre_[2]; - MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); idx[1] = sanitize_theta(idx[1]); From 27e3bb427a3cf991dfa7f14680e8098835251443 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 15:36:58 +0000 Subject: [PATCH 020/136] array for origin CylindricalMesh --- include/openmc/mesh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 8fdf62ecb..e6f5ce98b 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -415,7 +415,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - vector centre_; + array centre_; int set_grid(); From 76fbdf7fbf627a177017853583c378192912d6b4 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 15:41:38 +0000 Subject: [PATCH 021/136] centre to origin --- include/openmc/mesh.h | 4 ++-- openmc/mesh.py | 52 +++++++++++++++++++++---------------------- src/mesh.cpp | 16 ++++++------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index e6f5ce98b..9a0b5d5b8 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -359,7 +359,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - array centre_; + array origin; int set_grid(); @@ -415,7 +415,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - array centre_; + array origin_; int set_grid(); diff --git a/openmc/mesh.py b/openmc/mesh.py index f381d99b0..da00750c1 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1052,7 +1052,7 @@ class CylindricalMesh(StructuredMesh): self._r_grid = None self._phi_grid = [0.0, 2*pi] self._z_grid = None - self._centre = [0., 0., 0.] + self._origin = [0., 0., 0.] @property def dimension(self): @@ -1065,8 +1065,8 @@ class CylindricalMesh(StructuredMesh): return 3 @property - def centre(self): - return self._centre + def origin(self): + return self._origin @property def r_grid(self): @@ -1094,10 +1094,10 @@ class CylindricalMesh(StructuredMesh): for p in range(1, np + 1) for r in range(1, nr + 1)) - @centre.setter - def centre(self, coords): + @origin.setter + def origin(self, coords): cv.check_type('mesh r_grid', coords, Iterable, Real) - self._centre = np.asarray(coords) + self._origin = np.asarray(coords) @r_grid.setter def r_grid(self, grid): @@ -1240,8 +1240,8 @@ class CylindricalMesh(StructuredMesh): subelement = ET.SubElement(element, "z_grid") subelement.text = ' '.join(map(str, self.z_grid)) - subelement = ET.SubElement(element, "centre") - subelement.text = ' '.join(map(str, self.centre)) + subelement = ET.SubElement(element, "origin") + subelement.text = ' '.join(map(str, self.origin)) return element @@ -1266,7 +1266,7 @@ class CylindricalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] mesh.z_grid = [float(x) for x in get_text(elem, "z_grid").split()] - mesh.centre = [float(x) for x in get_text(elem, "centre").split()] + mesh.origin = [float(x) for x in get_text(elem, "origin").split()] return mesh @@ -1321,10 +1321,10 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 0] = r * np.cos(phi) pts_cartesian[:, 1] = r * np.sin(phi) - # offset with centre - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.centre[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.centre[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.centre[2] + # offset with origin + pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] + pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] + pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] return super().write_data_to_vtk( points=pts_cartesian, @@ -1374,7 +1374,7 @@ class SphericalMesh(StructuredMesh): self._r_grid = None self._theta_grid = [0, pi] self._phi_grid = [0, 2*pi] - self._centre = [0., 0., 0.] + self._origin = [0., 0., 0.] @property def dimension(self): @@ -1387,8 +1387,8 @@ class SphericalMesh(StructuredMesh): return 3 @property - def centre(self): - return self._centre + def origin(self): + return self._origin @property def r_grid(self): @@ -1416,10 +1416,10 @@ class SphericalMesh(StructuredMesh): for t in range(1, nt + 1) for r in range(1, nr + 1)) - @centre.setter - def centre(self, coords): + @origin.setter + def origin(self, coords): cv.check_type('mesh r_grid', coords, Iterable, Real) - self._centre = np.asarray(coords) + self._origin = np.asarray(coords) @r_grid.setter def r_grid(self, grid): @@ -1492,8 +1492,8 @@ class SphericalMesh(StructuredMesh): subelement = ET.SubElement(element, "phi_grid") subelement.text = ' '.join(map(str, self.phi_grid)) - subelement = ET.SubElement(element, "centre") - subelement.text = ' '.join(map(str, self.centre)) + subelement = ET.SubElement(element, "origin") + subelement.text = ' '.join(map(str, self.origin)) return element @@ -1518,7 +1518,7 @@ class SphericalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.theta_grid = [float(x) for x in get_text(elem, "theta_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] - mesh.centre = [float(x) for x in get_text(elem, "centre").split()] + mesh.origin = [float(x) for x in get_text(elem, "origin").split()] return mesh @@ -1575,10 +1575,10 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) * np.sin(theta) pts_cartesian[:, 2] = r * np.cos(phi) - # offset with centre - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.centre[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.centre[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.centre[2] + # offset with origin + pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] + pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] + pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] return super().write_data_to_vtk( points=pts_cartesian, diff --git a/src/mesh.cpp b/src/mesh.cpp index 36e4d5049..982b2e2dc 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -955,7 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "phi_grid"); grid_[2] = get_node_array(node, "z_grid"); - centre_ = get_node_array(node, "centre"); + origin_ = get_node_array(node, "origin"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -977,9 +977,9 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( mapped_r[0] = std::hypot(r.x, r.y); mapped_r[2] = r[2]; - mapped_r[0] += centre_[0]; - mapped_r[1] += centre_[1]; - mapped_r[2] += centre_[2]; + mapped_r[0] += origin_[0]; + mapped_r[1] += origin_[1]; + mapped_r[2] += origin_[2]; if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; @@ -1193,7 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "theta_grid"); grid_[2] = get_node_array(node, "phi_grid"); - centre_ = get_node_array(node, "centre"); + origin_ = get_node_array(node, "origin"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -1214,9 +1214,9 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[0] = r.norm(); - mapped_r[0] += centre_[0]; - mapped_r[1] += centre_[1]; - mapped_r[2] += centre_[2]; + mapped_r[0] += origin_[0]; + mapped_r[1] += origin_[1]; + mapped_r[2] += origin_[2]; if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; From b2d1729287c7174503c94e2b1cb5a39c2cb5a05e Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 16:08:03 +0000 Subject: [PATCH 022/136] origin_ instead of origin --- include/openmc/mesh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 9a0b5d5b8..52f64701b 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -359,7 +359,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - array origin; + array origin_; int set_grid(); From adad6e7cd43a6d0a3e6ffd31f98bd7030158ee15 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 11 Oct 2022 11:21:31 -0500 Subject: [PATCH 023/136] Making origin type Positiong. Adding function to parse position from node. --- include/openmc/mesh.h | 5 ++--- include/openmc/xml_interface.h | 4 ++++ src/mesh.cpp | 4 ++-- src/xml_interface.cpp | 7 +++++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 9a0b5d5b8..c690dc4fe 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -359,8 +359,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - array origin; - + Position origin_; int set_grid(); @@ -415,7 +414,7 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - array origin_; + Position origin_; int set_grid(); diff --git a/include/openmc/xml_interface.h b/include/openmc/xml_interface.h index d96bb6cc2..bd6554c13 100644 --- a/include/openmc/xml_interface.h +++ b/include/openmc/xml_interface.h @@ -9,6 +9,7 @@ #include "xtensor/xadapt.hpp" #include "xtensor/xarray.hpp" +#include "openmc/position.h" #include "openmc/vector.h" namespace openmc { @@ -49,5 +50,8 @@ xt::xarray get_node_xarray( return xt::adapt(v, shape); } +Position get_node_position( + pugi::xml_node node, const char* name, bool lowercase = false); + } // namespace openmc #endif // OPENMC_XML_INTERFACE_H diff --git a/src/mesh.cpp b/src/mesh.cpp index 982b2e2dc..e9c185c8f 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -955,7 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "phi_grid"); grid_[2] = get_node_array(node, "z_grid"); - origin_ = get_node_array(node, "origin"); + origin_ = get_node_position(node, "origin"); if (int err = set_grid()) { fatal_error(openmc_err_msg); @@ -1193,7 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} grid_[0] = get_node_array(node, "r_grid"); grid_[1] = get_node_array(node, "theta_grid"); grid_[2] = get_node_array(node, "phi_grid"); - origin_ = get_node_array(node, "origin"); + origin_ = get_node_position(node, "origin"); if (int err = set_grid()) { fatal_error(openmc_err_msg); diff --git a/src/xml_interface.cpp b/src/xml_interface.cpp index cf3b981e5..6ce465baf 100644 --- a/src/xml_interface.cpp +++ b/src/xml_interface.cpp @@ -48,4 +48,11 @@ bool get_node_value_bool(pugi::xml_node node, const char* name) return false; } +Position get_node_position( + pugi::xml_node node, const char* name, bool lowercase) +{ + vector arr = get_node_array(node, name, lowercase); + return Position(arr); +} + } // namespace openmc From a97b202c2d5113795ff39ab95827fd61ecf3ba7f Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 16:41:43 +0000 Subject: [PATCH 024/136] updated to_hdf5 --- src/mesh.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesh.cpp b/src/mesh.cpp index e9c185c8f..57fe49ba6 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1178,6 +1178,7 @@ void CylindricalMesh::to_hdf5(hid_t group) const write_dataset(mesh_group, "r_grid", grid_[0]); write_dataset(mesh_group, "phi_grid", grid_[1]); write_dataset(mesh_group, "z_grid", grid_[2]); + write_dataset(mesh_group, "origin", origin_); close_group(mesh_group); } @@ -1447,6 +1448,7 @@ void SphericalMesh::to_hdf5(hid_t group) const write_dataset(mesh_group, "r_grid", grid_[0]); write_dataset(mesh_group, "theta_grid", grid_[1]); write_dataset(mesh_group, "phi_grid", grid_[2]); + write_dataset(mesh_group, "origin", origin_); close_group(mesh_group); } From 3792c6fb70786638d39c88201fc248464c0bd905 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 17:11:54 +0000 Subject: [PATCH 025/136] fixed unit test --- tests/unit_tests/test_spherical_mesh.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index cdeb188ec..4d389a6bd 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -1,8 +1,8 @@ import openmc import numpy as np -def test_centre_read_write_to_xml(): - """Tests that the centre attribute can be written and read back to XML +def test_origin_read_write_to_xml(): + """Tests that the origin attribute can be written and read back to XML """ # build mesh = openmc.SphericalMesh() @@ -10,7 +10,7 @@ def test_centre_read_write_to_xml(): mesh.theta_grid = [1, 2, 3] mesh.r_grid = [1, 2, 3] - mesh.centre = [0.1, 0.2, 0.3] + mesh.origin = [0.1, 0.2, 0.3] tally = openmc.Tally() @@ -27,4 +27,4 @@ def test_centre_read_write_to_xml(): new_tallies = openmc.Tallies.from_xml() new_tally = new_tallies[0] new_mesh = new_tally.filters[0].mesh - assert np.allclose(new_mesh.centre, mesh.centre) \ No newline at end of file + assert np.allclose(new_mesh.origin, mesh.origin) \ No newline at end of file From 48d75accdd3d8ddd80e560c56b64a49e3c7b21dd Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 17:12:55 +0000 Subject: [PATCH 026/136] fixed cylindrical mesh test --- tests/unit_tests/test_cylindrical_mesh.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index 89322d704..952e8cf5a 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -1,8 +1,8 @@ import openmc import numpy as np -def test_centre_read_write_to_xml(): - """Tests that the centre attribute can be written and read back to XML +def test_origin_read_write_to_xml(): + """Tests that the origin attribute can be written and read back to XML """ # build mesh = openmc.CylindricalMesh() @@ -10,7 +10,7 @@ def test_centre_read_write_to_xml(): mesh.z_grid = [1, 2, 3] mesh.r_grid = [1, 2, 3] - mesh.centre = [0.1, 0.2, 0.3] + mesh.origin = [0.1, 0.2, 0.3] tally = openmc.Tally() @@ -27,4 +27,4 @@ def test_centre_read_write_to_xml(): new_tallies = openmc.Tallies.from_xml() new_tally = new_tallies[0] new_mesh = new_tally.filters[0].mesh - assert np.allclose(new_mesh.centre, mesh.centre) \ No newline at end of file + assert np.allclose(new_mesh.origin, mesh.origin) \ No newline at end of file From c6b89feaef6fc8093fc012e0a4a426541c7d434d Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 11 Oct 2022 17:14:21 +0000 Subject: [PATCH 027/136] fixed gold standard --- tests/regression_tests/filter_mesh/inputs_true.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/regression_tests/filter_mesh/inputs_true.dat b/tests/regression_tests/filter_mesh/inputs_true.dat index c42f3cd43..8b08a2a3c 100644 --- a/tests/regression_tests/filter_mesh/inputs_true.dat +++ b/tests/regression_tests/filter_mesh/inputs_true.dat @@ -57,13 +57,13 @@ 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 -7.5 -6.5625 -5.625 -4.6875 -3.75 -2.8125 -1.875 -0.9375 0.0 0.9375 1.875 2.8125 3.75 4.6875 5.625 6.5625 7.5 - 0.0 0.0 0.0 + 0.0 0.0 0.0 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 0.0 0.39269908169872414 0.7853981633974483 1.1780972450961724 1.5707963267948966 1.9634954084936207 2.356194490192345 2.748893571891069 3.141592653589793 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 - 0.0 0.0 0.0 + 0.0 0.0 0.0 1 From 444a80012bf6d246842f133a89943ccf1004fd87 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 11 Oct 2022 23:38:13 -0500 Subject: [PATCH 028/136] Naming tally in activation unit test --- tests/unit_tests/test_deplete_activation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_deplete_activation.py b/tests/unit_tests/test_deplete_activation.py index 1842ad8ac..2dc911c86 100644 --- a/tests/unit_tests/test_deplete_activation.py +++ b/tests/unit_tests/test_deplete_activation.py @@ -33,7 +33,7 @@ def model(): ) model.settings.run_mode = 'fixed source' - rx_tally = openmc.Tally() + rx_tally = openmc.Tally(name='activation tally') rx_tally.scores = ['(n,gamma)'] model.tallies.append(rx_tally) @@ -53,7 +53,8 @@ def test_activation(run_in_tmpdir, model, reaction_rate_mode, reaction_rate_opts # Determine (n.gamma) reaction rate using initial run sp = model.run() with openmc.StatePoint(sp) as sp: - tally = sp.tallies[1] + print(sp.tallies) + tally = sp.get_tally(name='activation tally') capture_rate = tally.mean.flat[0] # Create one-nuclide depletion chain From b0743dfdea203372844e3d4901d8d0f8b2150b0c Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 21 Oct 2022 11:56:21 +0200 Subject: [PATCH 029/136] fixed cv.check_type origin --- openmc/mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index da00750c1..807886988 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1096,7 +1096,7 @@ class CylindricalMesh(StructuredMesh): @origin.setter def origin(self, coords): - cv.check_type('mesh r_grid', coords, Iterable, Real) + cv.check_type('mesh origin', coords, Iterable, Real) self._origin = np.asarray(coords) @r_grid.setter @@ -1418,7 +1418,7 @@ class SphericalMesh(StructuredMesh): @origin.setter def origin(self, coords): - cv.check_type('mesh r_grid', coords, Iterable, Real) + cv.check_type('mesh origin', coords, Iterable, Real) self._origin = np.asarray(coords) @r_grid.setter From b874d83634962c9e1fcae2d0ffc360437e11abf5 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 21 Oct 2022 15:55:08 +0200 Subject: [PATCH 030/136] only translate when origin is not 0, 0, 0 --- openmc/mesh.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 807886988..b4cd04d51 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1322,9 +1322,10 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) # offset with origin - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] + if self.origin != [0.0, 0.0, 0.0]: + pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] + pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] + pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] return super().write_data_to_vtk( points=pts_cartesian, @@ -1576,9 +1577,10 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 2] = r * np.cos(phi) # offset with origin - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] + if self.origin != [0.0, 0.0, 0.0]: + pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] + pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] + pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] return super().write_data_to_vtk( points=pts_cartesian, From f60f95feb4e49d4b46c6aa5ec63b7ed4ddeeec87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:03:35 -0500 Subject: [PATCH 031/136] [skip ci] removed # TODOs --- openmc/mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index b4cd04d51..79ab7fd5a 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -165,7 +165,7 @@ class StructuredMesh(MeshBase): pass @property - def vertices(self): # TODO needs changing + def vertices(self): """Return coordinates of mesh vertices. Returns @@ -178,7 +178,7 @@ class StructuredMesh(MeshBase): return np.stack(np.meshgrid(*self._grids, indexing='ij'), axis=-1) @property - def centroids(self): # TODO needs changing + def centroids(self): """Return coordinates of mesh element centroids. Returns From c5affa805e06ce46276dc1c148888b3540b1e29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Mon, 21 Nov 2022 09:37:57 -0500 Subject: [PATCH 032/136] Review suggestions Co-authored-by: Patrick Shriwise --- src/mesh.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 57fe49ba6..3849f4d03 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -977,9 +977,7 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( mapped_r[0] = std::hypot(r.x, r.y); mapped_r[2] = r[2]; - mapped_r[0] += origin_[0]; - mapped_r[1] += origin_[1]; - mapped_r[2] += origin_[2]; + mapped_r -= origin_; if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; From 6d787d5fb0e2ed7790e83f2ea8d00560f60c292e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Mon, 21 Nov 2022 09:39:01 -0500 Subject: [PATCH 033/136] Apply suggestions from code review Co-authored-by: Patrick Shriwise --- openmc/mesh.py | 6 +++--- src/mesh.cpp | 4 +--- tests/unit_tests/test_deplete_activation.py | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 79ab7fd5a..3936572f9 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1322,7 +1322,7 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) # offset with origin - if self.origin != [0.0, 0.0, 0.0]: + if any(self.origin != (0.0, 0.0, 0.0)): pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] @@ -1375,7 +1375,7 @@ class SphericalMesh(StructuredMesh): self._r_grid = None self._theta_grid = [0, pi] self._phi_grid = [0, 2*pi] - self._origin = [0., 0., 0.] + self._origin = (0., 0., 0.) @property def dimension(self): @@ -1577,7 +1577,7 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 2] = r * np.cos(phi) # offset with origin - if self.origin != [0.0, 0.0, 0.0]: + if any(self.origin != (0.0, 0.0, 0.0)): pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] diff --git a/src/mesh.cpp b/src/mesh.cpp index 3849f4d03..82644db08 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1213,9 +1213,7 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[0] = r.norm(); - mapped_r[0] += origin_[0]; - mapped_r[1] += origin_[1]; - mapped_r[2] += origin_[2]; + mapped_r -= origin_; if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; diff --git a/tests/unit_tests/test_deplete_activation.py b/tests/unit_tests/test_deplete_activation.py index 2dc911c86..64167c8af 100644 --- a/tests/unit_tests/test_deplete_activation.py +++ b/tests/unit_tests/test_deplete_activation.py @@ -53,7 +53,6 @@ def test_activation(run_in_tmpdir, model, reaction_rate_mode, reaction_rate_opts # Determine (n.gamma) reaction rate using initial run sp = model.run() with openmc.StatePoint(sp) as sp: - print(sp.tallies) tally = sp.get_tally(name='activation tally') capture_rate = tally.mean.flat[0] From 8681751238a27d4b94a75c446903c035de6f72dd Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 21 Nov 2022 09:45:11 -0500 Subject: [PATCH 034/136] check length origin --- openmc/mesh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 3936572f9..0eba6871b 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1097,6 +1097,7 @@ class CylindricalMesh(StructuredMesh): @origin.setter def origin(self, coords): cv.check_type('mesh origin', coords, Iterable, Real) + cv.check_length("mesh origin", coords, 3) self._origin = np.asarray(coords) @r_grid.setter @@ -1420,6 +1421,7 @@ class SphericalMesh(StructuredMesh): @origin.setter def origin(self, coords): cv.check_type('mesh origin', coords, Iterable, Real) + cv.check_length("mesh origin", coords, 3) self._origin = np.asarray(coords) @r_grid.setter From df1a45b65407f0dc67e286600aac58d1b8744682 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 21 Nov 2022 09:46:13 -0500 Subject: [PATCH 035/136] origin from_hdf5 --- openmc/mesh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 0eba6871b..64217fa77 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1145,6 +1145,7 @@ class CylindricalMesh(StructuredMesh): mesh.r_grid = group['r_grid'][()] mesh.phi_grid = group['phi_grid'][()] mesh.z_grid = group['z_grid'][()] + mesh.origin = group['origin'][()] return mesh @@ -1469,6 +1470,7 @@ class SphericalMesh(StructuredMesh): mesh.r_grid = group['r_grid'][()] mesh.theta_grid = group['theta_grid'][()] mesh.phi_grid = group['phi_grid'][()] + mesh.origin = group['origin'][()] return mesh From b63ec9cdc3ee988afe1051126cdba2b7d83ff629 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 21 Nov 2022 09:48:42 -0500 Subject: [PATCH 036/136] read mesh optional --- openmc/mesh.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 64217fa77..0d92208aa 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1145,7 +1145,8 @@ class CylindricalMesh(StructuredMesh): mesh.r_grid = group['r_grid'][()] mesh.phi_grid = group['phi_grid'][()] mesh.z_grid = group['z_grid'][()] - mesh.origin = group['origin'][()] + if 'origin' in group: + mesh.origin = group['origin'][()] return mesh @@ -1268,7 +1269,8 @@ class CylindricalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] mesh.z_grid = [float(x) for x in get_text(elem, "z_grid").split()] - mesh.origin = [float(x) for x in get_text(elem, "origin").split()] + if "origin" in elem.attrib: + mesh.origin = [float(x) for x in get_text(elem, "origin").split()] return mesh @@ -1470,7 +1472,8 @@ class SphericalMesh(StructuredMesh): mesh.r_grid = group['r_grid'][()] mesh.theta_grid = group['theta_grid'][()] mesh.phi_grid = group['phi_grid'][()] - mesh.origin = group['origin'][()] + if 'origin' in group: + mesh.origin = group['origin'][()] return mesh @@ -1523,7 +1526,8 @@ class SphericalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.theta_grid = [float(x) for x in get_text(elem, "theta_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] - mesh.origin = [float(x) for x in get_text(elem, "origin").split()] + if "origin" in elem.attrib: + mesh.origin = [float(x) for x in get_text(elem, "origin").split()] return mesh From f51f18176135926ea1c4be5f2287c95a8741c8fd Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 21 Nov 2022 11:53:49 -0500 Subject: [PATCH 037/136] fixed optional xml reading --- openmc/mesh.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 0d92208aa..31b7789ee 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1269,8 +1269,7 @@ class CylindricalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] mesh.z_grid = [float(x) for x in get_text(elem, "z_grid").split()] - if "origin" in elem.attrib: - mesh.origin = [float(x) for x in get_text(elem, "origin").split()] + mesh.origin = [float(x) for x in get_text(elem, "origin", default=[0., 0., 0.]).split()] return mesh @@ -1526,8 +1525,7 @@ class SphericalMesh(StructuredMesh): mesh.r_grid = [float(x) for x in get_text(elem, "r_grid").split()] mesh.theta_grid = [float(x) for x in get_text(elem, "theta_grid").split()] mesh.phi_grid = [float(x) for x in get_text(elem, "phi_grid").split()] - if "origin" in elem.attrib: - mesh.origin = [float(x) for x in get_text(elem, "origin").split()] + mesh.origin = [float(x) for x in get_text(elem, "origin", default=[0., 0., 0.]).split()] return mesh From 3325667c51538748e2078261fb9457c769b11e3e Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 21 Nov 2022 12:22:39 -0500 Subject: [PATCH 038/136] minor version bump for statepoint files --- include/openmc/constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index fa2251b84..a97180faf 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -24,7 +24,7 @@ using double_4dvec = vector>>>; constexpr int HDF5_VERSION[] {3, 0}; // Version numbers for binary files -constexpr array VERSION_STATEPOINT {18, 0}; +constexpr array VERSION_STATEPOINT {18, 1}; constexpr array VERSION_PARTICLE_RESTART {2, 0}; constexpr array VERSION_TRACK {3, 0}; constexpr array VERSION_SUMMARY {6, 0}; From 10a95186e391517ff0f5d1f7487d6aa4c4cd8d93 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 21 Nov 2022 14:07:45 -0500 Subject: [PATCH 039/136] origin is tuple + fixed any --- openmc/mesh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 31b7789ee..615514c68 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1052,7 +1052,7 @@ class CylindricalMesh(StructuredMesh): self._r_grid = None self._phi_grid = [0.0, 2*pi] self._z_grid = None - self._origin = [0., 0., 0.] + self._origin = (0., 0., 0.) @property def dimension(self): @@ -1325,7 +1325,7 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) # offset with origin - if any(self.origin != (0.0, 0.0, 0.0)): + if any([coord != 0 for coord in self.origin]): pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] @@ -1583,7 +1583,7 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 2] = r * np.cos(phi) # offset with origin - if any(self.origin != (0.0, 0.0, 0.0)): + if any([coord != 0 for coord in self.origin]): pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] From f0721ac5351eec9425ecf4e33a90b5ac13eba1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Mon, 21 Nov 2022 14:30:36 -0500 Subject: [PATCH 040/136] Apply suggestions from code review Co-authored-by: Patrick Shriwise --- openmc/mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 615514c68..307d9d952 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1052,7 +1052,7 @@ class CylindricalMesh(StructuredMesh): self._r_grid = None self._phi_grid = [0.0, 2*pi] self._z_grid = None - self._origin = (0., 0., 0.) + self.origin = (0., 0., 0.) @property def dimension(self): @@ -1378,7 +1378,7 @@ class SphericalMesh(StructuredMesh): self._r_grid = None self._theta_grid = [0, pi] self._phi_grid = [0, 2*pi] - self._origin = (0., 0., 0.) + self.origin = (0., 0., 0.) @property def dimension(self): From afbbc3d8457854114fb75d73e884251c8522e410 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Tue, 24 Jan 2023 23:00:27 -0500 Subject: [PATCH 041/136] try to constrain triangulation --- openmc/model/surface_composite.py | 54 +++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 002fad9d9..e44b81ac4 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -670,10 +670,11 @@ class Polygon(CompositeSurface): check_length('points', points, 3) # Order the points counter-clockwise (necessary for offset method) - self._points = self._make_ccw(points) + points = self._make_ccw(points) - # Create a triangulation of the points. - self._tri = Delaunay(self._points, qhull_options='QJ') + # Create a constrained triangulation of the points. + # The constrained triangulation is set to _tri attribute + self._constrain_triangulation(points) # Decompose the polygon into groups of simplices forming convex subsets # and get the sets of (surface, operator) pairs defining the polygon @@ -723,7 +724,7 @@ class Polygon(CompositeSurface): @property def points(self): - return self._points + return self._tri.points @property def basis(self): @@ -738,7 +739,7 @@ class Polygon(CompositeSurface): # Get the unit vectors that point from one point in the polygon to the # next given that they are ordered counterclockwise and that the final # point is connected to the first point - tangents = np.diff(self._points, axis=0, append=[self._points[0, :]]) + tangents = np.diff(self.points, axis=0, append=[self.points[0, :]]) tangents /= np.linalg.norm(tangents, axis=-1, keepdims=True) # Rotate the tangent vectors clockwise by 90 degrees, which for a # counter-clockwise ordered polygon will produce the outward normal @@ -783,6 +784,41 @@ class Polygon(CompositeSurface): return points[::-1, :] + def _constrain_triangulation(self, points): + """Generate a constrained triangulation. + + Parameters + ---------- + points : np.ndarray (Nx2) + An Nx2 array of coordinate pairs describing the vertices. These + points represent a planar straight line graph. + + Returns + ------- + None + """ + + tri = Delaunay(points, qhull_options='QJ') + # Loop through the boundary edges of the polygon. If an edge is not + # included in the triangulation, break it into two line segments. + n = len(points) + new_pts = [] + for i, j in zip(range(n), range(1, n +1)): + # If both vertices of any edge are not found in any simplex, insert + # a new point between them + if not any([i in s and j % n in s for s in tri.simplices]): + newpt = (points[i, :] + points[j % n, :]) / 2 + new_pts.append((j, newpt)) + + # If all the edges are included in the triangulation set it, otherwise + # try again with additional points inserted on offending edges + if not new_pts: + self._tri = tri + else: + for i, pt in new_pts[::-1]: + points = np.insert(points, i, pt, axis=0) + self._constrain_triangulation(points) + def _group_simplices(self, neighbor_map, group=None): """Generate a convex grouping of simplices. @@ -819,7 +855,7 @@ class Polygon(CompositeSurface): continue test_group = group + [n] test_point_idx = np.unique(self._tri.simplices[test_group, :]) - test_points = self._tri.points[test_point_idx] + test_points = self.points[test_point_idx] # If test_points are convex keep adding to this group if len(test_points) == len(ConvexHull(test_points).vertices): group = self._group_simplices(neighbor_map, group=test_group) @@ -902,8 +938,8 @@ class Polygon(CompositeSurface): # Get centroids of all the simplices and determine if they are inside # the polygon defined by input vertices or not. - centroids = np.mean(self._points[self._tri.simplices], axis=1) - in_polygon = Path(self._points).contains_points(centroids) + centroids = np.mean(self.points[self._tri.simplices], axis=1) + in_polygon = Path(self.points).contains_points(centroids) self._in_polygon = in_polygon # Build a map with keys of simplex indices inside the polygon whose @@ -931,7 +967,7 @@ class Polygon(CompositeSurface): # generate the convex hull and find the resulting surfaces and # unary operators that represent this convex subset of the polygon. idx = np.unique(self._tri.simplices[group, :]) - qhull = ConvexHull(self._tri.points[idx, :]) + qhull = ConvexHull(self.points[idx, :]) surf_ops = self._get_convex_hull_surfs(qhull) surfsets.append(surf_ops) return surfsets From 4fade673a74681e51e0ed198ac0f4f7bcd24fc26 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Wed, 25 Jan 2023 16:27:12 -0500 Subject: [PATCH 042/136] refactor to single validate_points method --- openmc/model/surface_composite.py | 63 +++++++++++++++++++------------ 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index e44b81ac4..04e0c4d80 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -659,22 +659,10 @@ class Polygon(CompositeSurface): def __init__(self, points, basis='rz'): check_value('basis', basis, ('xy', 'yz', 'xz', 'rz')) self._basis = basis - points = np.asarray(points, dtype=float) - check_iterable_type('points', points, float, min_depth=2, max_depth=2) - check_length('points', points[0, :], 2, 2) - # If the last point is the same as the first, remove it and make sure - # there are still at least 3 points for a valid polygon. - if np.allclose(points[0, :], points[-1, :]): - points = points[:-1, :] - check_length('points', points, 3) - - # Order the points counter-clockwise (necessary for offset method) - points = self._make_ccw(points) - - # Create a constrained triangulation of the points. - # The constrained triangulation is set to _tri attribute - self._constrain_triangulation(points) + # Create a constrained triangulation of the validated points. + # The constrained triangulation is set to the _tri attribute + self._constrain_triangulation(self._validate_points(points)) # Decompose the polygon into groups of simplices forming convex subsets # and get the sets of (surface, operator) pairs defining the polygon @@ -762,8 +750,9 @@ class Polygon(CompositeSurface): def region(self): return self._region - def _make_ccw(self, points): - """Order a set of points counter-clockwise. + def _validate_points(self, points): + """Ensure the closed path defined by points does not intersect and is + oriented counter-clockwise. Parameters ---------- @@ -774,18 +763,40 @@ class Polygon(CompositeSurface): ------- ordered_points : the input points ordered counter-clockwise """ + points = np.asarray(points, dtype=float) + check_iterable_type('points', points, float, min_depth=2, max_depth=2) + check_length('points', points[0, :], 2, 2) + + # If the last point is the same as the first, remove it and make sure + # there are still at least 3 points for a valid polygon. + if np.allclose(points[0, :], points[-1, :]): + points = points[:-1, :] + check_length('points', points, 3) + + # Check if polygon is self-intersecting by comparing edges pairwise + n = len(points) + is_self_intersecting = False + for i in range(n): + p1x, p1y = points[i, :] + p2x, p2y = points[(i + 1) % n, :] + for j in range(i, n): + p3x, p3y = points[j, :] + p4x, p4y = points[(j + 1) % n, :] + + + # Order the points counter-clockwise (necessary for offset method) # Calculates twice the signed area of the polygon using the "Shoelace # Formula" https://en.wikipedia.org/wiki/Shoelace_formula - xpts, ypts = points.T - # If signed area is positive the curve is oriented counter-clockwise + xpts, ypts = points.T if np.sum(ypts*(np.roll(xpts, 1) - np.roll(xpts, -1))) > 0: return points return points[::-1, :] - def _constrain_triangulation(self, points): - """Generate a constrained triangulation. + def _constrain_triangulation(self, points, depth=0): + """Generate a constrained triangulation by ensuring all edges of the + Polygon are contained within the simplices. Parameters ---------- @@ -797,6 +808,10 @@ class Polygon(CompositeSurface): ------- None """ + # Only attempt the triangulation up to 3 times. + if depth > 2: + raise RuntimeError('Could not create a valid triangulation after 3' + ' attempts') tri = Delaunay(points, qhull_options='QJ') # Loop through the boundary edges of the polygon. If an edge is not @@ -805,19 +820,19 @@ class Polygon(CompositeSurface): new_pts = [] for i, j in zip(range(n), range(1, n +1)): # If both vertices of any edge are not found in any simplex, insert - # a new point between them + # a new point between them. if not any([i in s and j % n in s for s in tri.simplices]): newpt = (points[i, :] + points[j % n, :]) / 2 new_pts.append((j, newpt)) # If all the edges are included in the triangulation set it, otherwise - # try again with additional points inserted on offending edges + # try again with additional points inserted on offending edges. if not new_pts: self._tri = tri else: for i, pt in new_pts[::-1]: points = np.insert(points, i, pt, axis=0) - self._constrain_triangulation(points) + self._constrain_triangulation(points, depth=depth + 1) def _group_simplices(self, neighbor_map, group=None): """Generate a convex grouping of simplices. From 11eee756dd953d2490fa8b2975341e7f64328f79 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 26 Jan 2023 14:13:39 -0600 Subject: [PATCH 043/136] Corrections to application of origin for sphere and cyl mesh --- include/openmc/mesh.h | 3 +-- src/mesh.cpp | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index c690dc4fe..9554a5143 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -241,6 +241,7 @@ public: xt::xtensor lower_left_; //!< Lower-left coordinates of mesh xt::xtensor upper_right_; //!< Upper-right coordinates of mesh std::array shape_; //!< Number of mesh elements in each dimension + Position origin_ {0.0, 0.0, 0.0}; protected: }; @@ -359,7 +360,6 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - Position origin_; int set_grid(); @@ -414,7 +414,6 @@ public: void to_hdf5(hid_t group) const override; array, 3> grid_; - Position origin_; int set_grid(); diff --git a/src/mesh.cpp b/src/mesh.cpp index 82644db08..e0fa305ed 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -412,7 +412,6 @@ template void StructuredMesh::raytrace_mesh( Position r0, Position r1, const Direction& u, T tally) const { - // TODO: when c++-17 is available, use "if constexpr ()" to compile-time // enable/disable tally calls for now, T template type needs to provide both // surface and track methods, which might be empty. modern optimizing @@ -445,6 +444,11 @@ void StructuredMesh::raytrace_mesh( return; } + // translate start and end positions, + // this needs to come after the get_indices call because it does its own translation + r0 -= origin_; + r1 -= origin_; + // Calculate initial distances to next surfaces in all three dimensions std::array distances; for (int k = 0; k < n; ++k) { @@ -972,13 +976,12 @@ std::string CylindricalMesh::get_mesh_type() const StructuredMesh::MeshIndex CylindricalMesh::get_indices( Position r, bool& in_mesh) const { - Position mapped_r; + r -= origin_; + Position mapped_r; mapped_r[0] = std::hypot(r.x, r.y); mapped_r[2] = r[2]; - mapped_r -= origin_; - if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; } else { @@ -1090,22 +1093,23 @@ StructuredMesh::MeshDistance CylindricalMesh::distance_to_grid_boundary( const MeshIndex& ijk, int i, const Position& r0, const Direction& u, double l) const { + Position r = r0 - origin_; if (i == 0) { return std::min( - MeshDistance(ijk[i] + 1, true, find_r_crossing(r0, u, l, ijk[i])), - MeshDistance(ijk[i] - 1, false, find_r_crossing(r0, u, l, ijk[i] - 1))); + MeshDistance(ijk[i] + 1, true, find_r_crossing(r, u, l, ijk[i])), + MeshDistance(ijk[i] - 1, false, find_r_crossing(r, u, l, ijk[i] - 1))); } else if (i == 1) { return std::min(MeshDistance(sanitize_phi(ijk[i] + 1), true, - find_phi_crossing(r0, u, l, ijk[i])), + find_phi_crossing(r, u, l, ijk[i])), MeshDistance(sanitize_phi(ijk[i] - 1), false, - find_phi_crossing(r0, u, l, ijk[i] - 1))); + find_phi_crossing(r, u, l, ijk[i] - 1))); } else { - return find_z_crossing(r0, u, l, ijk[i]); + return find_z_crossing(r, u, l, ijk[i]); } } @@ -1209,12 +1213,11 @@ std::string SphericalMesh::get_mesh_type() const StructuredMesh::MeshIndex SphericalMesh::get_indices( Position r, bool& in_mesh) const { + r -= origin_; + Position mapped_r; - mapped_r[0] = r.norm(); - mapped_r -= origin_; - if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; mapped_r[2] = 0.0; From b22c7e8353781552d1cedddd05b83ad2543c5714 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 26 Jan 2023 14:14:06 -0600 Subject: [PATCH 044/136] Adding test cases for cylindrical mesh --- tests/unit_tests/test_cylindrical_mesh.py | 88 ++++++++++++++++++++--- 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index 952e8cf5a..e67f21b15 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -1,16 +1,42 @@ +from itertools import product, permutations + import openmc import numpy as np -def test_origin_read_write_to_xml(): - """Tests that the origin attribute can be written and read back to XML - """ +import pytest + +geom_size = 5 + +@pytest.fixture() +def model(): + openmc.reset_auto_ids() + + water = openmc.Material(name='water') + water.add_element('H', 2.0) + water.add_element('O', 1.0) + water.set_density('g/cc', 1.0) + + rpp = openmc.model.RectangularParallelepiped(*([-geom_size, geom_size] * 3), + boundary_type='vacuum') + + cell = openmc.Cell(region=-rpp, fill=water) + + geom = openmc.Geometry([cell]) + + source = openmc.Source() + source.space = openmc.stats.Point() + source.energy = openmc.stats.Discrete([10000], [1.0]) + + settings = openmc.Settings() + settings.particles = 1000 + settings.batches = 10 + settings.run_mode = 'fixed source' + # build mesh = openmc.CylindricalMesh() - mesh.phi_grid = [1, 2, 3] - mesh.z_grid = [1, 2, 3] - mesh.r_grid = [1, 2, 3] - - mesh.origin = [0.1, 0.2, 0.3] + mesh.phi_grid = np.linspace(0, 2*np.pi, 21) + mesh.z_grid = np.linspace(-geom_size, geom_size, 11) + mesh.r_grid = np.linspace(0, geom_size, geom_size) tally = openmc.Tally() @@ -21,10 +47,52 @@ def test_origin_read_write_to_xml(): tallies = openmc.Tallies([tally]) - tallies.export_to_xml() + return openmc.Model(geometry=geom, settings=settings, tallies=tallies) + +def test_origin_read_write_to_xml(run_in_tmpdir, model): + """Tests that the origin attribute can be written and read back to XML + """ + mesh = model.tallies[0].filters[0].mesh + mesh.origin = [0.1, 0.2, 0.3] + model.tallies.export_to_xml() # read back new_tallies = openmc.Tallies.from_xml() new_tally = new_tallies[0] new_mesh = new_tally.filters[0].mesh - assert np.allclose(new_mesh.origin, mesh.origin) \ No newline at end of file + np.testing.assert_equal(new_mesh.origin, mesh.origin) + +estimators = ('tracklength', 'collision') +origins = permutations([-geom_size, 0, 0]) + +test_cases = product(estimators, origins) + +def label(p): + if isinstance(p, tuple): + return f'origin:{p}' + if isinstance(p, str): + return f'estimator:{p}' + +@pytest.mark.parametrize('estimator,origin', test_cases, ids=label) +def test_offset_mesh(model, estimator, origin): + """Tests that the mesh has been moved based on tally results + """ + mesh = model.tallies[0].filters[0].mesh + model.tallies[0].estimator = estimator + # move the center of the cylinder mesh upwards + mesh.origin = origin + + sp_filename = model.run() + + with openmc.StatePoint(sp_filename) as sp: + tally = sp.tallies[1] + + # we've translated half of the cylinder mesh above the model, + # so ensure that half of the bins are populated + assert np.count_nonzero(tally.mean) == tally.mean.size / 2 + + # check that the lower half of the mesh contains a tally result + # and that the upper half is zero + mean = tally.mean.reshape(mesh.dimension[::-1]).T + # assert np.count_nonzero(mean[:, :, :5]) == mean.size / 2 + # assert np.count_nonzero(mean[:, :, 5:]) == 0 From 3703fdbdd746675203e1c5477a29b521cdb9a827 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 26 Jan 2023 14:15:08 -0600 Subject: [PATCH 045/136] Adding origin to sphere and cyl mesh str --- openmc/mesh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 307d9d952..47d34ebe2 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1119,6 +1119,7 @@ class CylindricalMesh(StructuredMesh): fmt = '{0: <16}{1}{2}\n' string = super().__repr__() string += fmt.format('\tDimensions', '=\t', self.n_dimension) + string += fmt.format('\tOrigin', '=\t', self.origin) r_grid_str = str(self._r_grid) if self._r_grid is None else len(self._r_grid) string += fmt.format('\tN R pnts:', '=\t', r_grid_str) if self._r_grid is not None: @@ -1445,6 +1446,7 @@ class SphericalMesh(StructuredMesh): fmt = '{0: <16}{1}{2}\n' string = super().__repr__() string += fmt.format('\tDimensions', '=\t', self.n_dimension) + string += fmt.format('\tOrigin', '=\t', self.origin) r_grid_str = str(self._r_grid) if self._r_grid is None else len(self._r_grid) string += fmt.format('\tN R pnts:', '=\t', r_grid_str) if self._r_grid is not None: From 17d88d8c845bb84cfbda4f674ea0919d64b79154 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 30 Jan 2023 13:57:44 -0500 Subject: [PATCH 046/136] added tests for spherical mesh --- tests/unit_tests/test_spherical_mesh.py | 88 ++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index 4d389a6bd..711570fb3 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -1,16 +1,42 @@ +from itertools import product, permutations + import openmc import numpy as np -def test_origin_read_write_to_xml(): - """Tests that the origin attribute can be written and read back to XML - """ +import pytest + +geom_size = 5 + +@pytest.fixture() +def model(): + openmc.reset_auto_ids() + + water = openmc.Material(name='water') + water.add_element('H', 2.0) + water.add_element('O', 1.0) + water.set_density('g/cc', 1.0) + + rpp = openmc.model.RectangularParallelepiped(*([-geom_size, geom_size] * 3), + boundary_type='vacuum') + + cell = openmc.Cell(region=-rpp, fill=water) + + geom = openmc.Geometry([cell]) + + source = openmc.Source() + source.space = openmc.stats.Point() + source.energy = openmc.stats.Discrete([10000], [1.0]) + + settings = openmc.Settings() + settings.particles = 1000 + settings.batches = 10 + settings.run_mode = 'fixed source' + # build mesh = openmc.SphericalMesh() - mesh.phi_grid = [1, 2, 3] - mesh.theta_grid = [1, 2, 3] - mesh.r_grid = [1, 2, 3] - - mesh.origin = [0.1, 0.2, 0.3] + mesh.phi_grid = np.linspace(0, 2*np.pi, 21) + mesh.theta_grid = np.linspace(0, 2*np.pi, 11) + mesh.r_grid = np.linspace(0, geom_size, geom_size) tally = openmc.Tally() @@ -21,10 +47,52 @@ def test_origin_read_write_to_xml(): tallies = openmc.Tallies([tally]) - tallies.export_to_xml() + return openmc.Model(geometry=geom, settings=settings, tallies=tallies) + +def test_origin_read_write_to_xml(run_in_tmpdir, model): + """Tests that the origin attribute can be written and read back to XML + """ + mesh = model.tallies[0].filters[0].mesh + mesh.origin = [0.1, 0.2, 0.3] + model.tallies.export_to_xml() # read back new_tallies = openmc.Tallies.from_xml() new_tally = new_tallies[0] new_mesh = new_tally.filters[0].mesh - assert np.allclose(new_mesh.origin, mesh.origin) \ No newline at end of file + np.testing.assert_equal(new_mesh.origin, mesh.origin) + +estimators = ('tracklength', 'collision') +origins = permutations([-geom_size, 0, 0]) + +test_cases = product(estimators, origins) + +def label(p): + if isinstance(p, tuple): + return f'origin:{p}' + if isinstance(p, str): + return f'estimator:{p}' + +@pytest.mark.parametrize('estimator,origin', test_cases, ids=label) +def test_offset_mesh(model, estimator, origin): + """Tests that the mesh has been moved based on tally results + """ + mesh = model.tallies[0].filters[0].mesh + model.tallies[0].estimator = estimator + # move the center of the spherical mesh upwards + mesh.origin = origin + + sp_filename = model.run() + + with openmc.StatePoint(sp_filename) as sp: + tally = sp.tallies[1] + + # we've translated half of the spherical mesh above the model, + # so ensure that half of the bins are populated + assert np.count_nonzero(tally.mean) == tally.mean.size / 2 + + # check that the lower half of the mesh contains a tally result + # and that the upper half is zero + mean = tally.mean.reshape(mesh.dimension[::-1]).T + # assert np.count_nonzero(mean[:, :, :5]) == mean.size / 2 + # assert np.count_nonzero(mean[:, :, 5:]) == 0 From e20e648690b33923e280476f97efd041f63e1435 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Mon, 30 Jan 2023 19:40:00 -0500 Subject: [PATCH 047/136] check for duplicate points --- openmc/model/surface_composite.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 04e0c4d80..a570ec15d 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -773,13 +773,16 @@ class Polygon(CompositeSurface): points = points[:-1, :] check_length('points', points, 3) + if len(points) != len(np.unique(points, axis=0)): + raise ValueError('Duplicate points were detected in the Polygon input') + # Check if polygon is self-intersecting by comparing edges pairwise n = len(points) is_self_intersecting = False for i in range(n): p1x, p1y = points[i, :] p2x, p2y = points[(i + 1) % n, :] - for j in range(i, n): + for j in range(i + 1, n): p3x, p3y = points[j, :] p4x, p4y = points[(j + 1) % n, :] From 1e94a0c7d7126dc68e0dfdda933a9142e8cd1f42 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Thu, 2 Feb 2023 09:39:23 -0500 Subject: [PATCH 048/136] fixed theta_grid spherical mesh --- tests/unit_tests/test_spherical_mesh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index 711570fb3..d6ac435c2 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -35,7 +35,7 @@ def model(): # build mesh = openmc.SphericalMesh() mesh.phi_grid = np.linspace(0, 2*np.pi, 21) - mesh.theta_grid = np.linspace(0, 2*np.pi, 11) + mesh.theta_grid = np.linspace(0, np.pi, 11) mesh.r_grid = np.linspace(0, geom_size, geom_size) tally = openmc.Tally() From 78b0fbaa27b98410ecd0a5103a6aa27fdf1705e4 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Sun, 5 Feb 2023 22:02:14 -0500 Subject: [PATCH 049/136] finished polygon self-intersection check --- openmc/model/surface_composite.py | 91 ++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 15 deletions(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index a570ec15d..047cfe7fc 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -776,26 +776,87 @@ class Polygon(CompositeSurface): if len(points) != len(np.unique(points, axis=0)): raise ValueError('Duplicate points were detected in the Polygon input') - # Check if polygon is self-intersecting by comparing edges pairwise - n = len(points) - is_self_intersecting = False - for i in range(n): - p1x, p1y = points[i, :] - p2x, p2y = points[(i + 1) % n, :] - for j in range(i + 1, n): - p3x, p3y = points[j, :] - p4x, p4y = points[(j + 1) % n, :] - - # Order the points counter-clockwise (necessary for offset method) # Calculates twice the signed area of the polygon using the "Shoelace # Formula" https://en.wikipedia.org/wiki/Shoelace_formula - # If signed area is positive the curve is oriented counter-clockwise + # If signed area is positive the curve is oriented counter-clockwise. + # If the signed area is negative the curve is oriented clockwise. xpts, ypts = points.T - if np.sum(ypts*(np.roll(xpts, 1) - np.roll(xpts, -1))) > 0: - return points + if np.sum(ypts*(np.roll(xpts, 1) - np.roll(xpts, -1))) < 0: + points = points[::-1, :] - return points[::-1, :] + + # Check if polygon is self-intersecting by comparing edges pairwise + n = len(points) + for i in range(n): + p0 = points[i, :] + p1 = points[(i + 1) % n, :] + for j in range(i + 1, n): + p2 = points[j, :] + p3 = points[(j + 1) % n, :] + # Compute orientation of p0 wrt p2->p3 line segment + cp0 = np.cross(p3-p0, p2-p0) + # Compute orientation of p1 wrt p2->p3 line segment + cp1 = np.cross(p3-p1, p2-p1) + # Compute orientation of p2 wrt p0->p1 line segment + cp2 = np.cross(p1-p2, p0-p2) + # Compute orientation of p3 wrt p0->p1 line segment + cp3 = np.cross(p1-p3, p0-p3) + + # Group cross products in an array and find out how many are 0 + cross_products = np.array([[cp0, cp1], [cp2, cp3]]) + cps_near_zero = np.isclose(cross_products, 0).astype(int) + num_zeros = np.sum(cps_near_zero) + + # Topologies of 2 finite line segments categorized by the number + # of zero-valued cross products: + # + # 0: No 3 points lie on the same line + # 1: 1 point lies on the same line defined by the other line + # segment, but is not coincident with either of the points + # 2: 2 points are coincident, but the line segments are not + # collinear which guarantees no intersection + # 3: not possible + # 4: Both line segments are collinear, simply need to check if + # they overlap or not + + if num_zeros == 0: + # If the orientations of p0 and p1 have opposite signs + # and the orientations of p2 and p3 have opposite signs + # then there is an intersection. + if all(np.prod(cross_products, axis=-1) < 0): + raise ValueError('Polygon cannot be self-intersecting') + continue + + elif num_zeros == 1: + # determine which line segment has 2 out of the 3 collinear + # points + idx = np.argwhere(np.sum(cps_near_zero, axis=-1) == 0) + if np.prod(cross_products[idx, :]) < 0: + raise ValueError('Polygon cannot be self-intersecting') + continue + + elif num_zeros == 2: + continue + + elif num_zeros == 4: + # Determine number of unique points, x span and y span for + # both line segments + #unique_pts = np.unique(np.vstack((p0, p1, p2, p3)), axis=0) + xmin1, xmax1 = min(p0[0], p1[0]), max(p0[0], p1[0]) + ymin1, ymax1 = min(p0[1], p1[1]), max(p0[1], p1[1]) + xmin2, xmax2 = min(p2[0], p3[0]), max(p2[0], p3[0]) + ymin2, ymax2 = min(p2[1], p3[1]), max(p2[1], p3[1]) + xlap = xmin1 < xmax2 and xmin2 < xmax1 + ylap = ymin1 < ymax2 and ymin2 < ymax1 + if xlap or ylap: + raise ValueError('Polygon cannot be self-intersecting') + continue + + else: + warnings.warn('Unclear if Polygon is self-intersecting') + + return points def _constrain_triangulation(self, points, depth=0): """Generate a constrained triangulation by ensuring all edges of the From c07386fc62bcfea422a03889821b9b3f053d546f Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Sun, 5 Feb 2023 22:15:10 -0500 Subject: [PATCH 050/136] added more tests for Polygon class --- tests/unit_tests/test_surface_composite.py | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/unit_tests/test_surface_composite.py b/tests/unit_tests/test_surface_composite.py index dbfaa62b1..3f94893ed 100644 --- a/tests/unit_tests/test_surface_composite.py +++ b/tests/unit_tests/test_surface_composite.py @@ -339,3 +339,57 @@ def test_polygon(): offset_star = star_poly.offset(.6) assert (0, 0, 0) in -offset_star assert any([(0, 0, 0) in reg for reg in offset_star.regions]) + + # check invalid Polygon input points + # duplicate points not just at start and end + rz_points = np.array([[6.88, 3.02], + [6.88, 2.72], + [6.88, 3.02], + [7.63, 0.0], + [5.75, 0.0], + [5.75, 1.22], + [7.63, 0.0], + [6.30, 1.22], + [6.30, 3.02], + [6.88, 3.02]]) + with pytest.raises(ValueError): + openmc.model.Polygon(rz_points) + + # segment traces back on previous segment + rz_points = np.array([[6.88, 3.02], + [6.88, 2.72], + [6.88, 2.32], + [6.88, 2.52], + [7.63, 0.0], + [5.75, 0.0], + [6.75, 0.0], + [5.75, 1.22], + [6.30, 1.22], + [6.30, 3.02], + [6.88, 3.02]]) + with pytest.raises(ValueError): + openmc.model.Polygon(rz_points) + + # segments intersect (line-line) + rz_points = np.array([[6.88, 3.02], + [5.88, 2.32], + [7.63, 0.0], + [5.75, 0.0], + [5.75, 1.22], + [6.30, 1.22], + [6.30, 3.02], + [6.88, 3.02]]) + with pytest.raises(ValueError): + openmc.model.Polygon(rz_points) + + # segments intersect (line-point) + rz_points = np.array([[6.88, 3.02], + [6.3, 2.32], + [7.63, 0.0], + [5.75, 0.0], + [5.75, 1.22], + [6.30, 1.22], + [6.30, 3.02], + [6.88, 3.02]]) + with pytest.raises(ValueError): + openmc.model.Polygon(rz_points) From 637080a0c2b33f93f26c6647977aef6d99daf849 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Mon, 6 Feb 2023 15:52:46 -0500 Subject: [PATCH 051/136] address comments from @hassec review --- openmc/model/surface_composite.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 047cfe7fc..044ecf61e 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -816,9 +816,14 @@ class Polygon(CompositeSurface): # segment, but is not coincident with either of the points # 2: 2 points are coincident, but the line segments are not # collinear which guarantees no intersection - # 3: not possible + # 3: not possible, except maybe floating point issues? # 4: Both line segments are collinear, simply need to check if # they overlap or not + # adapted from algorithm linked below and modified to only + # consider intersections on the interior of line segments as + # proper intersections: i.e. segments sharing end points do not + # count as intersections. + # https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ if num_zeros == 0: # If the orientations of p0 and p1 have opposite signs @@ -839,7 +844,12 @@ class Polygon(CompositeSurface): elif num_zeros == 2: continue - elif num_zeros == 4: + elif num_zeros == 3: + warnings.warn('Unclear if Polygon is self-intersecting') + continue + + else: + # All 4 cross products are zero # Determine number of unique points, x span and y span for # both line segments #unique_pts = np.unique(np.vstack((p0, p1, p2, p3)), axis=0) @@ -853,9 +863,6 @@ class Polygon(CompositeSurface): raise ValueError('Polygon cannot be self-intersecting') continue - else: - warnings.warn('Unclear if Polygon is self-intersecting') - return points def _constrain_triangulation(self, points, depth=0): From af16239684024712beec6ace9b74e3024ad34b20 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 8 Feb 2023 10:17:59 -0600 Subject: [PATCH 052/136] Updating mesh centre tests. --- tests/unit_tests/test_cylindrical_mesh.py | 21 ++++++++++----- tests/unit_tests/test_spherical_mesh.py | 31 +++++++++++++++-------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index e67f21b15..a9d3fd56a 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -28,7 +28,7 @@ def model(): source.energy = openmc.stats.Discrete([10000], [1.0]) settings = openmc.Settings() - settings.particles = 1000 + settings.particles = 2000 settings.batches = 10 settings.run_mode = 'fixed source' @@ -43,7 +43,7 @@ def model(): mesh_filter = openmc.MeshFilter(mesh) tally.filters.append(mesh_filter) - tally.scores.append("heating") + tally.scores.append("flux") tallies = openmc.Tallies([tally]) @@ -63,7 +63,8 @@ def test_origin_read_write_to_xml(run_in_tmpdir, model): np.testing.assert_equal(new_mesh.origin, mesh.origin) estimators = ('tracklength', 'collision') -origins = permutations([-geom_size, 0, 0]) +origins = set(permutations((-geom_size, 0, 0))) +origins |= set(permutations((geom_size, 0, 0))) test_cases = product(estimators, origins) @@ -91,8 +92,14 @@ def test_offset_mesh(model, estimator, origin): # so ensure that half of the bins are populated assert np.count_nonzero(tally.mean) == tally.mean.size / 2 - # check that the lower half of the mesh contains a tally result - # and that the upper half is zero + # check that the half of the mesh that is outside of the geometry + # contains the zero values mean = tally.mean.reshape(mesh.dimension[::-1]).T - # assert np.count_nonzero(mean[:, :, :5]) == mean.size / 2 - # assert np.count_nonzero(mean[:, :, 5:]) == 0 + centroids = mesh.centroids + for ijk in mesh.indices: + i, j, k = np.array(ijk) - 1 + print(centroids[:, i, j, k]) + if model.geometry.find(centroids[:, i, j, k]): + mean[i, j, k] == 0.0 + else: + mean[i, j, k] != 0.0 diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index d6ac435c2..3cd8bbc5d 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -28,14 +28,14 @@ def model(): source.energy = openmc.stats.Discrete([10000], [1.0]) settings = openmc.Settings() - settings.particles = 1000 + settings.particles = 2000 settings.batches = 10 settings.run_mode = 'fixed source' # build mesh = openmc.SphericalMesh() - mesh.phi_grid = np.linspace(0, 2*np.pi, 21) - mesh.theta_grid = np.linspace(0, np.pi, 11) + mesh.phi_grid = np.linspace(0, 2*np.pi, 13) + mesh.theta_grid = np.linspace(0, np.pi, 7) mesh.r_grid = np.linspace(0, geom_size, geom_size) tally = openmc.Tally() @@ -43,7 +43,7 @@ def model(): mesh_filter = openmc.MeshFilter(mesh) tally.filters.append(mesh_filter) - tally.scores.append("heating") + tally.scores.append("flux") tallies = openmc.Tallies([tally]) @@ -63,7 +63,12 @@ def test_origin_read_write_to_xml(run_in_tmpdir, model): np.testing.assert_equal(new_mesh.origin, mesh.origin) estimators = ('tracklength', 'collision') -origins = permutations([-geom_size, 0, 0]) +# TODO: determine why this is needed for spherical mesh +# but not cylindrical mesh +offset = geom_size + 0.001 + +origins = set(permutations((-offset, 0, 0))) +origins |= set(permutations((offset, 0, 0))) test_cases = product(estimators, origins) @@ -79,7 +84,7 @@ def test_offset_mesh(model, estimator, origin): """ mesh = model.tallies[0].filters[0].mesh model.tallies[0].estimator = estimator - # move the center of the spherical mesh upwards + # move the center of the spherical mesh mesh.origin = origin sp_filename = model.run() @@ -91,8 +96,14 @@ def test_offset_mesh(model, estimator, origin): # so ensure that half of the bins are populated assert np.count_nonzero(tally.mean) == tally.mean.size / 2 - # check that the lower half of the mesh contains a tally result - # and that the upper half is zero + # check that the half of the mesh that is outside of the geometry + # contains the zero values mean = tally.mean.reshape(mesh.dimension[::-1]).T - # assert np.count_nonzero(mean[:, :, :5]) == mean.size / 2 - # assert np.count_nonzero(mean[:, :, 5:]) == 0 + centroids = mesh.centroids + for ijk in mesh.indices: + i, j, k = np.array(ijk) - 1 + print(centroids[:, i, j, k]) + if model.geometry.find(centroids[:, i, j, k]): + mean[i, j, k] == 0.0 + else: + mean[i, j, k] != 0.0 From 1a2d1237da0b46f8cc0dddeaccee3c7f1036381d Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Thu, 16 Feb 2023 12:27:15 -0500 Subject: [PATCH 053/136] Update openmc/model/surface_composite.py Co-authored-by: Jonathan Shimwell --- openmc/model/surface_composite.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 044ecf61e..09c2f4fee 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -785,7 +785,6 @@ class Polygon(CompositeSurface): if np.sum(ypts*(np.roll(xpts, 1) - np.roll(xpts, -1))) < 0: points = points[::-1, :] - # Check if polygon is self-intersecting by comparing edges pairwise n = len(points) for i in range(n): From c634a1467445352974e391cdfe7e80d936d3c6a9 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Fri, 17 Feb 2023 10:56:42 -0500 Subject: [PATCH 054/136] added origin to docstrings --- openmc/mesh.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 10d07000e..06f024676 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1049,6 +1049,8 @@ class CylindricalMesh(StructuredMesh): The default value is [0, 2Ï€], i.e. the full phi range. z_grid : numpy.ndarray 1-D array of mesh boundary points along the z-axis. + origin : tuple + The (x,y,z) origin of the mesh in cartesian coordinates indices : Iterable of tuple An iterable of mesh indices for each mesh element, e.g. [(1, 1, 1), (2, 1, 1), ...] @@ -1376,6 +1378,8 @@ class SphericalMesh(StructuredMesh): phi_grid : numpy.ndarray 1-D array of mesh boundary points along the phi-axis in radians. The default value is [0, 2Ï€], i.e. the full phi range. + origin : tuple + The (x,y,z) origin of the mesh in cartesian coordinates indices : Iterable of tuple An iterable of mesh indices for each mesh element, e.g. [(1, 1, 1), (2, 1, 1), ...] From f961fc90c2bc5c0565be5179a6a4c789cc553729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Tue, 21 Feb 2023 17:42:06 -0500 Subject: [PATCH 055/136] [skip ci] Modified the XML specs --- docs/source/io_formats/tallies.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/source/io_formats/tallies.rst b/docs/source/io_formats/tallies.rst index 8594bb11c..897941ad4 100644 --- a/docs/source/io_formats/tallies.rst +++ b/docs/source/io_formats/tallies.rst @@ -351,6 +351,9 @@ attributes/sub-elements: :theta_grid: The mesh divisions along the theta-axis. (For spherical mesh only.) + :origin: + The origin in cartesian coordinates. (For cylindrical and spherical meshes only.) + :library: The mesh library used to represent an unstructured mesh. This can be either "moab" or "libmesh". (For unstructured mesh only.) From 2f9f500542fef29ddf5ec1b408e9fd1e10c37f03 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 27 Feb 2023 16:10:27 -0500 Subject: [PATCH 056/136] removed check and always offset origin --- openmc/mesh.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 06f024676..2c74c7bfa 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1337,10 +1337,9 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) # offset with origin - if any([coord != 0 for coord in self.origin]): - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] + pts_cartesian[:, 0] += pts_cartesian[:, 0] + pts_cartesian[:, 1] += pts_cartesian[:, 1] + pts_cartesian[:, 2] += pts_cartesian[:, 2] return super().write_data_to_vtk( points=pts_cartesian, @@ -1598,10 +1597,9 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 2] = r * np.cos(phi) # offset with origin - if any([coord != 0 for coord in self.origin]): - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] + pts_cartesian[:, 0] += self.origin[0] + pts_cartesian[:, 1] += self.origin[1] + pts_cartesian[:, 2] += self.origin[2] return super().write_data_to_vtk( points=pts_cartesian, From c61e735a706b3bd251010ec8fa888cda30ebb596 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 27 Feb 2023 16:10:55 -0500 Subject: [PATCH 057/136] empty_like instead of copy --- openmc/mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 2c74c7bfa..9bed9200c 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1331,7 +1331,7 @@ class CylindricalMesh(StructuredMesh): for r in self.r_grid ] ) - pts_cartesian = np.copy(pts_cylindrical) + pts_cartesian = np.empty_like(pts_cylindrical) r, phi = pts_cylindrical[:, 0], pts_cylindrical[:, 1] pts_cartesian[:, 0] = r * np.cos(phi) pts_cartesian[:, 1] = r * np.sin(phi) @@ -1590,7 +1590,7 @@ class SphericalMesh(StructuredMesh): for r in self.r_grid ] ) - pts_cartesian = np.copy(pts_spherical) + pts_cartesian = np.empty_like(pts_spherical) r, theta, phi = pts_spherical[:, 0], pts_spherical[:, 1], pts_spherical[:, 2] pts_cartesian[:, 0] = r * np.sin(phi) * np.cos(theta) pts_cartesian[:, 1] = r * np.sin(phi) * np.sin(theta) From 9ca6f1b65b469938b5bb067c1c6d9d11a21f3623 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 27 Feb 2023 16:13:31 -0500 Subject: [PATCH 058/136] fixed docstrings for origin --- openmc/mesh.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 9bed9200c..db57a3a9e 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1049,8 +1049,9 @@ class CylindricalMesh(StructuredMesh): The default value is [0, 2Ï€], i.e. the full phi range. z_grid : numpy.ndarray 1-D array of mesh boundary points along the z-axis. - origin : tuple - The (x,y,z) origin of the mesh in cartesian coordinates + origin : numpy.ndarray + 1-D array of length 3 the (x,y,z) origin of the mesh in + cartesian coordinates indices : Iterable of tuple An iterable of mesh indices for each mesh element, e.g. [(1, 1, 1), (2, 1, 1), ...] @@ -1377,8 +1378,9 @@ class SphericalMesh(StructuredMesh): phi_grid : numpy.ndarray 1-D array of mesh boundary points along the phi-axis in radians. The default value is [0, 2Ï€], i.e. the full phi range. - origin : tuple - The (x,y,z) origin of the mesh in cartesian coordinates + origin : numpy.ndarray + 1-D array of length 3 the (x,y,z) origin of the mesh in + cartesian coordinates indices : Iterable of tuple An iterable of mesh indices for each mesh element, e.g. [(1, 1, 1), (2, 1, 1), ...] From 972e1c12ec4cc2001202409bf8227454f8c83abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:22:10 -0500 Subject: [PATCH 059/136] [skip ci] Minor refactoring Co-authored-by: Ethan Peterson --- openmc/mesh.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index db57a3a9e..a7c2eb172 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1594,14 +1594,9 @@ class SphericalMesh(StructuredMesh): ) pts_cartesian = np.empty_like(pts_spherical) r, theta, phi = pts_spherical[:, 0], pts_spherical[:, 1], pts_spherical[:, 2] - pts_cartesian[:, 0] = r * np.sin(phi) * np.cos(theta) - pts_cartesian[:, 1] = r * np.sin(phi) * np.sin(theta) - pts_cartesian[:, 2] = r * np.cos(phi) - - # offset with origin - pts_cartesian[:, 0] += self.origin[0] - pts_cartesian[:, 1] += self.origin[1] - pts_cartesian[:, 2] += self.origin[2] + pts_cartesian[:, 0] = r * np.sin(phi) * np.cos(theta) + self.origin[0] + pts_cartesian[:, 1] = r * np.sin(phi) * np.sin(theta) + self.origin[1] + pts_cartesian[:, 2] = r * np.cos(phi) + self.origin[2] return super().write_data_to_vtk( points=pts_cartesian, From 308be3f1eac95143eec2f3f40c36adb6dfa351c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:23:45 -0500 Subject: [PATCH 060/136] Update openmc/mesh.py Co-authored-by: Ethan Peterson --- openmc/mesh.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index a7c2eb172..039f302e9 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1334,14 +1334,10 @@ class CylindricalMesh(StructuredMesh): ) pts_cartesian = np.empty_like(pts_cylindrical) r, phi = pts_cylindrical[:, 0], pts_cylindrical[:, 1] - pts_cartesian[:, 0] = r * np.cos(phi) - pts_cartesian[:, 1] = r * np.sin(phi) - - # offset with origin - pts_cartesian[:, 0] += pts_cartesian[:, 0] - pts_cartesian[:, 1] += pts_cartesian[:, 1] - pts_cartesian[:, 2] += pts_cartesian[:, 2] - + pts_cartesian[:, 0] = r * np.cos(phi) + self.origin[0] + pts_cartesian[:, 1] = r * np.sin(phi) + self.origin[1] + pts_cartesian[:, 2] += self.origin[2] + return super().write_data_to_vtk( points=pts_cartesian, filename=filename, From c71c13496356a0e65cc1ac284608a31845f0f934 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 27 Feb 2023 16:32:05 -0500 Subject: [PATCH 061/136] added grids in statepoint specs --- docs/source/io_formats/statepoint.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/io_formats/statepoint.rst b/docs/source/io_formats/statepoint.rst index 9a08eed73..c0db5ea92 100644 --- a/docs/source/io_formats/statepoint.rst +++ b/docs/source/io_formats/statepoint.rst @@ -78,6 +78,12 @@ The current version of the statepoint file format is 17.0. of mesh. - **width** (*double[]*) -- Width of each mesh cell in each dimension. + - **Cylindrical & Spherical Mesh Only:** + - **r_grid** (*double[]*) -- The mesh divisions along the r-axis. + - **phi_grid** (*double[]*) -- The mesh divisions along the phi-axis. + - **origin** (*double[]*) -- The origin in cartesian coordinates. + - **Spherical Mesh Only:** + - **theta_grid** (*double[]*) -- The mesh divisions along the theta-axis. - **Unstructured Mesh Only:** - **filename** (*char[]*) -- Name of the mesh file. - **library** (*char[]*) -- Mesh library used to represent the From c20f115cb936eb0b95cd72a87580a3570b93daa2 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 3 Mar 2023 11:02:48 -0600 Subject: [PATCH 062/136] Change exception in decay source processing to warning --- openmc/data/decay.py | 4 ++-- openmc/stats/univariate.py | 26 ++++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/openmc/data/decay.py b/openmc/data/decay.py index d00242438..57327c07f 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -558,9 +558,9 @@ class Decay(EqualityMixin): raise NotImplementedError("Multiple interpolation regions: {name}, {particle}") interpolation = INTERPOLATION_SCHEME[f.interpolation[0]] if interpolation not in ('histogram', 'linear-linear'): - raise NotImplementedError( + warn( f"Continuous spectra with {interpolation} interpolation " - f"({name}, {particle}) not supported") + f"({name}, {particle}) encountered.") intensity = spectra['continuous_normalization'].n rates = decay_constant * intensity * f.y diff --git a/openmc/stats/univariate.py b/openmc/stats/univariate.py index 64627a4e1..240f13d14 100644 --- a/openmc/stats/univariate.py +++ b/openmc/stats/univariate.py @@ -834,10 +834,6 @@ class Tabular(Univariate): self._interpolation = interpolation def cdf(self): - if not self.interpolation in ('histogram', 'linear-linear'): - raise NotImplementedError('Can only generate CDFs for tabular ' - 'distributions using histogram or ' - 'linear-linear interpolation') c = np.zeros_like(self.x) x = self.x p = self.p @@ -846,15 +842,16 @@ class Tabular(Univariate): c[1:] = p[:-1] * np.diff(x) elif self.interpolation == 'linear-linear': c[1:] = 0.5 * (p[:-1] + p[1:]) * np.diff(x) + else: + raise NotImplementedError('Can only generate CDFs for tabular ' + 'distributions using histogram or ' + 'linear-linear interpolation') + return np.cumsum(c) def mean(self): """Compute the mean of the tabular distribution""" - if not self.interpolation in ('histogram', 'linear-linear'): - raise NotImplementedError('Can only compute mean for tabular ' - 'distributions using histogram ' - 'or linear-linear interpolation.') if self.interpolation == 'linear-linear': mean = 0.0 for i in range(1, len(self.x)): @@ -875,6 +872,10 @@ class Tabular(Univariate): x_r = self.x[1:] p_l = self.p[:-1] mean = (0.5 * (x_l + x_r) * (x_r - x_l) * p_l).sum() + else: + raise NotImplementedError('Can only compute mean for tabular ' + 'distributions using histogram ' + 'or linear-linear interpolation.') # Normalize for when integral of distribution is not 1 mean /= self.integral() @@ -886,10 +887,6 @@ class Tabular(Univariate): self.p /= self.cdf().max() def sample(self, n_samples=1, seed=None): - if not self.interpolation in ('histogram', 'linear-linear'): - raise NotImplementedError('Can only sample tabular distributions ' - 'using histogram or ' - 'linear-linear interpolation') np.random.seed(seed) xi = np.random.rand(n_samples) @@ -942,6 +939,11 @@ class Tabular(Univariate): m[non_zero] = x_i[non_zero] + (np.sqrt(quad) - p_i[non_zero]) / m[non_zero] samples_out = m + else: + raise NotImplementedError('Can only sample tabular distributions ' + 'using histogram or ' + 'linear-linear interpolation') + assert all(samples_out < self.x[-1]) return samples_out From 59467633230660270fb74d0e6ceb0442b93e9680 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 4 Mar 2023 15:51:56 -0600 Subject: [PATCH 063/136] Moving origin data member down into Cylindrical/Spherical mesh using intermediate class --- include/openmc/mesh.h | 30 ++++++++++++++++++++++++++---- src/mesh.cpp | 14 ++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 9554a5143..6ae076106 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -75,6 +75,12 @@ public: // Methods + //! Update a position to the local coordinates of the mesh + virtual void to_local_coords(Position& r) const {}; + + //! Return a position in the local coordinates of the mesh + virtual Position local_coords(const Position& r) const { return r; }; + //! Determine which bins were crossed by a particle // //! \param[in] r0 Previous position of the particle @@ -160,7 +166,7 @@ public: } }; - int get_bin(Position r) const override; + virtual int get_bin(Position r) const; int n_bins() const override; @@ -241,11 +247,27 @@ public: xt::xtensor lower_left_; //!< Lower-left coordinates of mesh xt::xtensor upper_right_; //!< Upper-right coordinates of mesh std::array shape_; //!< Number of mesh elements in each dimension - Position origin_ {0.0, 0.0, 0.0}; protected: }; +class PeriodicStructuredMesh : public StructuredMesh { + +public: + PeriodicStructuredMesh() = default; + PeriodicStructuredMesh(pugi::xml_node node) : StructuredMesh {node} {}; + + void to_local_coords(Position& r) const override { r -= origin_; }; + + Position local_coords(const Position& r) const override + { + return r - origin_; + }; + + // Data members + Position origin_ {0.0, 0.0, 0.0}; +}; + //============================================================================== //! Tessellation of n-dimensional Euclidean space by congruent squares or cubes //============================================================================== @@ -336,7 +358,7 @@ public: int set_grid(); }; -class CylindricalMesh : public StructuredMesh { +class CylindricalMesh : public PeriodicStructuredMesh { public: // Constructors CylindricalMesh() = default; @@ -390,7 +412,7 @@ private: } }; -class SphericalMesh : public StructuredMesh { +class SphericalMesh : public PeriodicStructuredMesh { public: // Constructors SphericalMesh() = default; diff --git a/src/mesh.cpp b/src/mesh.cpp index e0fa305ed..eca1d2a3f 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -446,8 +446,8 @@ void StructuredMesh::raytrace_mesh( // translate start and end positions, // this needs to come after the get_indices call because it does its own translation - r0 -= origin_; - r1 -= origin_; + to_local_coords(r0); + to_local_coords(r1); // Calculate initial distances to next surfaces in all three dimensions std::array distances; @@ -952,7 +952,8 @@ void RectilinearMesh::to_hdf5(hid_t group) const // CylindricalMesh implementation //============================================================================== -CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node} +CylindricalMesh::CylindricalMesh(pugi::xml_node node) + : PeriodicStructuredMesh {node} { n_dimension_ = 3; @@ -976,7 +977,7 @@ std::string CylindricalMesh::get_mesh_type() const StructuredMesh::MeshIndex CylindricalMesh::get_indices( Position r, bool& in_mesh) const { - r -= origin_; + to_local_coords(r); Position mapped_r; mapped_r[0] = std::hypot(r.x, r.y); @@ -1189,7 +1190,8 @@ void CylindricalMesh::to_hdf5(hid_t group) const // SphericalMesh implementation //============================================================================== -SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node} +SphericalMesh::SphericalMesh(pugi::xml_node node) + : PeriodicStructuredMesh {node} { n_dimension_ = 3; @@ -1213,7 +1215,7 @@ std::string SphericalMesh::get_mesh_type() const StructuredMesh::MeshIndex SphericalMesh::get_indices( Position r, bool& in_mesh) const { - r -= origin_; + to_local_coords(r); Position mapped_r; mapped_r[0] = r.norm(); From b02e558fae56486aed8d97ee1f00e8831be3f317 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 4 Mar 2023 23:57:55 -0600 Subject: [PATCH 064/136] Adding docstring. Updating method name --- include/openmc/mesh.h | 6 +++--- src/mesh.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 6ae076106..f19a22c09 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -76,7 +76,7 @@ public: // Methods //! Update a position to the local coordinates of the mesh - virtual void to_local_coords(Position& r) const {}; + virtual void local_coords(Position& r) const {}; //! Return a position in the local coordinates of the mesh virtual Position local_coords(const Position& r) const { return r; }; @@ -257,7 +257,7 @@ public: PeriodicStructuredMesh() = default; PeriodicStructuredMesh(pugi::xml_node node) : StructuredMesh {node} {}; - void to_local_coords(Position& r) const override { r -= origin_; }; + void local_coords(Position& r) const override { r -= origin_; }; Position local_coords(const Position& r) const override { @@ -265,7 +265,7 @@ public: }; // Data members - Position origin_ {0.0, 0.0, 0.0}; + Position origin_ {0.0, 0.0, 0.0}; //!< Origin of the mesh }; //============================================================================== diff --git a/src/mesh.cpp b/src/mesh.cpp index eca1d2a3f..9020a95aa 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -446,8 +446,8 @@ void StructuredMesh::raytrace_mesh( // translate start and end positions, // this needs to come after the get_indices call because it does its own translation - to_local_coords(r0); - to_local_coords(r1); + local_coords(r0); + local_coords(r1); // Calculate initial distances to next surfaces in all three dimensions std::array distances; @@ -977,7 +977,7 @@ std::string CylindricalMesh::get_mesh_type() const StructuredMesh::MeshIndex CylindricalMesh::get_indices( Position r, bool& in_mesh) const { - to_local_coords(r); + local_coords(r); Position mapped_r; mapped_r[0] = std::hypot(r.x, r.y); @@ -1215,7 +1215,7 @@ std::string SphericalMesh::get_mesh_type() const StructuredMesh::MeshIndex SphericalMesh::get_indices( Position r, bool& in_mesh) const { - to_local_coords(r); + local_coords(r); Position mapped_r; mapped_r[0] = r.norm(); From 1a9449debce3036b3ff3cf5e7b30662bae5b6b55 Mon Sep 17 00:00:00 2001 From: shimwell Date: Mon, 6 Mar 2023 20:36:34 +0000 Subject: [PATCH 065/136] finding data_type arg automatically --- openmc/plotter.py | 131 +++++++++++++++---------------- tests/unit_tests/test_plotter.py | 28 +++---- 2 files changed, 76 insertions(+), 83 deletions(-) diff --git a/openmc/plotter.py b/openmc/plotter.py index e2d18d085..541b05f0b 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -53,16 +53,15 @@ _MIN_E = 1.e-5 _MAX_E = 20.e6 -def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, - axis=None, sab_name=None, ce_cross_sections=None, - mg_cross_sections=None, enrichment=None, plot_CE=True, orders=None, - divisor_orders=None, **kwargs): +def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, + sab_name=None, ce_cross_sections=None, mg_cross_sections=None, + enrichment=None, plot_CE=True, orders=None, divisor_orders=None): """Creates a figure of continuous-energy cross sections for this item. Parameters ---------- - this : str or openmc.Material - Object to source data from + this : {str, openmc.Nuclide, openmc.Element, openmc.Macroscopic, openmc.Material} + Object to source data from. Nuclides and Elements can be input as a str types : Iterable of values of PLOT_TYPES The type of cross sections to include in the plot. divisor_types : Iterable of values of PLOT_TYPES, optional @@ -74,9 +73,6 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, temperature of 294K will be plotted. Note that the nearest temperature in the library for each nuclide will be used as opposed to using any interpolation. - data_type : {'nuclide', 'element', 'material', 'macroscopic'}, optional - Type of object to plot. If not specified, a guess is made based on the - `this` argument. axis : matplotlib.axes, optional A previously generated axis to use for plotting. If not specified, a new axis and figure will be generated. @@ -101,9 +97,6 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, multi-group data. divisor_orders : Iterable of Integral, optional Same as orders, but for divisor_types - **kwargs - All keyword arguments are passed to - :func:`matplotlib.pyplot.figure`. Returns ------- @@ -117,27 +110,11 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, import matplotlib.pyplot as plt cv.check_type("plot_CE", plot_CE, bool) - - if data_type is None: - if isinstance(this, openmc.Nuclide): - data_type = 'nuclide' - elif isinstance(this, openmc.Element): - data_type = 'element' - elif isinstance(this, openmc.Material): - data_type = 'material' - elif isinstance(this, openmc.Macroscopic): - data_type = 'macroscopic' - elif isinstance(this, str): - if this[-1] in string.digits: - data_type = 'nuclide' - else: - data_type = 'element' - else: - raise TypeError("Invalid type for plotting") + cv.check_type("this", this, (str, openmc.Nuclide, openmc.Element, openmc.Material)) if plot_CE: # Calculate for the CE cross sections - E, data = calculate_cexs(this, data_type, types, temperature, sab_name, + E, data = calculate_cexs(this, types, temperature, sab_name, ce_cross_sections, enrichment) if divisor_types: cv.check_length('divisor types', divisor_types, len(types)) @@ -160,13 +137,13 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, data = data_new else: # Calculate for MG cross sections - E, data = calculate_mgxs(this, data_type, types, orders, temperature, + E, data = calculate_mgxs(this, types, orders, temperature, mg_cross_sections, ce_cross_sections, enrichment) if divisor_types: cv.check_length('divisor types', divisor_types, len(types)) - Ediv, data_div = calculate_mgxs(this, data_type, divisor_types, + Ediv, data_div = calculate_mgxs(this, divisor_types, divisor_orders, temperature, mg_cross_sections, ce_cross_sections, enrichment) @@ -201,23 +178,35 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, ax.set_xlim(_MIN_E, _MAX_E) else: ax.set_xlim(E[-1], E[0]) + + if isinstance(this, str): + # first entry in ELEMENT_SYMBOL is a neutron, the 1 removes this entry + if this in list(openmc.data.ELEMENT_SYMBOL.values())[1:]: + this = openmc.Element(this) + else: + this = openmc.Nuclide(this) + if divisor_types: - if data_type == 'nuclide': + if isinstance(this, openmc.Nuclide): ylabel = 'Nuclidic Microscopic Data' - elif data_type == 'element': + elif isinstance(this, openmc.Element): ylabel = 'Elemental Microscopic Data' - elif data_type == 'material' or data_type == 'macroscopic': + elif isinstance(this, openmc.Material) or isinstance(this, openmc.Macroscopic): ylabel = 'Macroscopic Data' + else: + raise TypeError("Invalid type for plotting") else: - if data_type == 'nuclide': + if isinstance(this, openmc.Nuclide): ylabel = 'Microscopic Cross Section [b]' - elif data_type == 'element': + elif isinstance(this, openmc.Element): ylabel = 'Elemental Cross Section [b]' - elif data_type == 'material' or data_type == 'macroscopic': + elif isinstance(this, openmc.Material) or isinstance(this, openmc.Macroscopic): ylabel = 'Macroscopic Cross Section [1/cm]' + else: + raise TypeError("Invalid type for plotting") ax.set_ylabel(ylabel) ax.legend(loc='best') - name = this.name if data_type == 'material' else this + name = this.name if isinstance(this, openmc.Material) else this if len(types) > 1: ax.set_title('Cross Sections for ' + name) else: @@ -226,16 +215,14 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, return fig -def calculate_cexs(this, data_type, types, temperature=294., sab_name=None, +def calculate_cexs(this, types, temperature=294., sab_name=None, cross_sections=None, enrichment=None): """Calculates continuous-energy cross sections of a requested type. Parameters ---------- this : {str, openmc.Nuclide, openmc.Element, openmc.Material} - Object to source data from - data_type : {'nuclide', 'element', 'material'} - Type of object to plot + Object to source data from. Nuclides and Elements can be input as a str types : Iterable of values of PLOT_TYPES The type of cross sections to calculate temperature : float, optional @@ -262,39 +249,46 @@ def calculate_cexs(this, data_type, types, temperature=294., sab_name=None, """ # Check types + cv.check_type('this', this, (str, openmc.Nuclide, openmc.Element, openmc.Material)) cv.check_type('temperature', temperature, Real) if sab_name: cv.check_type('sab_name', sab_name, str) if enrichment: cv.check_type('enrichment', enrichment, Real) - if data_type == 'nuclide': - if isinstance(this, str): - nuc = openmc.Nuclide(this) + # this is a nuclide or element if it is a string + if isinstance(this, str): + # first entry in ELEMENT_SYMBOL is a neutron, the 1 removes this entry + if this in list(openmc.data.ELEMENT_SYMBOL.values())[1:]: + this = openmc.Element(this) else: - nuc = this - energy_grid, xs = _calculate_cexs_nuclide(nuc, types, temperature, + this = openmc.Nuclide(this) + + if isinstance(this, openmc.Nuclide): + energy_grid, xs = _calculate_cexs_nuclide(this, types, temperature, sab_name, cross_sections) + # Convert xs (Iterable of Callable) to a grid of cross section values # calculated on the points in energy_grid for consistency with the # element and material functions. data = np.zeros((len(types), len(energy_grid))) for line in range(len(types)): data[line, :] = xs[line](energy_grid) - elif data_type == 'element': - if isinstance(this, str): - elem = openmc.Element(this) - else: - elem = this - energy_grid, data = _calculate_cexs_elem_mat(elem, types, temperature, + + elif isinstance(this, openmc.Element): + energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature, cross_sections, sab_name, enrichment) - elif data_type == 'material': - cv.check_type('this', this, openmc.Material) + + elif isinstance(this, openmc.Material): energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature, cross_sections) else: - raise TypeError("Invalid type") + msg = ( + f"{this} is an invalid type, acceptable types are str, " + "openmc.Nuclide, openmc.Element, openmc.Material." + ) + raise TypeError(msg) return energy_grid, data @@ -583,8 +577,7 @@ def _calculate_cexs_elem_mat(this, types, temperature=294., name = nuclide[0] nuc = nuclide[1] sab_tab = sabs[name] - temp_E, temp_xs = calculate_cexs(nuc, 'nuclide', types, T, sab_tab, - cross_sections) + temp_E, temp_xs = calculate_cexs(nuc, types, T, sab_tab, cross_sections) E.append(temp_E) # Since the energy grids are different, store the cross sections as # a tabulated function so they can be calculated on any grid needed. @@ -611,7 +604,7 @@ def _calculate_cexs_elem_mat(this, types, temperature=294., return energy_grid, data -def calculate_mgxs(this, data_type, types, orders=None, temperature=294., +def calculate_mgxs(this, types, orders=None, temperature=294., cross_sections=None, ce_cross_sections=None, enrichment=None): """Calculates multi-group cross sections of a requested type. @@ -622,10 +615,8 @@ def calculate_mgxs(this, data_type, types, orders=None, temperature=294., Parameters ---------- - this : str or openmc.Material - Object to source data from - data_type : {'nuclide', 'element', 'material', 'macroscopic'} - Type of object to plot + this : {str, openmc.Nuclide, openmc.Element, openmc.Macroscopic, openmc.Material} + Object to source data from. Nuclides and Elements can be input as a str types : Iterable of values of PLOT_TYPES_MGXS The type of cross sections to calculate orders : Iterable of Integral, optional @@ -665,10 +656,18 @@ def calculate_mgxs(this, data_type, types, orders=None, temperature=294., cv.check_type("cross_sections", cross_sections, str) library = openmc.MGXSLibrary.from_hdf5(cross_sections) - if data_type in ('nuclide', 'macroscopic'): + # this is a nuclide or element if it is a string + if isinstance(this, str): + # first entry in ELEMENT_SYMBOL is a neutron, the 1 removes this entry + if this in list(openmc.data.ELEMENT_SYMBOL.values())[1:]: + this = openmc.Element(this) + else: + this = openmc.Nuclide(this) + + if isinstance(this, openmc.Nuclide) or isinstance(this, openmc.Macroscopic): mgxs = _calculate_mgxs_nuc_macro(this, types, library, orders, temperature) - elif data_type in ('element', 'material'): + elif isinstance(this, openmc.Element) or isinstance(this, openmc.Material): mgxs = _calculate_mgxs_elem_mat(this, types, library, orders, temperature, ce_cross_sections, enrichment) diff --git a/tests/unit_tests/test_plotter.py b/tests/unit_tests/test_plotter.py index 081fb520d..f7c731f1d 100644 --- a/tests/unit_tests/test_plotter.py +++ b/tests/unit_tests/test_plotter.py @@ -4,7 +4,7 @@ import pytest from matplotlib.figure import Figure -@pytest.fixture(scope="module") +@pytest.fixture(scope='module') def test_mat(): mat_1 = openmc.Material() mat_1.add_element("H", 4.0, "ao") @@ -12,7 +12,6 @@ def test_mat(): mat_1.add_element("C", 4.0, "ao") return mat_1 - def test_calculate_cexs_elem_mat_sab(test_mat): """Checks that sab cross sections are included in the _calculate_cexs_elem_mat method and have the correct shape""" @@ -33,12 +32,11 @@ def test_calculate_cexs_elem_mat_sab(test_mat): assert len(data[0]) == len(energy_grid) -@pytest.mark.parametrize("this,data_type", [("Li", "element"), ("Li6", "nuclide")]) -def test_calculate_cexs_with_element(this, data_type): - +@pytest.mark.parametrize("this", ["Li", "Li6", openmc.Nuclide('Li6'), openmc.Element('Li')]) +def test_calculate_cexs_with_nuclide_and_element(this): # single type (reaction) energy_grid, data = openmc.plotter.calculate_cexs( - this=this, data_type=data_type, types=[205] + this=this, types=[205] ) assert isinstance(energy_grid, np.ndarray) @@ -47,9 +45,9 @@ def test_calculate_cexs_with_element(this, data_type): assert len(data) == 1 assert len(data[0]) == len(energy_grid) - # two types (reaction) + # two types (reactions) energy_grid, data = openmc.plotter.calculate_cexs( - this=this, data_type=data_type, types=[2, "elastic"] + this=this, types=[2, "elastic"] ) assert isinstance(energy_grid, np.ndarray) @@ -64,7 +62,7 @@ def test_calculate_cexs_with_element(this, data_type): def test_calculate_cexs_with_materials(test_mat): energy_grid, data = openmc.plotter.calculate_cexs( - this=test_mat, types=[205], data_type="material" + this=test_mat, types=[205] ) assert isinstance(energy_grid, np.ndarray) @@ -74,14 +72,10 @@ def test_calculate_cexs_with_materials(test_mat): assert len(data[0]) == len(energy_grid) -@pytest.mark.parametrize(("this,data_type"), [("Be", "element"), ("Be9", "nuclide")]) -def test_plot_xs(this, data_type): - assert isinstance( - openmc.plotter.plot_xs(this, data_type=data_type, types=["total"]), Figure - ) +@pytest.mark.parametrize("this", ["Be", "Be9", openmc.Nuclide('Be9'), openmc.Element('Be')]) +def test_plot_xs(this): + assert isinstance(openmc.plotter.plot_xs(this, types=['total']), Figure) def test_plot_xs_mat(test_mat): - assert isinstance( - openmc.plotter.plot_xs(test_mat, data_type="material", types=["total"]), Figure - ) + assert isinstance(openmc.plotter.plot_xs(test_mat, types=['total']), Figure) From ab4237c037a3f142e50168690c2c0dca5edefcf5 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 7 Mar 2023 14:36:07 -0500 Subject: [PATCH 066/136] use get_reshaped_data in tests --- tests/unit_tests/test_cylindrical_mesh.py | 2 +- tests/unit_tests/test_spherical_mesh.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index e67f21b15..9c8ce79f9 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -93,6 +93,6 @@ def test_offset_mesh(model, estimator, origin): # check that the lower half of the mesh contains a tally result # and that the upper half is zero - mean = tally.mean.reshape(mesh.dimension[::-1]).T + mean = tally.get_reshaped_data('mean', expand_dims=True) # assert np.count_nonzero(mean[:, :, :5]) == mean.size / 2 # assert np.count_nonzero(mean[:, :, 5:]) == 0 diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index d6ac435c2..489c4bd34 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -93,6 +93,6 @@ def test_offset_mesh(model, estimator, origin): # check that the lower half of the mesh contains a tally result # and that the upper half is zero - mean = tally.mean.reshape(mesh.dimension[::-1]).T + mean = tally.get_reshaped_data('mean', expand_dims=True) # assert np.count_nonzero(mean[:, :, :5]) == mean.size / 2 # assert np.count_nonzero(mean[:, :, 5:]) == 0 From c487090b3f6c19b9de1adade6c6ccb261c1e1e08 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 6 Mar 2023 23:38:00 -0600 Subject: [PATCH 067/136] Correcting spherical to cartesian coordinate conversion --- openmc/mesh.py | 8 +- tests/unit_tests/test_mesh_to_vtk.py | 156 ++++++++++++++++++++++++--- 2 files changed, 147 insertions(+), 17 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 5294b2dd6..a0f86314d 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -446,7 +446,7 @@ class RegularMesh(StructuredMesh): if self._width is not None: self._width = None warnings.warn("Unsetting width attribute.") - + if self.lower_left is not None and any(np.isclose(self.lower_left, upper_right)): raise ValueError("Mesh cannot have zero thickness in any dimension") @@ -1533,9 +1533,9 @@ class SphericalMesh(StructuredMesh): pts_cartesian = np.copy(pts_spherical) r, theta, phi = pts_spherical[:, 0], pts_spherical[:, 1], pts_spherical[:, 2] - pts_cartesian[:, 0] = r * np.sin(phi) * np.cos(theta) - pts_cartesian[:, 1] = r * np.sin(phi) * np.sin(theta) - pts_cartesian[:, 2] = r * np.cos(phi) + pts_cartesian[:, 0] = r * np.sin(theta) * np.cos(phi) + pts_cartesian[:, 1] = r * np.sin(theta) * np.sin(phi) + pts_cartesian[:, 2] = r * np.cos(theta) return super().write_data_to_vtk( points=pts_cartesian, diff --git a/tests/unit_tests/test_mesh_to_vtk.py b/tests/unit_tests/test_mesh_to_vtk.py index a9dcd7243..06a5606e7 100644 --- a/tests/unit_tests/test_mesh_to_vtk.py +++ b/tests/unit_tests/test_mesh_to_vtk.py @@ -1,3 +1,5 @@ +from itertools import product + import numpy as np from pathlib import Path import pytest @@ -7,29 +9,77 @@ from vtk.util import numpy_support as nps import openmc +@pytest.fixture +def model(): + openmc.reset_auto_ids() + + surf1 = openmc.Sphere(r=10, boundary_type='vacuum') + surf2 = openmc.XPlane(x0=-0.001, boundary_type='vacuum') + + cell = openmc.Cell(region=-surf1 & -surf2) + + geometry = openmc.Geometry([cell]) + + settings = openmc.Settings() + settings.batches = 2 + settings.particles = 100 + settings.run_mode = 'fixed source' + + source = openmc.Source() + source.angle = openmc.stats.Isotropic() + source.energy = openmc.stats.Discrete([1.0e6], [1.0]) + source.space = openmc.stats.Point((-0.01, -0.01, -0.01)) + + settings.source = source + + model = openmc.Model(geometry=geometry, settings=settings) + + return model + regular_mesh = openmc.RegularMesh() -regular_mesh.lower_left = (0, 0, 0) -regular_mesh.upper_right = (1, 1, 1) +regular_mesh.lower_left = (-10, -10, -10) +regular_mesh.upper_right = (10, 10, 10) regular_mesh.dimension = [30, 20, 10] rectilinear_mesh = openmc.RectilinearMesh() -rectilinear_mesh.x_grid = np.linspace(1, 2, num=30) -rectilinear_mesh.y_grid = np.linspace(1, 2, num=30) -rectilinear_mesh.z_grid = np.linspace(1, 2, num=30) +rectilinear_mesh.x_grid = np.linspace(-10, 10, 6) +rectilinear_mesh.y_grid = np.logspace(0, 1, 7) +rectilinear_mesh.y_grid = \ + np.concatenate((-rectilinear_mesh.y_grid[::-1], rectilinear_mesh.y_grid)) +rectilinear_mesh.z_grid = np.linspace(-10, 10, 11) cylinder_mesh = openmc.CylindricalMesh() -cylinder_mesh.r_grid = np.linspace(1, 2, num=30) -cylinder_mesh.phi_grid = np.linspace(0, np.pi, num=50) -cylinder_mesh.z_grid = np.linspace(0, 1, num=30) +cylinder_mesh.r_grid = np.linspace(0, 10, 23) +cylinder_mesh.phi_grid = np.linspace(0, np.pi, 21) +cylinder_mesh.z_grid = np.linspace(0, 1, 15) spherical_mesh = openmc.SphericalMesh() -spherical_mesh.r_grid = np.linspace(1, 2, num=30) -spherical_mesh.phi_grid = np.linspace(0, np.pi, num=50) -spherical_mesh.theta_grid = np.linspace(0, np.pi / 2, num=30) +spherical_mesh.r_grid = np.linspace(1, 10, 30) +spherical_mesh.phi_grid = np.linspace(0, np.pi, 25) +spherical_mesh.theta_grid = np.linspace(0, np.pi / 2, 15) + +MESHES = [cylinder_mesh, regular_mesh, rectilinear_mesh, spherical_mesh] + +x_plane = openmc.XPlane(x0=-0.001, boundary_type='vacuum') +y_plane = openmc.YPlane(y0=-0.001, boundary_type='vacuum') +z_plane = openmc.ZPlane(z0=-0.001, boundary_type='vacuum') + +SURFS = [x_plane, y_plane, z_plane] -@pytest.mark.parametrize("mesh", [cylinder_mesh, regular_mesh, rectilinear_mesh, spherical_mesh]) +def ids(mesh): + if isinstance(mesh, openmc.CylindricalMesh): + return 'cylindrical_mesh' + elif isinstance(mesh, openmc.RegularMesh): + return 'regular_mesh' + elif isinstance(mesh, openmc.RectilinearMesh): + return 'rectilinear_mesh' + elif isinstance(mesh, openmc.SphericalMesh): + return 'spherical_mesh' + + +@pytest.mark.parametrize("mesh", MESHES, ids=ids) def test_write_data_to_vtk(mesh, tmpdir): # BUILD filename = Path(tmpdir) / "out.vtk" @@ -69,7 +119,7 @@ def test_write_data_to_vtk(mesh, tmpdir): assert all(data1 == 1.0) -@pytest.mark.parametrize("mesh", [cylinder_mesh, regular_mesh, rectilinear_mesh, spherical_mesh]) +@pytest.mark.parametrize("mesh", MESHES, ids=ids) def test_write_data_to_vtk_size_mismatch(mesh): """Checks that an error is raised when the size of the dataset doesn't match the mesh number of cells @@ -92,6 +142,7 @@ def test_write_data_to_vtk_size_mismatch(mesh): with pytest.raises(ValueError, match=expected_error_msg): mesh.write_data_to_vtk(filename="out.vtk", datasets={"label": data}) +<<<<<<< HEAD def test_write_data_to_vtk_round_trip(run_in_tmpdir): cmesh = openmc.CylindricalMesh() cmesh.r_grid = (0.0, 1.0, 2.0) @@ -149,3 +200,82 @@ def test_write_data_to_vtk_round_trip(run_in_tmpdir): # checks that the vtk cell values are equal to the data assert np.array_equal(vtk_values, data) +======= + +def mesh_surf_id(param): + + if isinstance(param, openmc.MeshBase): + return ids(param) + + if isinstance(param, openmc.XPlane): + return 'XPlane' + elif isinstance(param, openmc.YPlane): + return 'YPlane' + elif isinstance(param, openmc.ZPlane): + return 'ZPlane' + + +@pytest.mark.parametrize("mesh,surface", product(MESHES, SURFS), ids=mesh_surf_id) +def test_vtk_write_ordering(model, mesh, surface): + + tally = openmc.Tally() + tally.scores = ['flux'] + # use the mesh on the specified tally + mesh_filter = openmc.MeshFilter(mesh) + tally.filters = [mesh_filter] + + model.tallies = openmc.Tallies([tally]) + + # run the problem + sp_filename = model.run() + + with openmc.StatePoint(sp_filename) as sp: + mean = sp.tallies[tally.id].mean + + # write the data to a VTK file + vtk_filename = 'test.vtk' + mesh.write_data_to_vtk(vtk_filename, datasets={'mean': mean}) + + # read file + reader = vtk.vtkStructuredGridReader() + reader.SetFileName(str(vtk_filename)) + reader.Update() + + # check name of datasets + vtk_grid = reader.GetOutput() + array = vtk_grid.GetCellData().GetArray(0) + vtk_data = nps.vtk_to_numpy(array) + + # convenience function for determining if a mesh + # element has vertices in the geometry. This + # particular geometry allows us to assume that tally results + # in the element should be zero if none of its vertices lie in the geometry + def in_geom(cell): + point_ids = cell.GetPointIds() + + for i in range(point_ids.GetNumberOfIds()): + p = vtk_grid.GetPoint(point_ids.GetId(i)) + if model.geometry.find(p): + return True + + return False + + # reshape mean according to mesh dimensions + mean = mean.reshape(mesh.dimension[::-1]).T + centroid = [0.0, 0.0, 0.0] + + # check that tally and vtk array results are zero where expected + for ijk in mesh.indices: + ijk = tuple(n - 1 for n in ijk) + # get the cell from the stuctured mesh object + cell = vtk_grid.GetCell(*ijk) + if not in_geom(cell): + cell.GetCentroid(centroid) + err_msg = f'IJK: {ijk} should be zero but is not. Centroid: {centroid}' + assert mean[ijk] == 0.0, err_msg + + # need to get flat index with axes reversed due to ordering passed into the VTK file + flat_idx = np.ravel_multi_index(tuple(ijk[::-1]), mesh.dimension[::-1]) + assert vtk_data[flat_idx] == 0.0, err_msg + +>>>>>>> 641319115 (Correcting spherical to cartesian coordinate conversion) From ae57ad0e5be45619f260a3cd3d3df911467ec628 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 6 Mar 2023 23:39:15 -0600 Subject: [PATCH 068/136] Improving test coverage for mesh to vtk capability --- tests/unit_tests/test_mesh_to_vtk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_mesh_to_vtk.py b/tests/unit_tests/test_mesh_to_vtk.py index 06a5606e7..22cdf1c1e 100644 --- a/tests/unit_tests/test_mesh_to_vtk.py +++ b/tests/unit_tests/test_mesh_to_vtk.py @@ -56,7 +56,7 @@ cylinder_mesh.z_grid = np.linspace(0, 1, 15) spherical_mesh = openmc.SphericalMesh() spherical_mesh.r_grid = np.linspace(1, 10, 30) -spherical_mesh.phi_grid = np.linspace(0, np.pi, 25) +spherical_mesh.phi_grid = np.linspace(0, 0.8*np.pi, 25) spherical_mesh.theta_grid = np.linspace(0, np.pi / 2, 15) MESHES = [cylinder_mesh, regular_mesh, rectilinear_mesh, spherical_mesh] From 285edc77b982e7abf9f89511ee2e82a59b686e53 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 8 Mar 2023 22:47:40 -0600 Subject: [PATCH 069/136] Corrections after rebase --- tests/unit_tests/test_mesh_to_vtk.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/unit_tests/test_mesh_to_vtk.py b/tests/unit_tests/test_mesh_to_vtk.py index 22cdf1c1e..80da85d97 100644 --- a/tests/unit_tests/test_mesh_to_vtk.py +++ b/tests/unit_tests/test_mesh_to_vtk.py @@ -142,7 +142,6 @@ def test_write_data_to_vtk_size_mismatch(mesh): with pytest.raises(ValueError, match=expected_error_msg): mesh.write_data_to_vtk(filename="out.vtk", datasets={"label": data}) -<<<<<<< HEAD def test_write_data_to_vtk_round_trip(run_in_tmpdir): cmesh = openmc.CylindricalMesh() cmesh.r_grid = (0.0, 1.0, 2.0) @@ -200,7 +199,6 @@ def test_write_data_to_vtk_round_trip(run_in_tmpdir): # checks that the vtk cell values are equal to the data assert np.array_equal(vtk_values, data) -======= def mesh_surf_id(param): @@ -277,5 +275,3 @@ def test_vtk_write_ordering(model, mesh, surface): # need to get flat index with axes reversed due to ordering passed into the VTK file flat_idx = np.ravel_multi_index(tuple(ijk[::-1]), mesh.dimension[::-1]) assert vtk_data[flat_idx] == 0.0, err_msg - ->>>>>>> 641319115 (Correcting spherical to cartesian coordinate conversion) From 2d20cd31f25c3949218dbb9a3a6350be5c961319 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Thu, 16 Mar 2023 14:37:05 -0500 Subject: [PATCH 070/136] initialize Discrete distribution with sequence of integers --- include/openmc/distribution.h | 1 + src/distribution.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/openmc/distribution.h b/include/openmc/distribution.h index 815ffa21a..86aa4a381 100644 --- a/include/openmc/distribution.h +++ b/include/openmc/distribution.h @@ -39,6 +39,7 @@ class Discrete : public Distribution { public: explicit Discrete(pugi::xml_node node); Discrete(const double* x, const double* p, int n); + Discrete(const double* p, int n); //! Sample a value from the distribution //! \param seed Pseudorandom number seed pointer diff --git a/src/distribution.cpp b/src/distribution.cpp index 4b4ebd69d..ce2a85705 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -41,6 +41,19 @@ Discrete::Discrete(const double* x, const double* p, int n) this->init_alias(x_vec, p_vec); } +Discrete::Discrete(const double* p, int n) +{ + std::vector p_vec(p, p + n); + std::vector x_vec(n); + + for (int i=0; iinit_alias(x_vec, p_vec); +} + void Discrete::init_alias(vector& x, vector& p) { x_ = x; From ee6975767d98f84133a0e4df3e443800a068fc32 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Thu, 16 Mar 2023 17:34:44 -0500 Subject: [PATCH 071/136] Use Discrete distribution for mesh sampling This version builds the independent variable by converting int to double and then converts back when sampling. --- include/openmc/distribution_spatial.h | 6 +----- src/distribution_spatial.cpp | 27 ++------------------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/include/openmc/distribution_spatial.h b/include/openmc/distribution_spatial.h index a8cc7c58e..63cbbb956 100644 --- a/include/openmc/distribution_spatial.h +++ b/include/openmc/distribution_spatial.h @@ -114,11 +114,7 @@ public: private: int32_t mesh_idx_ {C_NONE}; - double total_strength_ {0.0}; - // TODO: move to an independent class in the future that's similar - // to a discrete distribution without outcomes - std::vector mesh_CDF_; - std::vector mesh_strengths_; + UPtrDist elem_idx_; //!< Distribution of mesh element indices }; //============================================================================== diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index fb1fbf099..206f0b597 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -212,10 +212,6 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) int32_t n_bins = this->n_sources(); std::vector strengths(n_bins, 0.0); - mesh_CDF_.resize(n_bins + 1); - mesh_CDF_[0] = {0.0}; - total_strength_ = 0.0; - // Create cdfs for sampling for an element over a mesh // Volume scheme is weighted by the volume of each tet // File scheme is weighted by an array given in the xml file @@ -228,28 +224,9 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) "not match the number of entities in mesh {} ({}).", strengths.size(), mesh_id, n_bins)); } - mesh_strengths_ = std::move(strengths); + elem_idx_ = UPtrDist {new Discrete {strengths, n_bins}}; } - if (get_node_value_bool(node, "volume_normalized")) { - for (int i = 0; i < n_bins; i++) { - mesh_strengths_[i] *= mesh()->volume(i); - } - } - - total_strength_ = - std::accumulate(mesh_strengths_.begin(), mesh_strengths_.end(), 0.0); - - for (int i = 0; i < n_bins; i++) { - mesh_CDF_[i + 1] = mesh_CDF_[i] + mesh_strengths_[i] / total_strength_; - } - - if (fabs(mesh_CDF_.back() - 1.0) > FP_COINCIDENT) { - fatal_error( - fmt::format("Mesh sampling CDF is incorrectly formed. Final value is: {}", - mesh_CDF_.back())); - } - mesh_CDF_.back() = 1.0; } Position MeshSpatial::sample(uint64_t* seed) const @@ -257,7 +234,7 @@ Position MeshSpatial::sample(uint64_t* seed) const // Create random variable for sampling element from mesh double eta = prn(seed); // Sample over the CDF defined in initialization above - int32_t elem_idx = lower_bound_index(mesh_CDF_.begin(), mesh_CDF_.end(), eta); + int32_t elem_idx = elem_idx_->sample(eta); return mesh()->sample(seed, elem_idx); } From db92a64ec984b647fc71fcabb5c75288570d80a4 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Thu, 16 Mar 2023 17:51:41 -0500 Subject: [PATCH 072/136] rename variable for clarity; re-add volume normalization --- include/openmc/distribution_spatial.h | 2 +- src/distribution_spatial.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/openmc/distribution_spatial.h b/include/openmc/distribution_spatial.h index 63cbbb956..dc1d898fe 100644 --- a/include/openmc/distribution_spatial.h +++ b/include/openmc/distribution_spatial.h @@ -114,7 +114,7 @@ public: private: int32_t mesh_idx_ {C_NONE}; - UPtrDist elem_idx_; //!< Distribution of mesh element indices + UPtrDist elem_idx_dist_; //!< Distribution of mesh element indices }; //============================================================================== diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index 206f0b597..544734d3b 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -224,8 +224,15 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) "not match the number of entities in mesh {} ({}).", strengths.size(), mesh_id, n_bins)); } - elem_idx_ = UPtrDist {new Discrete {strengths, n_bins}}; } + + if (get_node_value_bool(node, "volume_normalized")) { + for (int i = 0; i < n_bins; i++) { + strengths[i] *= mesh()->volume(i); + } + } + + elem_idx_dist_ = UPtrDist {new Discrete {strengths, n_bins}}; } @@ -234,7 +241,7 @@ Position MeshSpatial::sample(uint64_t* seed) const // Create random variable for sampling element from mesh double eta = prn(seed); // Sample over the CDF defined in initialization above - int32_t elem_idx = elem_idx_->sample(eta); + int32_t elem_idx = elem_idx_dist_->sample(eta); return mesh()->sample(seed, elem_idx); } From 09d068fa81abeebd44994422437f44caa34331d5 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Thu, 16 Mar 2023 21:16:59 -0500 Subject: [PATCH 073/136] syntax fixes --- src/distribution_spatial.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index 544734d3b..7c5b2ed64 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -215,7 +215,6 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) // Create cdfs for sampling for an element over a mesh // Volume scheme is weighted by the volume of each tet // File scheme is weighted by an array given in the xml file - mesh_strengths_ = std::vector(n_bins, 1.0); if (check_for_node(node, "strengths")) { strengths = get_node_array(node, "strengths"); if (strengths.size() != n_bins) { @@ -232,16 +231,14 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) } } - elem_idx_dist_ = UPtrDist {new Discrete {strengths, n_bins}}; + elem_idx_dist_ = UPtrDist {new Discrete {strengths.data(), n_bins}}; } Position MeshSpatial::sample(uint64_t* seed) const { - // Create random variable for sampling element from mesh - double eta = prn(seed); // Sample over the CDF defined in initialization above - int32_t elem_idx = elem_idx_dist_->sample(eta); + int32_t elem_idx = elem_idx_dist_->sample(seed); return mesh()->sample(seed, elem_idx); } From 29b57486871f39fc28a9e336ffc98e64afacc561 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Fri, 17 Mar 2023 08:27:09 -0500 Subject: [PATCH 074/136] reduce temporary memory use for potentially large data --- include/openmc/distribution.h | 2 +- src/distribution.cpp | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/openmc/distribution.h b/include/openmc/distribution.h index 86aa4a381..34744b3e3 100644 --- a/include/openmc/distribution.h +++ b/include/openmc/distribution.h @@ -61,7 +61,7 @@ private: void normalize(); //! Initialize alias tables for distribution - void init_alias(vector& x, vector& p); + void init_alias(); }; //============================================================================== diff --git a/src/distribution.cpp b/src/distribution.cpp index ce2a85705..e2e113826 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -26,38 +26,38 @@ Discrete::Discrete(pugi::xml_node node) { auto params = get_node_array(node, "parameters"); - std::size_t n = params.size(); - std::vector x_vec(params.begin(), params.begin() + n / 2); - std::vector p_vec(params.begin() + n / 2, params.end()); + std::size_t n = params.size()/2; - this->init_alias(x_vec, p_vec); + x_.assign(params.begin(), params.begin() + n); + prob_.assign(params.begin() + n, params.end()); + + this->init_alias(); } Discrete::Discrete(const double* x, const double* p, int n) { - std::vector x_vec(x, x + n); - std::vector p_vec(p, p + n); + + x_.assign(x, x + n); + prob_.assign(p, p + n); - this->init_alias(x_vec, p_vec); + this->init_alias(); } Discrete::Discrete(const double* p, int n) { - std::vector p_vec(p, p + n); - std::vector x_vec(n); + prob_.assign(p, p + n); + x_.resize(n); for (int i=0; iinit_alias(x_vec, p_vec); + this->init_alias(); } -void Discrete::init_alias(vector& x, vector& p) +void Discrete::init_alias() { - x_ = x; - prob_ = p; normalize(); // The initialization and sampling method is based on Vose From b20dda710b36798d078559fac4eee16c9cdfe6cd Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Fri, 17 Mar 2023 12:58:53 -0500 Subject: [PATCH 075/136] change initialization of strengths --- src/distribution_spatial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index 7c5b2ed64..8060527a8 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -210,7 +210,7 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) } int32_t n_bins = this->n_sources(); - std::vector strengths(n_bins, 0.0); + std::vector strengths(n_bins, 1.0); // Create cdfs for sampling for an element over a mesh // Volume scheme is weighted by the volume of each tet From 487f02dd1dddfa09e51a3a2b78b70947aafec1be Mon Sep 17 00:00:00 2001 From: guyshtot Date: Tue, 21 Mar 2023 13:18:24 +0200 Subject: [PATCH 076/136] Add option to specify nuclides in the Library class --- openmc/mgxs/library.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index efe8dbe84..063134f7a 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -72,6 +72,11 @@ class Library: Number of equi-width polar angle bins for angle discretization num_azimuthal : Integral Number of equi-width azimuthal angle bins for angle discretization + nuclides : Iterable of str or 'sum' + The optional user-specified nuclides for which to compute cross + sections (e.g., 'U238', 'O16'). If by_nuclide is True but nuclides + are not specified by the user, all nuclides in the domain + are included. estimator : str or None The tally estimator used to compute multi-group cross sections. If None, the default for each MGXS type is used. @@ -107,6 +112,7 @@ class Library: self._energy_groups = None self._num_polar = 1 self._num_azimuthal = 1 + self._nuclides = None self._num_delayed_groups = 0 self._correction = 'P0' self._scatter_format = 'legendre' @@ -145,6 +151,7 @@ class Library: clone._energy_groups = copy.deepcopy(self.energy_groups, memo) clone._num_polar = self.num_polar clone._num_azimuthal = self.num_azimuthal + clone._nuclides = self._nuclides clone._num_delayed_groups = self.num_delayed_groups clone._tally_trigger = copy.deepcopy(self.tally_trigger, memo) clone._all_mgxs = copy.deepcopy(self.all_mgxs) @@ -206,6 +213,14 @@ class Library: return self._domains @property + def nuclides(self): + if self.by_nuclide and self._nuclides: + return self._nuclides + elif self.by_nuclide: + raise ValueError("Nuclides weren't defined") + else: + return 'sum' + @property def energy_groups(self): return self._energy_groups @@ -275,6 +290,11 @@ class Library: cv.check_type('name', name, str) self._name = name + @nuclides.setter + def nuclides(self, nuclides): + cv.check_type('nuclides', nuclides, str) + self._nuclides = nuclides + @mgxs_types.setter def mgxs_types(self, mgxs_types): all_mgxs_types = openmc.mgxs.MGXS_TYPES + openmc.mgxs.MDGXS_TYPES + \ @@ -524,6 +544,18 @@ class Library: mgxs.legendre_order = self.legendre_order mgxs.histogram_bins = self.histogram_bins + if self.by_nuclide: + try: + domain_nuclides = domain.get_nuclides() + except AttributeError: + domain_nuclides = None + if self._nuclides: + if domain_nuclides: + mgxs.nuclides = [nuclide for nuclide in self.nuclides if nuclide in domain_nuclides] + [ + "total"] + else: + mgxs.nuclides = self._nuclides + self.all_mgxs[domain.id][mgxs_type] = mgxs def add_to_tallies_file(self, tallies_file, merge=True): From b3c7472c77b0f496a0a63e2a95af147e3f221030 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 21 Mar 2023 07:14:07 -0500 Subject: [PATCH 077/136] Add Python 3.11 to CI matrix --- .github/workflows/ci.yml | 17 ++++++++++------- setup.py | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 999dea312..4ec3e7d8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.11"] mpi: [n, y] omp: [n, y] dagmc: [n] @@ -44,28 +44,31 @@ jobs: - python-version: 3.9 omp: n mpi: n + - python-version: 3.10 + omp: n + mpi: n - dagmc: y - python-version: "3.10" + python-version: "3.11" mpi: y omp: y - ncrystal: y - python-version: "3.10" + python-version: "3.11" mpi: n omp: n - libmesh: y - python-version: "3.10" + python-version: "3.11" mpi: y omp: y - libmesh: y - python-version: "3.10" + python-version: "3.11" mpi: n omp: y - event: y - python-version: "3.10" + python-version: "3.11" omp: y mpi: n - vectfit: y - python-version: "3.10" + python-version: "3.11" omp: n mpi: y name: "Python ${{ matrix.python-version }} (omp=${{ matrix.omp }}, diff --git a/setup.py b/setup.py index a9e863da2..29c129d7b 100755 --- a/setup.py +++ b/setup.py @@ -58,6 +58,7 @@ kwargs = { 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], # Dependencies From 354fd34c2c5dd1fa6d47dcff623089d87128e5ca Mon Sep 17 00:00:00 2001 From: guyshtot Date: Tue, 21 Mar 2023 14:59:01 +0200 Subject: [PATCH 078/136] Renamed previous use of _nuclides to _atomic_weight_ratios in the library class --- openmc/mgxs/library.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 063134f7a..0eb00c8f1 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -214,12 +214,8 @@ class Library: @property def nuclides(self): - if self.by_nuclide and self._nuclides: - return self._nuclides - elif self.by_nuclide: - raise ValueError("Nuclides weren't defined") - else: - return 'sum' + return self._nuclides + @property def energy_groups(self): return self._energy_groups @@ -292,7 +288,7 @@ class Library: @nuclides.setter def nuclides(self, nuclides): - cv.check_type('nuclides', nuclides, str) + cv.check_iterable_type('nuclides', nuclides, str) self._nuclides = nuclides @mgxs_types.setter @@ -549,12 +545,12 @@ class Library: domain_nuclides = domain.get_nuclides() except AttributeError: domain_nuclides = None - if self._nuclides: + if self.nuclides: if domain_nuclides: mgxs.nuclides = [nuclide for nuclide in self.nuclides if nuclide in domain_nuclides] + [ "total"] else: - mgxs.nuclides = self._nuclides + mgxs.nuclides = self.nuclides self.all_mgxs[domain.id][mgxs_type] = mgxs @@ -622,7 +618,7 @@ class Library: self._sp_filename = statepoint._f.filename self._geometry = statepoint.summary.geometry - self._nuclides = statepoint.summary.nuclides + self._atomic_weight_ratios = statepoint.summary.nuclides if statepoint.run_mode == 'eigenvalue': self._keff = statepoint.keff.n @@ -1037,7 +1033,7 @@ class Library: xsdata.num_azimuthal = self.num_azimuthal if nuclide != 'total': - xsdata.atomic_weight_ratio = self._nuclides[nuclide] + xsdata.atomic_weight_ratio = self._atomic_weight_ratios[nuclide] if subdomain is None: subdomain = 'all' From 3032ad7f3705468a40a0a4b2b7ef0ba3995dd2bb Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 21 Mar 2023 09:37:39 -0500 Subject: [PATCH 079/136] Stick with 3.10 as default, add single 3.11 job --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ec3e7d8b..82bd70a62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.11"] + python-version: ["3.10"] mpi: [n, y] omp: [n, y] dagmc: [n] @@ -44,31 +44,31 @@ jobs: - python-version: 3.9 omp: n mpi: n - - python-version: 3.10 + - python-version: "3.11" omp: n mpi: n - dagmc: y - python-version: "3.11" + python-version: "3.10" mpi: y omp: y - ncrystal: y - python-version: "3.11" + python-version: "3.10" mpi: n omp: n - libmesh: y - python-version: "3.11" + python-version: "3.10" mpi: y omp: y - libmesh: y - python-version: "3.11" + python-version: "3.10" mpi: n omp: y - event: y - python-version: "3.11" + python-version: "3.10" omp: y mpi: n - vectfit: y - python-version: "3.11" + python-version: "3.10" omp: n mpi: y name: "Python ${{ matrix.python-version }} (omp=${{ matrix.omp }}, From cf8d9ef313d2a58fd52705d4c48e203143c98a20 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 21 Mar 2023 13:15:28 -0500 Subject: [PATCH 080/136] Handle zero photon cross sections in IncidentPhoton.from_ace properly --- openmc/data/photon.py | 9 ++++++--- src/photon.cpp | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/openmc/data/photon.py b/openmc/data/photon.py index fc5da19eb..e83ff844d 100644 --- a/openmc/data/photon.py +++ b/openmc/data/photon.py @@ -514,13 +514,13 @@ class IncidentPhoton(EqualityMixin): # Read each reaction data = cls(Z) - for mt in (502, 504, 515, 522, 525): + for mt in (502, 504, 517, 522, 525): data.reactions[mt] = PhotonReaction.from_ace(ace, mt) # Get heating cross sections [eV-barn] from factors [eV per collision] # by multiplying with total xs data.reactions[525].xs.y *= sum([data.reactions[mt].xs.y for mt in - (502, 504, 515, 522)]) + (502, 504, 517, 522)]) # Compton profiles n_shell = ace.nxs[5] @@ -1000,7 +1000,7 @@ class PhotonReaction(EqualityMixin): elif mt == 504: # Incoherent scattering idx = ace.jxs[1] + n - elif mt == 515: + elif mt == 517: # Pair production idx = ace.jxs[1] + 4*n elif mt == 522: @@ -1021,6 +1021,9 @@ class PhotonReaction(EqualityMixin): else: nonzero = (xs != 0.0) xs[nonzero] = np.exp(xs[nonzero]) + + # Replace zero elements to small non-zero to enable log-log + xs[~nonzero] = np.exp(-500.0) rx.xs = Tabulated1D(energy, xs, [n], [5]) # Get form factors for incoherent/coherent scattering diff --git a/src/photon.cpp b/src/photon.cpp index c4beff019..08062a2e9 100644 --- a/src/photon.cpp +++ b/src/photon.cpp @@ -91,9 +91,13 @@ PhotonInteraction::PhotonInteraction(hid_t group) close_group(rgroup); // Read pair production - rgroup = open_group(group, "pair_production_electron"); - read_dataset(rgroup, "xs", pair_production_electron_); - close_group(rgroup); + if (object_exists(group, "pair_production_electron")) { + rgroup = open_group(group, "pair_production_electron"); + read_dataset(rgroup, "xs", pair_production_electron_); + close_group(rgroup); + } else { + pair_production_electron_ = xt::zeros_like(energy_); + } // Read pair production if (object_exists(group, "pair_production_nuclear")) { From bb5f727f85325cc2d4e94d00b1940c9d744dd568 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 21 Mar 2023 13:48:22 -0500 Subject: [PATCH 081/136] Update IO format docs for meshes --- docs/source/io_formats/statepoint.rst | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/source/io_formats/statepoint.rst b/docs/source/io_formats/statepoint.rst index c0db5ea92..09b1b1144 100644 --- a/docs/source/io_formats/statepoint.rst +++ b/docs/source/io_formats/statepoint.rst @@ -72,12 +72,17 @@ The current version of the statepoint file format is 17.0. :Datasets: - **type** (*char[]*) -- Type of mesh. - **dimension** (*int*) -- Number of mesh cells in each dimension. - - **lower_left** (*double[]*) -- Coordinates of lower-left corner of - mesh. - - **upper_right** (*double[]*) -- Coordinates of upper-right corner - of mesh. - - **width** (*double[]*) -- Width of each mesh cell in each - dimension. + - **Regular Mesh Only:** + - **lower_left** (*double[]*) -- Coordinates of lower-left corner of + mesh. + - **upper_right** (*double[]*) -- Coordinates of upper-right corner + of mesh. + - **width** (*double[]*) -- Width of each mesh cell in each + dimension. + - **Rectilinear Mesh Only:** + - **x_grid** (*double[]*) -- Mesh divisions along the x-axis. + - **y_grid** (*double[]*) -- Mesh divisions along the y-axis. + - **z_grid** (*double[]*) -- Mesh divisions along the z-axis. - **Cylindrical & Spherical Mesh Only:** - **r_grid** (*double[]*) -- The mesh divisions along the r-axis. - **phi_grid** (*double[]*) -- The mesh divisions along the phi-axis. From 38ca9b2f7cfdc71091d02b6bfe47ca19db33964d Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Tue, 21 Mar 2023 15:43:43 -0400 Subject: [PATCH 082/136] clang format fixes --- src/distribution.cpp | 7 +++---- src/distribution_spatial.cpp | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/distribution.cpp b/src/distribution.cpp index e2e113826..0dac7af36 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -26,7 +26,7 @@ Discrete::Discrete(pugi::xml_node node) { auto params = get_node_array(node, "parameters"); - std::size_t n = params.size()/2; + std::size_t n = params.size() / 2; x_.assign(params.begin(), params.begin() + n); prob_.assign(params.begin() + n, params.end()); @@ -36,7 +36,7 @@ Discrete::Discrete(pugi::xml_node node) Discrete::Discrete(const double* x, const double* p, int n) { - + x_.assign(x, x + n); prob_.assign(p, p + n); @@ -48,8 +48,7 @@ Discrete::Discrete(const double* p, int n) prob_.assign(p, p + n); x_.resize(n); - for (int i=0; ivolume(i); } } elem_idx_dist_ = UPtrDist {new Discrete {strengths.data(), n_bins}}; - } Position MeshSpatial::sample(uint64_t* seed) const From 9b708e7ad47292a73455e26dda134ea0c6086625 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 21 Mar 2023 14:55:42 -0500 Subject: [PATCH 083/136] Apply suggestions from @paulromano Co-authored-by: Paul Romano --- tests/unit_tests/test_mesh_to_vtk.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/unit_tests/test_mesh_to_vtk.py b/tests/unit_tests/test_mesh_to_vtk.py index 80da85d97..4c0a43877 100644 --- a/tests/unit_tests/test_mesh_to_vtk.py +++ b/tests/unit_tests/test_mesh_to_vtk.py @@ -59,7 +59,7 @@ spherical_mesh.r_grid = np.linspace(1, 10, 30) spherical_mesh.phi_grid = np.linspace(0, 0.8*np.pi, 25) spherical_mesh.theta_grid = np.linspace(0, np.pi / 2, 15) -MESHES = [cylinder_mesh, regular_mesh, rectilinear_mesh, spherical_mesh] +MESHES = [cylinder_mesh, regular_mesh, rectilinear_mesh, spherical_mesh] x_plane = openmc.XPlane(x0=-0.001, boundary_type='vacuum') y_plane = openmc.YPlane(y0=-0.001, boundary_type='vacuum') @@ -201,11 +201,9 @@ def test_write_data_to_vtk_round_trip(run_in_tmpdir): assert np.array_equal(vtk_values, data) def mesh_surf_id(param): - if isinstance(param, openmc.MeshBase): return ids(param) - - if isinstance(param, openmc.XPlane): + elif isinstance(param, openmc.XPlane): return 'XPlane' elif isinstance(param, openmc.YPlane): return 'YPlane' From 1d9446a065f6cc5be06c614624c6c157fba44a9e Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Tue, 21 Mar 2023 16:14:38 -0400 Subject: [PATCH 084/136] introduce method to sample discrete index and use in various places --- include/openmc/distribution.h | 34 ++++++++++--- include/openmc/distribution_spatial.h | 3 +- src/distribution.cpp | 72 +++++++++++++++------------ src/distribution_spatial.cpp | 2 +- 4 files changed, 71 insertions(+), 40 deletions(-) diff --git a/include/openmc/distribution.h b/include/openmc/distribution.h index 34744b3e3..2e210b7ab 100644 --- a/include/openmc/distribution.h +++ b/include/openmc/distribution.h @@ -32,27 +32,24 @@ using UPtrDist = unique_ptr; UPtrDist distribution_from_xml(pugi::xml_node node); //============================================================================== -//! A discrete distribution (probability mass function) +//! A discrete distribution index (probability mass function) //============================================================================== -class Discrete : public Distribution { +class DiscreteIndex { public: explicit Discrete(pugi::xml_node node); - Discrete(const double* x, const double* p, int n); Discrete(const double* p, int n); //! Sample a value from the distribution //! \param seed Pseudorandom number seed pointer //! \return Sampled value - double sample(uint64_t* seed) const override; + size_t sample(uint64_t* seed) const override; // Properties - const vector& x() const { return x_; } const vector& prob() const { return prob_; } const vector& alias() const { return alias_; } private: - vector x_; //!< Possible outcomes vector prob_; //!< Probability of accepting the uniformly sampled bin, //!< mapped to alias method table vector alias_; //!< Alias table @@ -64,6 +61,31 @@ private: void init_alias(); }; +//============================================================================== +//! A discrete distribution (probability mass function) +//============================================================================== + +class Discrete : public Distribution { +public: + explicit Discrete(pugi::xml_node node); + Discrete(const double* x, const double* p, int n); + + //! Sample a value from the distribution + //! \param seed Pseudorandom number seed pointer + //! \return Sampled value + double sample(uint64_t* seed) const override; + + // Properties + const vector& x() const { return x_; } + const vector& prob() const { return di_->prob(); } + const vector& alias() const { return di_->alias(); } + +private: + vector x_; //!< Possible outcomes + unique_ptr di_; //!< discrete probability distribution of + //!< outcome indices +}; + //============================================================================== //! Uniform distribution over the interval [a,b] //============================================================================== diff --git a/include/openmc/distribution_spatial.h b/include/openmc/distribution_spatial.h index dc1d898fe..9ca9c0684 100644 --- a/include/openmc/distribution_spatial.h +++ b/include/openmc/distribution_spatial.h @@ -114,7 +114,8 @@ public: private: int32_t mesh_idx_ {C_NONE}; - UPtrDist elem_idx_dist_; //!< Distribution of mesh element indices + unique_ptr elem_idx_dist_; //!< Distribution of + //!< mesh element indices }; //============================================================================== diff --git a/src/distribution.cpp b/src/distribution.cpp index 0dac7af36..2378cf117 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -19,43 +19,26 @@ namespace openmc { //============================================================================== -// Discrete implementation +// DiscreteIndex implementation //============================================================================== -Discrete::Discrete(pugi::xml_node node) +DiscreteIndex::DiscreteIndex(pugi::xml_node node) { auto params = get_node_array(node, "parameters"); - std::size_t n = params.size() / 2; - - x_.assign(params.begin(), params.begin() + n); - prob_.assign(params.begin() + n, params.end()); + prob_.assign(params.begin(), params.end()); this->init_alias(); } -Discrete::Discrete(const double* x, const double* p, int n) -{ - - x_.assign(x, x + n); - prob_.assign(p, p + n); - - this->init_alias(); -} - -Discrete::Discrete(const double* p, int n) +DiscreteIndex::DiscreteIndex(const double* p, int n) { prob_.assign(p, p + n); - x_.resize(n); - - for (int i = 0; i < n; i++) { - x_[i] = i; - } this->init_alias(); } -void Discrete::init_alias() +void DiscreteIndex::init_alias() { normalize(); @@ -66,12 +49,11 @@ void Discrete::init_alias() vector small; // Set and allocate memory - vector alias(x_.size(), 0); - alias_ = alias; + alias_.assign(prob_.size(), 0); // Fill large and small vectors based on 1/n - for (size_t i = 0; i < x_.size(); i++) { - prob_[i] *= x_.size(); + for (size_t i = 0; i < prob_.size(); i++) { + prob_[i] *= prob_.size(); if (prob_[i] > 1.0) { large.push_back(i); } else { @@ -98,23 +80,23 @@ void Discrete::init_alias() } } -double Discrete::sample(uint64_t* seed) const +size_t DiscreteIndex::sample(uint64_t* seed) const { // Alias sampling of discrete distribution - int n = x_.size(); + int n = prob_.size(); if (n > 1) { int u = prn(seed) * n; if (prn(seed) < prob_[u]) { - return x_[u]; + return u; } else { - return x_[alias_[u]]; + return alias_[u]; } } else { - return x_[0]; + return 0; } } -void Discrete::normalize() +void DiscreteIndex::normalize() { // Renormalize density function so that it sums to unity double norm = std::accumulate(prob_.begin(), prob_.end(), 0.0); @@ -123,6 +105,32 @@ void Discrete::normalize() } } +//============================================================================== +// Discrete implementation +//============================================================================== + +Discrete::Discrete(pugi::xml_node node) +{ + auto params = get_node_array(node, "parameters"); + + std::size_t n = params.size() / 2; + + x_.assign(params.begin(), params.begin() + n); + di_ = new DiscreteIndex(params.begin() + n, n) +} + +Discrete::Discrete(const double* x, const double* p, int n) +{ + + x_.assign(x, x + n); + di_ = new DiscreteIndex(params.begin() + n, n) +} + +double Discrete::sample(uint64_t* seed) const +{ + return x_[di_->sample(seed)]; +} + //============================================================================== // Uniform implementation //============================================================================== diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index 272f9d941..c2d370b17 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -231,7 +231,7 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) } } - elem_idx_dist_ = UPtrDist {new Discrete {strengths.data(), n_bins}}; + elem_idx_dist_ = make_unique(strengths.data(), n_bins); } Position MeshSpatial::sample(uint64_t* seed) const From 60c3f2a9d56137ad1348768ad81126346b3555e9 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Tue, 21 Mar 2023 16:36:33 -0400 Subject: [PATCH 085/136] type consistency and storing size as local --- src/distribution.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/distribution.cpp b/src/distribution.cpp index 2378cf117..2066e5a8c 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -48,12 +48,14 @@ void DiscreteIndex::init_alias() vector large; vector small; + size_t n = prob_.size(); + // Set and allocate memory - alias_.assign(prob_.size(), 0); + alias_.assign(n, 0); // Fill large and small vectors based on 1/n - for (size_t i = 0; i < prob_.size(); i++) { - prob_[i] *= prob_.size(); + for (size_t i = 0; i < n; i++) { + prob_[i] *= n; if (prob_[i] > 1.0) { large.push_back(i); } else { @@ -83,9 +85,9 @@ void DiscreteIndex::init_alias() size_t DiscreteIndex::sample(uint64_t* seed) const { // Alias sampling of discrete distribution - int n = prob_.size(); + size_t n = prob_.size(); if (n > 1) { - int u = prn(seed) * n; + size_t u = prn(seed) * n; if (prn(seed) < prob_[u]) { return u; } else { From 17e9918f5d33188f5882559b073fee72dce3e195 Mon Sep 17 00:00:00 2001 From: shimwell Date: Tue, 21 Mar 2023 21:51:40 +0000 Subject: [PATCH 086/136] removed most deprecated types --- openmc/plotter.py | 127 +++++++++++++------------------ tests/unit_tests/test_plotter.py | 4 +- 2 files changed, 55 insertions(+), 76 deletions(-) diff --git a/openmc/plotter.py b/openmc/plotter.py index 541b05f0b..2bdcfe351 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -53,6 +53,9 @@ _MIN_E = 1.e-5 _MAX_E = 20.e6 +ELEMENT_NAMES = list(openmc.data.ELEMENT_SYMBOL.values())[1:] + + def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, sab_name=None, ce_cross_sections=None, mg_cross_sections=None, enrichment=None, plot_CE=True, orders=None, divisor_orders=None): @@ -60,7 +63,7 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, Parameters ---------- - this : {str, openmc.Nuclide, openmc.Element, openmc.Macroscopic, openmc.Material} + this : {str, openmc.Material} Object to source data from. Nuclides and Elements can be input as a str types : Iterable of values of PLOT_TYPES The type of cross sections to include in the plot. @@ -77,16 +80,14 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, A previously generated axis to use for plotting. If not specified, a new axis and figure will be generated. sab_name : str, optional - Name of S(a,b) library to apply to MT=2 data when applicable; only used - for items which are instances of openmc.Element or openmc.Nuclide + Name of S(a,b) library to apply to MT=2 data when applicable. ce_cross_sections : str, optional Location of cross_sections.xml file. Default is None. mg_cross_sections : str, optional Location of MGXS HDF5 Library file. Default is None. enrichment : float, optional Enrichment for U235 in weight percent. For example, input 4.95 for - 4.95 weight percent enriched U. Default is None. This is only used for - items which are instances of openmc.Element + 4.95 weight percent enriched U. Default is None. plot_CE : bool, optional Denotes whether or not continuous-energy will be plotted. Defaults to plotting the continuous-energy data. @@ -110,7 +111,7 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, import matplotlib.pyplot as plt cv.check_type("plot_CE", plot_CE, bool) - cv.check_type("this", this, (str, openmc.Nuclide, openmc.Element, openmc.Material)) + cv.check_type("this", this, (str, openmc.Material)) if plot_CE: # Calculate for the CE cross sections @@ -179,28 +180,23 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, else: ax.set_xlim(E[-1], E[0]) - if isinstance(this, str): - # first entry in ELEMENT_SYMBOL is a neutron, the 1 removes this entry - if this in list(openmc.data.ELEMENT_SYMBOL.values())[1:]: - this = openmc.Element(this) - else: - this = openmc.Nuclide(this) - if divisor_types: - if isinstance(this, openmc.Nuclide): - ylabel = 'Nuclidic Microscopic Data' - elif isinstance(this, openmc.Element): - ylabel = 'Elemental Microscopic Data' - elif isinstance(this, openmc.Material) or isinstance(this, openmc.Macroscopic): + if isinstance(this, str): + if this in ELEMENT_NAMES: + ylabel = 'Elemental Microscopic Data' + else: + ylabel = 'Nuclide Microscopic Data' + elif isinstance(this, openmc.Material): ylabel = 'Macroscopic Data' else: raise TypeError("Invalid type for plotting") else: - if isinstance(this, openmc.Nuclide): - ylabel = 'Microscopic Cross Section [b]' - elif isinstance(this, openmc.Element): - ylabel = 'Elemental Cross Section [b]' - elif isinstance(this, openmc.Material) or isinstance(this, openmc.Macroscopic): + if isinstance(this, str): + if this in ELEMENT_NAMES: + ylabel = 'Elemental Cross Section [b]' + else: + ylabel = 'Microscopic Cross Section [b]' + elif isinstance(this, openmc.Material): ylabel = 'Macroscopic Cross Section [1/cm]' else: raise TypeError("Invalid type for plotting") @@ -221,8 +217,9 @@ def calculate_cexs(this, types, temperature=294., sab_name=None, Parameters ---------- - this : {str, openmc.Nuclide, openmc.Element, openmc.Material} - Object to source data from. Nuclides and Elements can be input as a str + this : {str, openmc.Material} + Object to source data from. Nuclides and Elements should be input as a + str types : Iterable of values of PLOT_TYPES The type of cross sections to calculate temperature : float, optional @@ -249,44 +246,37 @@ def calculate_cexs(this, types, temperature=294., sab_name=None, """ # Check types - cv.check_type('this', this, (str, openmc.Nuclide, openmc.Element, openmc.Material)) + cv.check_type('this', this, (str, openmc.Material)) cv.check_type('temperature', temperature, Real) if sab_name: cv.check_type('sab_name', sab_name, str) if enrichment: cv.check_type('enrichment', enrichment, Real) - # this is a nuclide or element if it is a string if isinstance(this, str): - # first entry in ELEMENT_SYMBOL is a neutron, the 1 removes this entry - if this in list(openmc.data.ELEMENT_SYMBOL.values())[1:]: - this = openmc.Element(this) + if this in ELEMENT_NAMES: + energy_grid, data = _calculate_cexs_elem_mat( + this, types, temperature, cross_sections, sab_name, enrichment + ) + else: - this = openmc.Nuclide(this) + energy_grid, xs = _calculate_cexs_nuclide( + this, types, temperature, sab_name, cross_sections + ) - if isinstance(this, openmc.Nuclide): - energy_grid, xs = _calculate_cexs_nuclide(this, types, temperature, - sab_name, cross_sections) - - # Convert xs (Iterable of Callable) to a grid of cross section values - # calculated on the points in energy_grid for consistency with the - # element and material functions. - data = np.zeros((len(types), len(energy_grid))) - for line in range(len(types)): - data[line, :] = xs[line](energy_grid) - - elif isinstance(this, openmc.Element): - energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature, - cross_sections, sab_name, - enrichment) + # Convert xs (Iterable of Callable) to a grid of cross section values + # calculated on the points in energy_grid for consistency with the + # element and material functions. + data = np.zeros((len(types), len(energy_grid))) + for line in range(len(types)): + data[line, :] = xs[line](energy_grid) elif isinstance(this, openmc.Material): energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature, cross_sections) else: msg = ( - f"{this} is an invalid type, acceptable types are str, " - "openmc.Nuclide, openmc.Element, openmc.Material." + f"{this} is an invalid type, acceptable types are str, openmc.Material." ) raise TypeError(msg) @@ -299,7 +289,7 @@ def _calculate_cexs_nuclide(this, types, temperature=294., sab_name=None, Parameters ---------- - this : openmc.Nuclide + this : str Nuclide object to source data from types : Iterable of str or Integral The type of cross sections to calculate; values can either be those @@ -496,8 +486,8 @@ def _calculate_cexs_elem_mat(this, types, temperature=294., Parameters ---------- - this : openmc.Material or openmc.Element - Object to source data from + this : openmc.Material or str + Object to source data from. Element can be input as str types : Iterable of values of PLOT_TYPES The type of cross sections to calculate temperature : float, optional @@ -538,18 +528,16 @@ def _calculate_cexs_elem_mat(this, types, temperature=294., # Expand elements in to nuclides with atomic densities nuc_fractions = this.get_nuclide_atom_densities() # Create a dict of [nuclide name] = nuclide object to carry forward - # with a common nuclides format between openmc.Material and - # openmc.Element objects + # with a common nuclides format between openmc.Material and Elements nuclides = {nuclide: nuclide for nuclide in nuc_fractions} else: # Expand elements in to nuclides with atomic densities - nuclides = this.expand(1., 'ao', enrichment=enrichment, + nuclides = openmc.Element(this).expand(1., 'ao', enrichment=enrichment, cross_sections=cross_sections) # For ease of processing split out the nuclide and its fraction nuc_fractions = {nuclide[0]: nuclide[1] for nuclide in nuclides} # Create a dict of [nuclide name] = nuclide object to carry forward - # with a common nuclides format between openmc.Material and - # openmc.Element objects + # with a common nuclides format between openmc.Material and Elements nuclides = {nuclide[0]: nuclide[0] for nuclide in nuclides} # Identify the nuclides which have S(a,b) data @@ -615,7 +603,7 @@ def calculate_mgxs(this, types, orders=None, temperature=294., Parameters ---------- - this : {str, openmc.Nuclide, openmc.Element, openmc.Macroscopic, openmc.Material} + this : {str, openmc.Material} Object to source data from. Nuclides and Elements can be input as a str types : Iterable of values of PLOT_TYPES_MGXS The type of cross sections to calculate @@ -632,7 +620,6 @@ def calculate_mgxs(this, types, orders=None, temperature=294., Location of MGXS HDF5 Library file. Default is None. ce_cross_sections : str, optional Location of continuous-energy cross_sections.xml file. Default is None. - This is used only for expanding an openmc.Element object passed as this enrichment : float, optional Enrichment for U235 in weight percent. For example, input 4.95 for 4.95 weight percent enriched U. Default is None @@ -656,21 +643,13 @@ def calculate_mgxs(this, types, orders=None, temperature=294., cv.check_type("cross_sections", cross_sections, str) library = openmc.MGXSLibrary.from_hdf5(cross_sections) - # this is a nuclide or element if it is a string - if isinstance(this, str): - # first entry in ELEMENT_SYMBOL is a neutron, the 1 removes this entry - if this in list(openmc.data.ELEMENT_SYMBOL.values())[1:]: - this = openmc.Element(this) - else: - this = openmc.Nuclide(this) - - if isinstance(this, openmc.Nuclide) or isinstance(this, openmc.Macroscopic): - mgxs = _calculate_mgxs_nuc_macro(this, types, library, orders, - temperature) - elif isinstance(this, openmc.Element) or isinstance(this, openmc.Material): + if this in ELEMENT_NAMES or isinstance(this, openmc.Material): mgxs = _calculate_mgxs_elem_mat(this, types, library, orders, temperature, ce_cross_sections, enrichment) + elif isinstance(this, str): + mgxs = _calculate_mgxs_nuc_macro(this, types, library, orders, + temperature) else: raise TypeError("Invalid type") @@ -702,7 +681,7 @@ def _calculate_mgxs_nuc_macro(this, types, library, orders=None, Parameters ---------- - this : openmc.Nuclide or openmc.Macroscopic + this : str Object to source data from types : Iterable of str The type of cross sections to calculate; values can either be those @@ -840,8 +819,8 @@ def _calculate_mgxs_elem_mat(this, types, library, orders=None, Parameters ---------- - this : openmc.Element or openmc.Material - Object to source data from + this : str or openmc.Material + Object to source data from. Elements can be input as a str types : Iterable of str The type of cross sections to calculate; values can either be those in openmc.PLOT_TYPES_MGXS @@ -890,7 +869,7 @@ def _calculate_mgxs_elem_mat(this, types, library, orders=None, else: T = temperature # Expand elements in to nuclides with atomic densities - nuclides = this.expand(100., 'ao', enrichment=enrichment, + nuclides = openmc.Element(this).expand(100., 'ao', enrichment=enrichment, cross_sections=ce_cross_sections) # For ease of processing split out nuc and nuc_fractions diff --git a/tests/unit_tests/test_plotter.py b/tests/unit_tests/test_plotter.py index f7c731f1d..cabf9af6d 100644 --- a/tests/unit_tests/test_plotter.py +++ b/tests/unit_tests/test_plotter.py @@ -32,7 +32,7 @@ def test_calculate_cexs_elem_mat_sab(test_mat): assert len(data[0]) == len(energy_grid) -@pytest.mark.parametrize("this", ["Li", "Li6", openmc.Nuclide('Li6'), openmc.Element('Li')]) +@pytest.mark.parametrize("this", ["Li", "Li6"]) def test_calculate_cexs_with_nuclide_and_element(this): # single type (reaction) energy_grid, data = openmc.plotter.calculate_cexs( @@ -72,7 +72,7 @@ def test_calculate_cexs_with_materials(test_mat): assert len(data[0]) == len(energy_grid) -@pytest.mark.parametrize("this", ["Be", "Be9", openmc.Nuclide('Be9'), openmc.Element('Be')]) +@pytest.mark.parametrize("this", ["Be", "Be9"]) def test_plot_xs(this): assert isinstance(openmc.plotter.plot_xs(this, types=['total']), Figure) From 035e6dc45aee946976f30216be69371fd02aee21 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Wed, 22 Mar 2023 00:25:04 -0400 Subject: [PATCH 087/136] change to instance from pointer and cleanup lazy mistakes --- include/openmc/distribution.h | 14 ++++++++------ include/openmc/distribution_spatial.h | 4 ++-- src/distribution.cpp | 16 +++++++++++----- src/distribution_spatial.cpp | 2 +- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/include/openmc/distribution.h b/include/openmc/distribution.h index 2e210b7ab..b7d0e4721 100644 --- a/include/openmc/distribution.h +++ b/include/openmc/distribution.h @@ -37,13 +37,15 @@ UPtrDist distribution_from_xml(pugi::xml_node node); class DiscreteIndex { public: - explicit Discrete(pugi::xml_node node); - Discrete(const double* p, int n); + explicit DiscreteIndex(pugi::xml_node node); + DiscreteIndex(const double* p, int n); + + void assign(const double* p, int n); //! Sample a value from the distribution //! \param seed Pseudorandom number seed pointer //! \return Sampled value - size_t sample(uint64_t* seed) const override; + size_t sample(uint64_t* seed) const; // Properties const vector& prob() const { return prob_; } @@ -81,9 +83,9 @@ public: const vector& alias() const { return di_->alias(); } private: - vector x_; //!< Possible outcomes - unique_ptr di_; //!< discrete probability distribution of - //!< outcome indices + vector x_; //!< Possible outcomes + DiscreteIndex di_; //!< discrete probability distribution of + //!< outcome indices }; //============================================================================== diff --git a/include/openmc/distribution_spatial.h b/include/openmc/distribution_spatial.h index 9ca9c0684..9fba95060 100644 --- a/include/openmc/distribution_spatial.h +++ b/include/openmc/distribution_spatial.h @@ -114,8 +114,8 @@ public: private: int32_t mesh_idx_ {C_NONE}; - unique_ptr elem_idx_dist_; //!< Distribution of - //!< mesh element indices + DiscreteIndex elem_idx_dist_; //!< Distribution of + //!< mesh element indices }; //============================================================================== diff --git a/src/distribution.cpp b/src/distribution.cpp index 2066e5a8c..18fa41449 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -25,8 +25,9 @@ namespace openmc { DiscreteIndex::DiscreteIndex(pugi::xml_node node) { auto params = get_node_array(node, "parameters"); + std::size_t n = params.size() / 2; - prob_.assign(params.begin(), params.end()); + prob_.assign(params.begin() + n, params.end()); this->init_alias(); } @@ -38,6 +39,13 @@ DiscreteIndex::DiscreteIndex(const double* p, int n) this->init_alias(); } +void DiscreteIndex::assign(const double* p, int n) +{ + prob_.assign(p, p + n); + + this->init_alias(); +} + void DiscreteIndex::init_alias() { normalize(); @@ -111,21 +119,19 @@ void DiscreteIndex::normalize() // Discrete implementation //============================================================================== -Discrete::Discrete(pugi::xml_node node) +Discrete::Discrete(pugi::xml_node node) : di_(node) { auto params = get_node_array(node, "parameters"); std::size_t n = params.size() / 2; x_.assign(params.begin(), params.begin() + n); - di_ = new DiscreteIndex(params.begin() + n, n) } -Discrete::Discrete(const double* x, const double* p, int n) +Discrete::Discrete(const double* x, const double* p, int n) : di_(p, n) { x_.assign(x, x + n); - di_ = new DiscreteIndex(params.begin() + n, n) } double Discrete::sample(uint64_t* seed) const diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index c2d370b17..694617ac5 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -231,7 +231,7 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) } } - elem_idx_dist_ = make_unique(strengths.data(), n_bins); + elem_idx_dist_.assign(strengths.data(), n_bins); } Position MeshSpatial::sample(uint64_t* seed) const From df4cfad60c08e62463a748dac6413787692396c2 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Wed, 22 Mar 2023 00:29:28 -0400 Subject: [PATCH 088/136] more pointer to instance changes --- include/openmc/distribution.h | 4 ++-- src/distribution.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/openmc/distribution.h b/include/openmc/distribution.h index b7d0e4721..12a6f6f5c 100644 --- a/include/openmc/distribution.h +++ b/include/openmc/distribution.h @@ -79,8 +79,8 @@ public: // Properties const vector& x() const { return x_; } - const vector& prob() const { return di_->prob(); } - const vector& alias() const { return di_->alias(); } + const vector& prob() const { return di_.prob(); } + const vector& alias() const { return di_.alias(); } private: vector x_; //!< Possible outcomes diff --git a/src/distribution.cpp b/src/distribution.cpp index 18fa41449..deea035de 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -136,7 +136,7 @@ Discrete::Discrete(const double* x, const double* p, int n) : di_(p, n) double Discrete::sample(uint64_t* seed) const { - return x_[di_->sample(seed)]; + return x_[di_.sample(seed)]; } //============================================================================== From c272ed4c4e11d8f3e35e877fb6246c65102c7ee8 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Wed, 22 Mar 2023 00:37:12 -0400 Subject: [PATCH 089/136] more pointer->instance repair --- src/distribution_spatial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index 694617ac5..e1a4c20c2 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -237,7 +237,7 @@ MeshSpatial::MeshSpatial(pugi::xml_node node) Position MeshSpatial::sample(uint64_t* seed) const { // Sample over the CDF defined in initialization above - int32_t elem_idx = elem_idx_dist_->sample(seed); + int32_t elem_idx = elem_idx_dist_.sample(seed); return mesh()->sample(seed, elem_idx); } From fb4845494f19b6c0dfde82f1ecb90d5fa8a879a7 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Wed, 22 Mar 2023 00:37:21 -0400 Subject: [PATCH 090/136] add default empty consructor --- include/openmc/distribution.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/openmc/distribution.h b/include/openmc/distribution.h index 12a6f6f5c..03b046bbb 100644 --- a/include/openmc/distribution.h +++ b/include/openmc/distribution.h @@ -37,7 +37,8 @@ UPtrDist distribution_from_xml(pugi::xml_node node); class DiscreteIndex { public: - explicit DiscreteIndex(pugi::xml_node node); + DiscreteIndex() {}; + DiscreteIndex(pugi::xml_node node); DiscreteIndex(const double* p, int n); void assign(const double* p, int n); From 967cd43fa13f9360437e130a76086abb08abf106 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Wed, 22 Mar 2023 08:45:19 -0400 Subject: [PATCH 091/136] reuse assign --- src/distribution.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/distribution.cpp b/src/distribution.cpp index deea035de..599f57ad4 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -27,16 +27,12 @@ DiscreteIndex::DiscreteIndex(pugi::xml_node node) auto params = get_node_array(node, "parameters"); std::size_t n = params.size() / 2; - prob_.assign(params.begin() + n, params.end()); - - this->init_alias(); + assign(params.begin(), n); } DiscreteIndex::DiscreteIndex(const double* p, int n) { - prob_.assign(p, p + n); - - this->init_alias(); + assign(p, n); } void DiscreteIndex::assign(const double* p, int n) From 83a124c49240725494a2f4795aa1e56954c46bf3 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 22 Mar 2023 13:11:33 +0000 Subject: [PATCH 092/136] [skip ci] review improvments to docstring from @paulromano Co-authored-by: Paul Romano --- openmc/plotter.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openmc/plotter.py b/openmc/plotter.py index 2bdcfe351..c66088cfd 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -63,8 +63,8 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, Parameters ---------- - this : {str, openmc.Material} - Object to source data from. Nuclides and Elements can be input as a str + this : str or openmc.Material + Object to source data from. Nuclides and elements can be input as a str types : Iterable of values of PLOT_TYPES The type of cross sections to include in the plot. divisor_types : Iterable of values of PLOT_TYPES, optional @@ -217,8 +217,8 @@ def calculate_cexs(this, types, temperature=294., sab_name=None, Parameters ---------- - this : {str, openmc.Material} - Object to source data from. Nuclides and Elements should be input as a + this : str or openmc.Material + Object to source data from. Nuclides and elements should be input as a str types : Iterable of values of PLOT_TYPES The type of cross sections to calculate @@ -603,8 +603,8 @@ def calculate_mgxs(this, types, orders=None, temperature=294., Parameters ---------- - this : {str, openmc.Material} - Object to source data from. Nuclides and Elements can be input as a str + this : str or openmc.Material + Object to source data from. Nuclides and elements can be input as a str types : Iterable of values of PLOT_TYPES_MGXS The type of cross sections to calculate orders : Iterable of Integral, optional From 6fc0c3e545627f67bece40950b3426b7001a0b56 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Wed, 22 Mar 2023 09:27:50 -0400 Subject: [PATCH 093/136] manually convert iterator to pointer --- src/distribution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/distribution.cpp b/src/distribution.cpp index 599f57ad4..aa0e8e684 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -27,7 +27,7 @@ DiscreteIndex::DiscreteIndex(pugi::xml_node node) auto params = get_node_array(node, "parameters"); std::size_t n = params.size() / 2; - assign(params.begin(), n); + assign(&(*params.begin()), n); } DiscreteIndex::DiscreteIndex(const double* p, int n) From 993a8727980f52775025ab6f31144f1439013e10 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 22 Mar 2023 13:32:38 +0000 Subject: [PATCH 094/136] removed unused else and passing **kwargs --- openmc/plotter.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/openmc/plotter.py b/openmc/plotter.py index c66088cfd..a37b6f042 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -58,7 +58,8 @@ ELEMENT_NAMES = list(openmc.data.ELEMENT_SYMBOL.values())[1:] def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, sab_name=None, ce_cross_sections=None, mg_cross_sections=None, - enrichment=None, plot_CE=True, orders=None, divisor_orders=None): + enrichment=None, plot_CE=True, orders=None, divisor_orders=None, + **kwargs): """Creates a figure of continuous-energy cross sections for this item. Parameters @@ -98,6 +99,9 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, multi-group data. divisor_orders : Iterable of Integral, optional Same as orders, but for divisor_types + **kwargs : + All keyword arguments are passed to + :func:`matplotlib.pyplot.figure`. Returns ------- @@ -157,7 +161,7 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None, # Generate the plot if axis is None: - fig, ax = plt.subplots() + fig, ax = plt.subplots(**kwargs) else: fig = None ax = axis @@ -270,15 +274,9 @@ def calculate_cexs(this, types, temperature=294., sab_name=None, data = np.zeros((len(types), len(energy_grid))) for line in range(len(types)): data[line, :] = xs[line](energy_grid) - - elif isinstance(this, openmc.Material): + else: energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature, cross_sections) - else: - msg = ( - f"{this} is an invalid type, acceptable types are str, openmc.Material." - ) - raise TypeError(msg) return energy_grid, data From 72a6f77b0c57cc1db62041409662a08f43112862 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Wed, 22 Mar 2023 09:59:00 -0400 Subject: [PATCH 095/136] use correct part of parameters --- src/distribution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/distribution.cpp b/src/distribution.cpp index aa0e8e684..32b47093c 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -27,7 +27,7 @@ DiscreteIndex::DiscreteIndex(pugi::xml_node node) auto params = get_node_array(node, "parameters"); std::size_t n = params.size() / 2; - assign(&(*params.begin()), n); + assign(&(*params.begin()) + n, n); } DiscreteIndex::DiscreteIndex(const double* p, int n) From 5160417e3e01097934eb0ef36610c35aa3fa6639 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Wed, 22 Mar 2023 12:45:33 -0500 Subject: [PATCH 096/136] load any nuclide requested that is not present in materials prior to constructing tally --- openmc/deplete/helpers.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openmc/deplete/helpers.py b/openmc/deplete/helpers.py index e51106544..90d1ddde4 100644 --- a/openmc/deplete/helpers.py +++ b/openmc/deplete/helpers.py @@ -15,7 +15,7 @@ from openmc.mpi import comm from openmc.checkvalue import check_type, check_greater_than from openmc.data import JOULE_PER_EV, REACTION_MT from openmc.lib import ( - Tally, MaterialFilter, EnergyFilter, EnergyFunctionFilter) + Tally, MaterialFilter, EnergyFilter, EnergyFunctionFilter, load_nuclide) import openmc.lib from .abc import ( ReactionRateHelper, NormalizationHelper, FissionYieldHelper) @@ -189,7 +189,7 @@ class DirectReactionRateHelper(ReactionRateHelper): def reset_tally_means(self): """Reset the cached mean rate tallies. .. note:: - + This step must be performed after each transport cycle """ self._rate_tally_means_cache = None @@ -306,6 +306,12 @@ class FluxCollapseHelper(ReactionRateHelper): self._rate_tally.filters = [MaterialFilter(materials)] self._rate_tally_means_cache = None if self._nuclides_direct is not None: + # check if any direct tally nuclides are requested that are not + # already loaded with the materials. Load separately if so. + mat_nuclides = [n for mat in materials for n in mat.nuclides] + extra_nuclides = set(self._nuclides_direct) - set(mat_nuclides) + for nuc in extra_nuclides: + load_nuclide(nuc) self._rate_tally.nuclides = self._nuclides_direct @property @@ -327,7 +333,7 @@ class FluxCollapseHelper(ReactionRateHelper): def reset_tally_means(self): """Reset the cached mean rate and flux tallies. .. note:: - + This step must be performed after each transport cycle """ self._flux_tally_means_cache = None From 9bb1ef4369871444f3342ee144a5854a34479a87 Mon Sep 17 00:00:00 2001 From: Paul Wilson Date: Wed, 22 Mar 2023 21:42:06 -0400 Subject: [PATCH 097/136] Update src/distribution.cpp Co-authored-by: Paul Romano --- src/distribution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/distribution.cpp b/src/distribution.cpp index 32b47093c..10d404c10 100644 --- a/src/distribution.cpp +++ b/src/distribution.cpp @@ -27,7 +27,7 @@ DiscreteIndex::DiscreteIndex(pugi::xml_node node) auto params = get_node_array(node, "parameters"); std::size_t n = params.size() / 2; - assign(&(*params.begin()) + n, n); + assign(params.data() + n, n); } DiscreteIndex::DiscreteIndex(const double* p, int n) From 675ec5f9abc72d9e0c885139cc7a06539e33a459 Mon Sep 17 00:00:00 2001 From: guyshtot Date: Thu, 23 Mar 2023 13:07:21 +0200 Subject: [PATCH 098/136] Added test for the use of a Library with specified nuclides --- .../__init__.py | 0 .../inputs_true.dat | 1769 +++++++++++++++++ .../results_true.dat | 1 + .../mgxs_library_specific_nuclides/test.py | 71 + 4 files changed, 1841 insertions(+) create mode 100644 tests/regression_tests/mgxs_library_specific_nuclides/__init__.py create mode 100644 tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat create mode 100644 tests/regression_tests/mgxs_library_specific_nuclides/results_true.dat create mode 100644 tests/regression_tests/mgxs_library_specific_nuclides/test.py diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/__init__.py b/tests/regression_tests/mgxs_library_specific_nuclides/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat new file mode 100644 index 000000000..205eb059c --- /dev/null +++ b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat @@ -0,0 +1,1769 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 1 + + + 3 + + + 0.0 20000000.0 + + + 2 + + + 3 + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U235 total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U235 total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + absorption + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + absorption + tracklength + + + 1 2 + U235 total + (n,2n) + tracklength + + + 1 2 + U235 total + (n,3n) + tracklength + + + 1 2 + U235 total + (n,4n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + absorption + tracklength + + + 1 2 + U235 total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + nu-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + kappa-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + scatter + tracklength + + + 1 2 + total + flux + analog + + + 1 2 + U235 total + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + U235 total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + U235 total + nu-scatter + analog + + + 1 2 5 + U235 total + nu-scatter + analog + + + 1 2 5 + U235 total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + U235 total + nu-fission + analog + + + 1 2 5 + U235 total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + scatter + tracklength + + + 1 2 5 30 + U235 total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + scatter + tracklength + + + 1 2 5 30 + U235 total + scatter + analog + + + 1 2 5 + U235 total + nu-scatter + analog + + + 1 54 + U235 total + nu-fission + analog + + + 1 5 + U235 total + nu-fission + analog + + + 1 54 + U235 total + prompt-nu-fission + analog + + + 1 5 + U235 total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + inverse-velocity + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + prompt-nu-fission + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + U235 total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U235 total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U235 total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,elastic) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,level) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,2n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,na) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,nc) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,gamma) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,a) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,Xa) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + heating + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + damage-energy + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,n1) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U235 total + (n,a0) + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + U235 total + (n,nc) + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + U235 total + (n,n1) + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + U235 total + (n,2n) + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + total + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 total + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 total + nu-scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + absorption + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + absorption + tracklength + + + 106 2 + Zr90 total + (n,2n) + tracklength + + + 106 2 + Zr90 total + (n,3n) + tracklength + + + 106 2 + Zr90 total + (n,4n) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + absorption + tracklength + + + 106 2 + Zr90 total + fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + nu-fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + kappa-fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + scatter + tracklength + + + 106 2 + total + flux + analog + + + 106 2 + Zr90 total + nu-scatter + analog + + + 106 2 + total + flux + analog + + + 106 2 5 30 + Zr90 total + scatter + analog + + + 106 2 + total + flux + analog + + + 106 2 5 30 + Zr90 total + nu-scatter + analog + + + 106 2 5 + Zr90 total + nu-scatter + analog + + + 106 2 5 + Zr90 total + scatter + analog + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 total + nu-fission + analog + + + 106 2 5 + Zr90 total + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + scatter + tracklength + + + 106 2 5 30 + Zr90 total + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + scatter + tracklength + + + 106 2 5 30 + Zr90 total + scatter + analog + + + 106 2 5 + Zr90 total + nu-scatter + analog + + + 106 54 + Zr90 total + nu-fission + analog + + + 106 5 + Zr90 total + nu-fission + analog + + + 106 54 + Zr90 total + prompt-nu-fission + analog + + + 106 5 + Zr90 total + prompt-nu-fission + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + inverse-velocity + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + prompt-nu-fission + tracklength + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 total + prompt-nu-fission + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 total + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 total + nu-scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,elastic) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,level) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,2n) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,na) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,nc) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,gamma) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,a) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,Xa) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + heating + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + damage-energy + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,n1) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 total + (n,a0) + tracklength + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 total + (n,nc) + analog + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 total + (n,n1) + analog + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 total + (n,2n) + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + total + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 total + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 total + nu-scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + absorption + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + absorption + tracklength + + + 211 2 + H1 total + (n,2n) + tracklength + + + 211 2 + H1 total + (n,3n) + tracklength + + + 211 2 + H1 total + (n,4n) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + absorption + tracklength + + + 211 2 + H1 total + fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + nu-fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + kappa-fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + scatter + tracklength + + + 211 2 + total + flux + analog + + + 211 2 + H1 total + nu-scatter + analog + + + 211 2 + total + flux + analog + + + 211 2 5 30 + H1 total + scatter + analog + + + 211 2 + total + flux + analog + + + 211 2 5 30 + H1 total + nu-scatter + analog + + + 211 2 5 + H1 total + nu-scatter + analog + + + 211 2 5 + H1 total + scatter + analog + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 total + nu-fission + analog + + + 211 2 5 + H1 total + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + scatter + tracklength + + + 211 2 5 30 + H1 total + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + scatter + tracklength + + + 211 2 5 30 + H1 total + scatter + analog + + + 211 2 5 + H1 total + nu-scatter + analog + + + 211 54 + H1 total + nu-fission + analog + + + 211 5 + H1 total + nu-fission + analog + + + 211 54 + H1 total + prompt-nu-fission + analog + + + 211 5 + H1 total + prompt-nu-fission + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + inverse-velocity + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + prompt-nu-fission + tracklength + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 total + prompt-nu-fission + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 total + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 total + nu-scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,elastic) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,level) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,2n) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,na) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,nc) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,gamma) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,a) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,Xa) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + heating + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + damage-energy + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,n1) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 total + (n,a0) + tracklength + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 total + (n,nc) + analog + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 total + (n,n1) + analog + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 total + (n,2n) + analog + + diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/results_true.dat b/tests/regression_tests/mgxs_library_specific_nuclides/results_true.dat new file mode 100644 index 000000000..05ee40902 --- /dev/null +++ b/tests/regression_tests/mgxs_library_specific_nuclides/results_true.dat @@ -0,0 +1 @@ +3e86542d1166b8a0bcc61742b88c9e931d63733477f3274b32b4da64d8f05413fa6330d5615f44f24735c2c2f77d3071f3dce38faba284c321ceab81c1064480 \ No newline at end of file diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/test.py b/tests/regression_tests/mgxs_library_specific_nuclides/test.py new file mode 100644 index 000000000..41ae0a689 --- /dev/null +++ b/tests/regression_tests/mgxs_library_specific_nuclides/test.py @@ -0,0 +1,71 @@ +import hashlib + +import openmc +import openmc.mgxs +from openmc.examples import pwr_pin_cell + +from tests.testing_harness import PyAPITestHarness + + +class MGXSTestHarness(PyAPITestHarness): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # Initialize a two-group structure + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625, 20.e6]) + + # Initialize MGXS Library for a few cross section types + self.mgxs_lib = openmc.mgxs.Library(self._model.geometry) + self.mgxs_lib.by_nuclide = True + + # Test relevant MGXS types + relevant_MGXS_TYPES = [item for item in openmc.mgxs.MGXS_TYPES + if item != 'current'] + # Add in a subset of openmc.mgxs.ARBITRARY_VECTOR_TYPES and + # openmc.mgxs.ARBITRARY_MATRIX_TYPES so we can see the code works, + # but not use too much resources + relevant_MGXS_TYPES += [ + "(n,elastic)", "(n,level)", "(n,2n)", "(n,na)", "(n,nc)", + "(n,gamma)", "(n,a)", "(n,Xa)", "heating", "damage-energy", + "(n,n1)", "(n,a0)", "(n,nc) matrix", "(n,n1) matrix", + "(n,2n) matrix"] + self.mgxs_lib.mgxs_types = tuple(relevant_MGXS_TYPES) + self.mgxs_lib.energy_groups = energy_groups + self.mgxs_lib.legendre_order = 3 + self.mgxs_lib.domain_type = 'material' + self.mgxs_lib.nuclides=['U235','Zr90','H1'] + self.mgxs_lib.build_library() + + # Add tallies + self.mgxs_lib.add_to_tallies_file(self._model.tallies, merge=False) + + def _get_results(self, hash_output=True): + """Digest info in the statepoint and return as a string.""" + + # Read the statepoint file. + sp = openmc.StatePoint(self._sp_name) + + # Load the MGXS library from the statepoint + self.mgxs_lib.load_from_statepoint(sp) + + # Build a string from Pandas Dataframe for each MGXS + outstr = '' + for domain in self.mgxs_lib.domains: + for mgxs_type in self.mgxs_lib.mgxs_types: + mgxs = self.mgxs_lib.get_mgxs(domain, mgxs_type) + df = mgxs.get_pandas_dataframe() + outstr += df.to_string() + '\n' + + # Hash the results if necessary + if hash_output: + sha512 = hashlib.sha512() + sha512.update(outstr.encode('utf-8')) + outstr = sha512.hexdigest() + + return outstr + + +def test_mgxs_library_specific_nuclides(): + model = pwr_pin_cell() + harness = MGXSTestHarness('statepoint.10.h5', model) + harness.main() From a704ec73f26a7e89de06c2e2303ee170f0adf5cf Mon Sep 17 00:00:00 2001 From: guyshtot Date: Thu, 23 Mar 2023 13:12:36 +0200 Subject: [PATCH 099/136] Applied CR suggestion --- openmc/mgxs/library.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 0eb00c8f1..1c3a5dbb4 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -547,8 +547,10 @@ class Library: domain_nuclides = None if self.nuclides: if domain_nuclides: - mgxs.nuclides = [nuclide for nuclide in self.nuclides if nuclide in domain_nuclides] + [ - "total"] + mgxs.nuclides = [ + nuclide for nuclide in self.nuclides + if nuclide in domain_nuclides + ] + ["total"] else: mgxs.nuclides = self.nuclides From 10787a2da6c4a154464c61df5e7e4823f686cb2b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 23 Mar 2023 13:37:26 -0500 Subject: [PATCH 100/136] Account for coincident position in find_r_crossing --- src/mesh.cpp | 10 +-- tests/unit_tests/test_filter_mesh.py | 97 ++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 4 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 02e5171bb..306e56070 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1075,7 +1075,8 @@ double CylindricalMesh::find_r_crossing( const double inv_denominator = 1.0 / denominator; const double p = (u.x * r.x + u.y * r.y) * inv_denominator; - double D = p * p + (r0 * r0 - r.x * r.x - r.y * r.y) * inv_denominator; + double c = r.x * r.x + r.y * r.y - r0 * r0; + double D = p * p - c * inv_denominator; if (D < 0.0) return INFTY; @@ -1083,7 +1084,7 @@ double CylindricalMesh::find_r_crossing( D = std::sqrt(D); // the solution -p - D is always smaller as -p + D : Check this one first - if (-p - D > l) + if (-p - D > l && std::abs(c) > FP_COINCIDENT) return -p - D; if (-p + D > l) return -p + D; @@ -1303,12 +1304,13 @@ double SphericalMesh::find_r_crossing( // |r+s*u| = |r| + 2*s*r*u + s^2 (|u|==1 !) const double r0 = grid_[0][shell]; const double p = r.dot(u); - double D = p * p - r.dot(r) + r0 * r0; + double c = r.dot(r) - r0 * r0; + double D = p * p - c; if (D >= 0.0) { D = std::sqrt(D); // the solution -p - D is always smaller as -p + D : Check this one first - if (-p - D > l) + if (-p - D > l && std::abs(c) > FP_COINCIDENT) return -p - D; if (-p + D > l) return -p + D; diff --git a/tests/unit_tests/test_filter_mesh.py b/tests/unit_tests/test_filter_mesh.py index 3bb836e46..5e5a84f7b 100644 --- a/tests/unit_tests/test_filter_mesh.py +++ b/tests/unit_tests/test_filter_mesh.py @@ -1,6 +1,7 @@ import math import numpy as np +import pytest from uncertainties import unumpy import openmc @@ -112,6 +113,102 @@ def test_cylindrical_mesh_estimators(run_in_tmpdir): std_dev = unumpy.std_devs(delta) assert np.all(diff < 3*std_dev) + +def test_cylindrical_mesh_coincident(run_in_tmpdir): + """Test for cylindrical mesh boundary being coincident with a cell boundary""" + + fuel = openmc.Material() + fuel.add_nuclide('U235', 1.) + fuel.set_density('g/cm3', 4.5) + + zcyl = openmc.ZCylinder(r=1.25) + box = openmc.rectangular_prism(4.0, 4.0, boundary_type='reflective') + cell1 = openmc.Cell(fill=fuel, region=-zcyl) + cell2 = openmc.Cell(fill=None, region=+zcyl & box) + model = openmc.Model() + model.geometry = openmc.Geometry([cell1, cell2]) + + model.settings.particles = 100 + model.settings.batches = 10 + model.settings.inactive = 0 + + cyl_mesh = openmc.CylindricalMesh() + cyl_mesh.r_grid = [0., 1.25] + cyl_mesh.phi_grid = [0., 2*math.pi] + cyl_mesh.z_grid = [-1e10, 1e10] + cyl_mesh_filter = openmc.MeshFilter(cyl_mesh) + cell_filter = openmc.CellFilter([cell1]) + + tally1 = openmc.Tally() + tally1.filters = [cyl_mesh_filter] + tally1.scores = ['flux'] + tally2 = openmc.Tally() + tally2.filters = [cell_filter] + tally2.scores = ['flux'] + model.tallies = openmc.Tallies([tally1, tally2]) + + # Run OpenMC + sp_filename = model.run() + + # Get flux for each of the two tallies + with openmc.StatePoint(sp_filename) as sp: + t1 = sp.tallies[tally1.id] + t2 = sp.tallies[tally2.id] + mean1 = t1.mean.ravel()[0] + mean2 = t2.mean.ravel()[0] + + # The two tallies should be exactly the same + assert mean1 == pytest.approx(mean2) + + +def test_spherical_mesh_coincident(run_in_tmpdir): + """Test for spherical mesh boundary being coincident with a cell boundary""" + + fuel = openmc.Material() + fuel.add_nuclide('U235', 1.) + fuel.set_density('g/cm3', 4.5) + + sph = openmc.Sphere(r=1.25) + rcc = openmc.model.RectangularParallelepiped( + -2.0, 2.0, -2.0, 2.0, -2.0, 2.0, boundary_type='reflective') + cell1 = openmc.Cell(fill=fuel, region=-sph) + cell2 = openmc.Cell(fill=None, region=+sph & -rcc) + model = openmc.Model() + model.geometry = openmc.Geometry([cell1, cell2]) + + model.settings.particles = 100 + model.settings.batches = 10 + model.settings.inactive = 0 + + sph_mesh = openmc.SphericalMesh() + sph_mesh.r_grid = [0., 1.25] + sph_mesh.phi_grid = [0., 2*math.pi] + sph_mesh.theta_grid = [0., math.pi] + sph_mesh_filter = openmc.MeshFilter(sph_mesh) + cell_filter = openmc.CellFilter([cell1]) + + tally1 = openmc.Tally() + tally1.filters = [sph_mesh_filter] + tally1.scores = ['flux'] + tally2 = openmc.Tally() + tally2.filters = [cell_filter] + tally2.scores = ['flux'] + model.tallies = openmc.Tallies([tally1, tally2]) + + # Run OpenMC + sp_filename = model.run() + + # Get flux for each of the two tallies + with openmc.StatePoint(sp_filename) as sp: + t1 = sp.tallies[tally1.id] + t2 = sp.tallies[tally2.id] + mean1 = t1.mean.ravel()[0] + mean2 = t2.mean.ravel()[0] + + # The two tallies should be exactly the same + assert mean1 == pytest.approx(mean2) + + def test_get_reshaped_data(run_in_tmpdir): """Test that expanding MeshFilter dimensions works as expected""" From e7eb746dc415d8c5822340052a22666302d35a15 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 23 Mar 2023 14:08:03 -0500 Subject: [PATCH 101/136] Always use quotes for python-version in ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82bd70a62..1a905b3cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,13 +35,13 @@ jobs: vectfit: [n] include: - - python-version: 3.7 + - python-version: "3.7" omp: n mpi: n - - python-version: 3.8 + - python-version: "3.8" omp: n mpi: n - - python-version: 3.9 + - python-version: "3.9" omp: n mpi: n - python-version: "3.11" From e93dd66430d7cae137cae8798b72645cd2d32726 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Thu, 23 Mar 2023 15:07:32 -0500 Subject: [PATCH 102/136] eliminate set/list redundancy Co-authored-by: Paul Romano --- openmc/deplete/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/deplete/helpers.py b/openmc/deplete/helpers.py index 90d1ddde4..ec0f65650 100644 --- a/openmc/deplete/helpers.py +++ b/openmc/deplete/helpers.py @@ -308,8 +308,8 @@ class FluxCollapseHelper(ReactionRateHelper): if self._nuclides_direct is not None: # check if any direct tally nuclides are requested that are not # already loaded with the materials. Load separately if so. - mat_nuclides = [n for mat in materials for n in mat.nuclides] - extra_nuclides = set(self._nuclides_direct) - set(mat_nuclides) + mat_nuclides = {n for mat in materials for n in mat.nuclides} + extra_nuclides = set(self._nuclides_direct) - mat_nuclides for nuc in extra_nuclides: load_nuclide(nuc) self._rate_tally.nuclides = self._nuclides_direct From 7f68462e3a4d6f10914e4812eba67d482e2cb7f1 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Thu, 23 Mar 2023 15:43:03 -0500 Subject: [PATCH 103/136] add nuclide that is not in model; (fails locally) --- tests/unit_tests/test_deplete_activation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_deplete_activation.py b/tests/unit_tests/test_deplete_activation.py index 1842ad8ac..cef614f82 100644 --- a/tests/unit_tests/test_deplete_activation.py +++ b/tests/unit_tests/test_deplete_activation.py @@ -47,7 +47,7 @@ ENERGIES = np.logspace(log10(1e-5), log10(2e7), 100) ("direct", {}, 1e-5), ("flux", {'energies': ENERGIES}, 0.01), ("flux", {'energies': ENERGIES, 'reactions': ['(n,gamma)']}, 1e-5), - ("flux", {'energies': ENERGIES, 'reactions': ['(n,gamma)'], 'nuclides': ['W186']}, 1e-5), + ("flux", {'energies': ENERGIES, 'reactions': ['(n,gamma)'], 'nuclides': ['W186', 'H3']}, 1e-5), ]) def test_activation(run_in_tmpdir, model, reaction_rate_mode, reaction_rate_opts, tolerance): # Determine (n.gamma) reaction rate using initial run From 2f5428f739808abc67674fc9fc126e197f3201a9 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Fri, 24 Mar 2023 12:13:00 -0400 Subject: [PATCH 104/136] Update openmc/model/surface_composite.py Co-authored-by: Patrick Shriwise --- openmc/model/surface_composite.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 09c2f4fee..354a62883 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -851,7 +851,6 @@ class Polygon(CompositeSurface): # All 4 cross products are zero # Determine number of unique points, x span and y span for # both line segments - #unique_pts = np.unique(np.vstack((p0, p1, p2, p3)), axis=0) xmin1, xmax1 = min(p0[0], p1[0]), max(p0[0], p1[0]) ymin1, ymax1 = min(p0[1], p1[1]), max(p0[1], p1[1]) xmin2, xmax2 = min(p2[0], p3[0]), max(p2[0], p3[0]) From 11e618fe81a2d7515a093d9549d083cc82bd73c2 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Tue, 28 Feb 2023 11:31:04 -0500 Subject: [PATCH 105/136] adding export_to_xml to run and updating tests --- openmc/model/model.py | 11 +- src/cell.cpp | 2 +- .../adj_cell_rotation/inputs_true.dat | 74 +- .../asymmetric_lattice/inputs_true.dat | 411 +- .../cpp_driver/inputs_true.dat | 84 +- .../create_fission_neutrons/inputs_true.dat | 71 +- .../create_fission_neutrons/test.py | 16 +- .../dagmc/external/inputs_true.dat | 77 +- .../dagmc/legacy/inputs_true.dat | 75 +- .../dagmc/refl/inputs_true.dat | 55 +- tests/regression_tests/dagmc/refl/test.py | 23 +- .../dagmc/universes/inputs_true.dat | 108 +- .../regression_tests/dagmc/universes/test.py | 23 +- .../dagmc/uwuw/inputs_true.dat | 55 +- tests/regression_tests/dagmc/uwuw/test.py | 22 +- .../diff_tally/inputs_true.dat | 723 ++- .../distribmat/inputs_true.dat | 117 +- .../distribmat/results_true.dat | 2 +- tests/regression_tests/distribmat/test.py | 17 +- .../eigenvalue_genperbatch/inputs_true.dat | 59 +- .../energy_cutoff/inputs_true.dat | 81 +- tests/regression_tests/energy_cutoff/test.py | 15 +- .../energy_laws/inputs_true.dat | 44 +- .../external_moab/inputs_true.dat | 143 +- tests/regression_tests/external_moab/test.py | 2 - .../filter_cellinstance/inputs_true.dat | 119 +- .../filter_energyfun/inputs_true.dat | 209 +- .../filter_mesh/inputs_true.dat | 301 +- .../filter_translations/inputs_true.dat | 165 +- .../fixed_source/inputs_true.dat | 59 +- .../iso_in_lab/inputs_true.dat | 488 +-- .../lattice_hex_coincident/inputs_true.dat | 160 +- .../lattice_hex_coincident/test.py | 13 +- .../lattice_hex_x/inputs_true.dat | 160 +- tests/regression_tests/lattice_hex_x/test.py | 15 +- .../lattice_multiple/inputs_true.dat | 96 +- .../lattice_rotated/inputs_true.dat | 114 +- .../regression_tests/mg_basic/inputs_true.dat | 126 +- .../mg_basic_delayed/inputs_true.dat | 124 +- .../mg_convert/inputs_true.dat | 56 +- tests/regression_tests/mg_convert/test.py | 12 +- .../mg_legendre/inputs_true.dat | 64 +- .../mg_max_order/inputs_true.dat | 66 +- .../mg_survival_biasing/inputs_true.dat | 66 +- .../mg_tallies/inputs_true.dat | 327 +- .../mgxs_library_ce_to_mg/inputs_true.dat | 499 ++- .../mgxs_library_ce_to_mg/test.py | 9 +- .../inputs_true.dat | 499 ++- .../mgxs_library_ce_to_mg_nuclides/test.py | 9 +- .../mgxs_library_condense/inputs_true.dat | 1061 +++-- .../mgxs_library_correction/inputs_true.dat | 685 ++- .../mgxs_library_distribcell/inputs_true.dat | 1047 +++-- .../mgxs_library_hdf5/inputs_true.dat | 1061 +++-- .../mgxs_library_histogram/inputs_true.dat | 535 ++- .../mgxs_library_mesh/inputs_true.dat | 1021 +++-- .../mgxs_library_no_nuclides/inputs_true.dat | 3901 ++++++++--------- .../mgxs_library_nuclides/inputs_true.dat | 3535 ++++++++------- .../multipole/inputs_true.dat | 103 +- .../regression_tests/ncrystal/inputs_true.dat | 87 +- .../regression_tests/periodic/inputs_true.dat | 72 +- .../periodic_6fold/inputs_true.dat | 66 +- .../periodic_hex/inputs_true.dat | 46 +- .../photon_production/inputs_true.dat | 133 +- .../photon_production_fission/inputs_true.dat | 95 +- .../photon_source/inputs_true.dat | 87 +- tests/regression_tests/photon_source/test.py | 15 +- .../resonance_scattering/inputs_true.dat | 66 +- .../resonance_scattering/test.py | 14 +- .../salphabeta/inputs_true.dat | 118 +- .../score_current/inputs_true.dat | 107 +- tests/regression_tests/source/inputs_true.dat | 298 +- tests/regression_tests/source/test.py | 14 +- .../source_dlopen/inputs_true.dat | 44 +- .../inputs_true.dat | 44 +- .../surface_source/inputs_true_read.dat | 65 +- .../surface_source/inputs_true_write.dat | 77 +- .../surface_source/surface_source_true.h5 | Bin 106144 -> 106144 bytes .../surface_tally/inputs_true.dat | 203 +- tests/regression_tests/surface_tally/test.py | 15 +- .../regression_tests/tallies/inputs_true.dat | 853 ++-- .../tally_aggregation/inputs_true.dat | 107 +- .../tally_arithmetic/inputs_true.dat | 109 +- .../tally_slice_merge/inputs_true.dat | 541 ++- tests/regression_tests/torus/inputs_true.dat | 66 +- .../torus/large_major/inputs_true.dat | 71 +- .../inputs_true.dat | 67 +- tests/regression_tests/triso/inputs_true.dat | 878 ++-- tests/regression_tests/triso/test.py | 14 +- .../unstructured_mesh/inputs_true.dat | 179 +- .../unstructured_mesh/inputs_true0.dat | 179 +- .../unstructured_mesh/inputs_true1.dat | 179 +- .../unstructured_mesh/inputs_true10.dat | 179 +- .../unstructured_mesh/inputs_true11.dat | 179 +- .../unstructured_mesh/inputs_true12.dat | 179 +- .../unstructured_mesh/inputs_true13.dat | 179 +- .../unstructured_mesh/inputs_true14.dat | 179 +- .../unstructured_mesh/inputs_true15.dat | 179 +- .../unstructured_mesh/inputs_true2.dat | 179 +- .../unstructured_mesh/inputs_true3.dat | 179 +- .../unstructured_mesh/inputs_true4.dat | 181 +- .../unstructured_mesh/inputs_true5.dat | 181 +- .../unstructured_mesh/inputs_true6.dat | 181 +- .../unstructured_mesh/inputs_true7.dat | 181 +- .../unstructured_mesh/inputs_true8.dat | 179 +- .../unstructured_mesh/inputs_true9.dat | 179 +- tests/regression_tests/void/inputs_true.dat | 261 +- .../volume_calc/inputs_true.dat | 148 +- .../volume_calc/inputs_true_mg.dat | 150 +- tests/regression_tests/volume_calc/test.py | 10 +- .../weightwindows/inputs_true.dat | 189 +- tests/testing_harness.py | 7 +- 111 files changed, 13560 insertions(+), 13643 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index 3e0422eb1..78f02242f 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -596,7 +596,8 @@ class Model: def run(self, particles=None, threads=None, geometry_debug=False, restart_file=None, tracks=False, output=True, cwd='.', - openmc_exec='openmc', mpi_args=None, event_based=None): + openmc_exec='openmc', mpi_args=None, event_based=None, + export_model_xml=True): """Runs OpenMC. If the C API has been initialized, then the C API is used, otherwise, this method creates the XML files and runs OpenMC via a system call. In both cases this method returns the path to the last @@ -639,6 +640,9 @@ class Model: event_based : None or bool, optional Turns on event-based parallelism if True. If None, the value in the Settings will be used. + export_model_xml : bool, optional + Exports a single model.xml file rather than separate files. + Defaults to True. Returns ------- @@ -688,7 +692,10 @@ class Model: else: # Then run via the command line - self.export_to_xml() + if export_model_xml: + self.export_to_model_xml() + else: + self.export_to_xml() openmc.run(particles, threads, geometry_debug, restart_file, tracks, output, Path('.'), openmc_exec, mpi_args, event_based) diff --git a/src/cell.cpp b/src/cell.cpp index 9ba14c6cf..c96abf39b 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -291,7 +291,7 @@ CSGCell::CSGCell(pugi::xml_node cell_node) if (fill_present) { fill_ = std::stoi(get_node_value(cell_node, "fill")); if (fill_ == universe_) { - fatal_error(fmt::format("Cell {} is filled with the same universe that" + fatal_error(fmt::format("Cell {} is filled with the same universe that " "it is contained in.", id_)); } diff --git a/tests/regression_tests/adj_cell_rotation/inputs_true.dat b/tests/regression_tests/adj_cell_rotation/inputs_true.dat index 24b00199b..1c4516f42 100644 --- a/tests/regression_tests/adj_cell_rotation/inputs_true.dat +++ b/tests/regression_tests/adj_cell_rotation/inputs_true.dat @@ -1,38 +1,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 10000 - 10 - 5 - - - -4.0 -4.0 -4.0 4.0 4.0 4.0 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 10000 + 10 + 5 + + + -4.0 -4.0 -4.0 4.0 4.0 4.0 + + + + diff --git a/tests/regression_tests/asymmetric_lattice/inputs_true.dat b/tests/regression_tests/asymmetric_lattice/inputs_true.dat index bbdc79715..b247412e5 100644 --- a/tests/regression_tests/asymmetric_lattice/inputs_true.dat +++ b/tests/regression_tests/asymmetric_lattice/inputs_true.dat @@ -1,19 +1,168 @@ - - - - - - - - - - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 @@ -31,197 +180,47 @@ 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - - 21.42 21.42 - 3 3 - -32.13 -32.13 - + + + 21.42 21.42 + 3 3 + -32.13 -32.13 + 8 7 7 8 8 8 7 7 7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -32 -32 0 32 32 32 - - - - - - - 27 - - - 1 - nu-fission - - + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -32 -32 0 32 32 32 + + + + + + 27 + + + 1 + nu-fission + + + diff --git a/tests/regression_tests/cpp_driver/inputs_true.dat b/tests/regression_tests/cpp_driver/inputs_true.dat index faa3fa9b1..cdace34f0 100644 --- a/tests/regression_tests/cpp_driver/inputs_true.dat +++ b/tests/regression_tests/cpp_driver/inputs_true.dat @@ -1,45 +1,45 @@ - - - - - - - - 4.0 4.0 - 2 2 - -4.0 -4.0 - + + + + + + + + + + + + + + + + + + + + + + + + 4.0 4.0 + 2 2 + -4.0 -4.0 + 2 2 2 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 1 - + + + + + + + + + + eigenvalue + 100 + 10 + 1 + + diff --git a/tests/regression_tests/create_fission_neutrons/inputs_true.dat b/tests/regression_tests/create_fission_neutrons/inputs_true.dat index b0ca89647..f79ba379c 100644 --- a/tests/regression_tests/create_fission_neutrons/inputs_true.dat +++ b/tests/regression_tests/create_fission_neutrons/inputs_true.dat @@ -1,37 +1,36 @@ - - - - - - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - -1 -1 -1 1 1 1 - - - - false - - - - - flux - - + + + + + + + + + + + + + + + + + + + fixed source + 100 + 10 + + + -1 -1 -1 1 1 1 + + + + false + + + + flux + + + diff --git a/tests/regression_tests/create_fission_neutrons/test.py b/tests/regression_tests/create_fission_neutrons/test.py index f1c1d072c..82bfaafa6 100755 --- a/tests/regression_tests/create_fission_neutrons/test.py +++ b/tests/regression_tests/create_fission_neutrons/test.py @@ -4,14 +4,14 @@ from tests.testing_harness import PyAPITestHarness class CreateFissionNeutronsTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # Material is composed of H-1 and U-235 mat = openmc.Material(material_id=1, name='mat') mat.set_density('atom/b-cm', 0.069335) mat.add_nuclide('H1', 40.0) mat.add_nuclide('U235', 1.0) - materials_file = openmc.Materials([mat]) - materials_file.export_to_xml() + self._model.materials = openmc.Materials([mat]) # Cell is box with reflective boundary x1 = openmc.XPlane(surface_id=1, x0=-1) @@ -27,8 +27,7 @@ class CreateFissionNeutronsTestHarness(PyAPITestHarness): box.fill = mat root = openmc.Universe(universe_id=0, name='root universe') root.add_cell(box) - geometry = openmc.Geometry(root) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root) # Set the running parameters settings_file = openmc.Settings() @@ -41,14 +40,14 @@ class CreateFissionNeutronsTestHarness(PyAPITestHarness): watt_dist = openmc.stats.Watt() settings_file.source = openmc.source.Source(space=uniform_dist, energy=watt_dist) - settings_file.export_to_xml() + self._model.settings = settings_file # Create tallies tallies = openmc.Tallies() tally = openmc.Tally(1) tally.scores = ['flux'] tallies.append(tally) - tallies.export_to_xml() + self._model.tallies = tallies def _get_results(self): """Digest info in the statepoint and return as a string.""" @@ -66,5 +65,6 @@ class CreateFissionNeutronsTestHarness(PyAPITestHarness): def test_create_fission_neutrons(): - harness = CreateFissionNeutronsTestHarness('statepoint.10.h5') + harness = CreateFissionNeutronsTestHarness('statepoint.10.h5', + model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/dagmc/external/inputs_true.dat b/tests/regression_tests/dagmc/external/inputs_true.dat index dd75bbdbd..5547f333c 100644 --- a/tests/regression_tests/dagmc/external/inputs_true.dat +++ b/tests/regression_tests/dagmc/external/inputs_true.dat @@ -1,40 +1,39 @@ - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 5 - 0 - - - -4 -4 -4 4 4 4 - - - 293 - - - - - 1 - - - 1 - total - - + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 5 + 0 + + + -4 -4 -4 4 4 4 + + + 293 + + + + 1 + + + 1 + total + + + diff --git a/tests/regression_tests/dagmc/legacy/inputs_true.dat b/tests/regression_tests/dagmc/legacy/inputs_true.dat index 2f5641046..89d458a2b 100644 --- a/tests/regression_tests/dagmc/legacy/inputs_true.dat +++ b/tests/regression_tests/dagmc/legacy/inputs_true.dat @@ -1,39 +1,38 @@ - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 5 - 0 - - - -4 -4 -4 4 4 4 - - - - - - - 1 - - - 1 - total - - + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 5 + 0 + + + -4 -4 -4 4 4 4 + + + + + + 1 + + + 1 + total + + + diff --git a/tests/regression_tests/dagmc/refl/inputs_true.dat b/tests/regression_tests/dagmc/refl/inputs_true.dat index 938916ece..894d50104 100644 --- a/tests/regression_tests/dagmc/refl/inputs_true.dat +++ b/tests/regression_tests/dagmc/refl/inputs_true.dat @@ -1,29 +1,28 @@ - - - - - - - - - eigenvalue - 100 - 5 - 0 - - - -4 -4 -4 4 4 4 - - - - - - - 2 - - - 1 - total - - + + + + + + + + eigenvalue + 100 + 5 + 0 + + + -4 -4 -4 4 4 4 + + + + + + 2 + + + 1 + total + + + diff --git a/tests/regression_tests/dagmc/refl/test.py b/tests/regression_tests/dagmc/refl/test.py index 5afc1a7a2..5b08f0c4a 100644 --- a/tests/regression_tests/dagmc/refl/test.py +++ b/tests/regression_tests/dagmc/refl/test.py @@ -10,34 +10,29 @@ pytestmark = pytest.mark.skipif( reason="DAGMC CAD geometry is not enabled.") class UWUWTest(PyAPITestHarness): - - def _build_inputs(self): - model = openmc.model.Model() + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # settings - model.settings.batches = 5 - model.settings.inactive = 0 - model.settings.particles = 100 + self._model.settings.batches = 5 + self._model.settings.inactive = 0 + self._model.settings.particles = 100 source = openmc.Source(space=Box([-4, -4, -4], [ 4, 4, 4])) - model.settings.source = source - - model.settings.export_to_xml() + self._model.settings.source = source # geometry dag_univ = openmc.DAGMCUniverse("dagmc.h5m", auto_geom_ids=True) - model.geometry = openmc.Geometry(dag_univ) + self._model.geometry = openmc.Geometry(dag_univ) # tally tally = openmc.Tally() tally.scores = ['total'] tally.filters = [openmc.CellFilter(2)] - model.tallies = [tally] + self._model.tallies = [tally] - model.tallies.export_to_xml() - model.export_to_xml() def test_refl(): - harness = UWUWTest('statepoint.5.h5') + harness = UWUWTest('statepoint.5.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/dagmc/universes/inputs_true.dat b/tests/regression_tests/dagmc/universes/inputs_true.dat index ea6ad519b..b88e83df4 100644 --- a/tests/regression_tests/dagmc/universes/inputs_true.dat +++ b/tests/regression_tests/dagmc/universes/inputs_true.dat @@ -1,55 +1,55 @@ - - - - - 24.0 24.0 - 2 2 - -24.0 -24.0 - -9 9 -9 9 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 2 - - false - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 24.0 24.0 + 2 2 + -24.0 -24.0 + +1 1 +1 1 + + + + + + + + + + eigenvalue + 100 + 10 + 2 + + false + + + diff --git a/tests/regression_tests/dagmc/universes/test.py b/tests/regression_tests/dagmc/universes/test.py index 47897ad56..a318275cd 100644 --- a/tests/regression_tests/dagmc/universes/test.py +++ b/tests/regression_tests/dagmc/universes/test.py @@ -12,9 +12,8 @@ pytestmark = pytest.mark.skipif( class DAGMCUniverseTest(PyAPITestHarness): - - def _build_inputs(self): - model = openmc.model.Model() + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) ### MATERIALS ### fuel = openmc.Material(name='no-void fuel') @@ -40,7 +39,7 @@ class DAGMCUniverseTest(PyAPITestHarness): water.add_nuclide('B11', 3.2218e-05) water.add_s_alpha_beta('c_H_in_H2O') - model.materials = openmc.Materials([fuel, cladding, water]) + self._model.materials = openmc.Materials([fuel, cladding, water]) ### GEOMETRY ### # create the DAGMC universe @@ -51,7 +50,7 @@ class DAGMCUniverseTest(PyAPITestHarness): # uses the bound_dag_cell as the root argument to test the type checks in openmc.Geometry bound_pincell_geometry = openmc.Geometry(root=bound_pincell_universe) # assigns the bound_dag_geometry to the model to test the type checks in model.Geometry setter - model.Geometry = bound_pincell_geometry + self._model.geometry = bound_pincell_geometry # create a 2 x 2 lattice using the DAGMC pincell pitch = np.asarray((24.0, 24.0)) @@ -71,17 +70,15 @@ class DAGMCUniverseTest(PyAPITestHarness): bounding_region = +left & -right & +front & -back & +bottom & -top bounding_cell = openmc.Cell(fill=lattice, region=bounding_region) - model.geometry = openmc.Geometry([bounding_cell]) + self._model.geometry = openmc.Geometry([bounding_cell]) # settings - model.settings.particles = 100 - model.settings.batches = 10 - model.settings.inactive = 2 - model.settings.output = {'summary' : False} - - model.export_to_xml() + self._model.settings.particles = 100 + self._model.settings.batches = 10 + self._model.settings.inactive = 2 + self._model.settings.output = {'summary' : False} def test_univ(): - harness = DAGMCUniverseTest('statepoint.10.h5') + harness = DAGMCUniverseTest('statepoint.10.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/dagmc/uwuw/inputs_true.dat b/tests/regression_tests/dagmc/uwuw/inputs_true.dat index 7d533c5db..07384b625 100644 --- a/tests/regression_tests/dagmc/uwuw/inputs_true.dat +++ b/tests/regression_tests/dagmc/uwuw/inputs_true.dat @@ -1,29 +1,28 @@ - - - - - - - - - eigenvalue - 100 - 5 - 0 - - - -4 -4 -4 4 4 4 - - - - - - - 1 - - - 1 - total - - + + + + + + + + eigenvalue + 100 + 5 + 0 + + + -4 -4 -4 4 4 4 + + + + + + 1 + + + 1 + total + + + diff --git a/tests/regression_tests/dagmc/uwuw/test.py b/tests/regression_tests/dagmc/uwuw/test.py index a8da2da60..19986e589 100644 --- a/tests/regression_tests/dagmc/uwuw/test.py +++ b/tests/regression_tests/dagmc/uwuw/test.py @@ -10,33 +10,29 @@ pytestmark = pytest.mark.skipif( reason="DAGMC CAD geometry is not enabled.") class UWUWTest(PyAPITestHarness): - - def _build_inputs(self): - model = openmc.model.Model() + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # settings - model.settings.batches = 5 - model.settings.inactive = 0 - model.settings.particles = 100 + self._model.settings.batches = 5 + self._model.settings.inactive = 0 + self._model.settings.particles = 100 source = openmc.Source(space=Box([-4, -4, -4], [ 4, 4, 4])) - model.settings.source = source - - model.settings.export_to_xml() + self._model.settings.source = source # geometry dag_univ = openmc.DAGMCUniverse("dagmc.h5m") - model.geometry = openmc.Geometry(root=dag_univ) + self._model.geometry = openmc.Geometry(root=dag_univ) # tally tally = openmc.Tally() tally.scores = ['total'] tally.filters = [openmc.CellFilter(1)] - model.tallies = [tally] + self._model.tallies = [tally] - model.export_to_xml() def test_uwuw(): - harness = UWUWTest('statepoint.5.h5') + harness = UWUWTest('statepoint.5.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/diff_tally/inputs_true.dat b/tests/regression_tests/diff_tally/inputs_true.dat index 909475f96..99697a1e9 100644 --- a/tests/regression_tests/diff_tally/inputs_true.dat +++ b/tests/regression_tests/diff_tally/inputs_true.dat @@ -1,38 +1,187 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 @@ -50,12 +199,12 @@ 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 @@ -73,12 +222,12 @@ 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 @@ -100,12 +249,12 @@ 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 @@ -127,313 +276,163 @@ 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 3 - 0 - - - -160 -160 -183 160 160 183 - - - true - - - - - 1 3 - - - 0.0 0.625 20000000.0 - - - 1 - flux - 1 - - - 1 - flux - 2 - - - 1 - flux - 3 - - - 1 - flux - 4 - - - 1 - flux - 5 - - - 1 - total U235 - total absorption scatter fission nu-fission - 1 - - - 1 - total U235 - total absorption scatter fission nu-fission - 2 - - - 1 - total U235 - total absorption scatter fission nu-fission - 3 - - - 1 - total U235 - total absorption scatter fission nu-fission - 4 - - - 1 - total U235 - total absorption scatter fission nu-fission - 5 - - - 1 - absorption - analog - 1 - - - 1 - absorption - analog - 2 - - - 1 - absorption - analog - 3 - - - 1 - absorption - analog - 4 - - - 1 - absorption - analog - 5 - - - 1 2 - total U235 - nu-fission scatter - 1 - - - 1 2 - total U235 - nu-fission scatter - 2 - - - 1 2 - U235 - nu-fission scatter - 3 - - - 1 2 - U235 - nu-fission scatter - 4 - - - 1 2 - U235 - nu-fission scatter - 5 - - - - - - - + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 3 + 0 + + + -160 -160 -183 160 160 183 + + + true + + + + 1 3 + + + 0.0 0.625 20000000.0 + + + 1 + flux + 1 + + + 1 + flux + 2 + + + 1 + flux + 3 + + + 1 + flux + 4 + + + 1 + flux + 5 + + + 1 + total U235 + total absorption scatter fission nu-fission + 1 + + + 1 + total U235 + total absorption scatter fission nu-fission + 2 + + + 1 + total U235 + total absorption scatter fission nu-fission + 3 + + + 1 + total U235 + total absorption scatter fission nu-fission + 4 + + + 1 + total U235 + total absorption scatter fission nu-fission + 5 + + + 1 + absorption + analog + 1 + + + 1 + absorption + analog + 2 + + + 1 + absorption + analog + 3 + + + 1 + absorption + analog + 4 + + + 1 + absorption + analog + 5 + + + 1 2 + total U235 + nu-fission scatter + 1 + + + 1 2 + total U235 + nu-fission scatter + 2 + + + 1 2 + U235 + nu-fission scatter + 3 + + + 1 2 + U235 + nu-fission scatter + 4 + + + 1 2 + U235 + nu-fission scatter + 5 + + + + + + + + diff --git a/tests/regression_tests/distribmat/inputs_true.dat b/tests/regression_tests/distribmat/inputs_true.dat index a1c1e8311..f6c43c19a 100644 --- a/tests/regression_tests/distribmat/inputs_true.dat +++ b/tests/regression_tests/distribmat/inputs_true.dat @@ -1,62 +1,61 @@ - - - - - - - 2.0 2.0 - 1 - 2 2 - -2.0 -2.0 - + + + + + + + + + + + + + + + + + + + + + + + 2.0 2.0 + 1 + 2 2 + -2.0 -2.0 + 11 11 11 11 - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - -1 -1 -1 1 1 1 - - - - - - - 0 0 0 - 7 7 - 400 400 - - - 0 0 0 - 7 7 - 400 400 - - + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + -1 -1 -1 1 1 1 + + + + + + 0 0 0 + 7 7 + 400 400 + + + 0 0 0 + 7 7 + 400 400 + + + diff --git a/tests/regression_tests/distribmat/results_true.dat b/tests/regression_tests/distribmat/results_true.dat index 4613434ce..af7b27fe7 100644 --- a/tests/regression_tests/distribmat/results_true.dat +++ b/tests/regression_tests/distribmat/results_true.dat @@ -4,7 +4,7 @@ Cell ID = 11 Name = Fill = [2, None, 3, 2] - Region = -9 + Region = -1 Rotation = None Translation = None Volume = None diff --git a/tests/regression_tests/distribmat/test.py b/tests/regression_tests/distribmat/test.py index 33f64ba03..ab7897313 100644 --- a/tests/regression_tests/distribmat/test.py +++ b/tests/regression_tests/distribmat/test.py @@ -4,7 +4,8 @@ from tests.testing_harness import TestHarness, PyAPITestHarness class DistribmatTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) #################### # Materials #################### @@ -22,8 +23,8 @@ class DistribmatTestHarness(PyAPITestHarness): light_fuel.set_density('g/cc', 2.0) light_fuel.add_nuclide('U235', 1.0) - mats_file = openmc.Materials([moderator, dense_fuel, light_fuel]) - mats_file.export_to_xml() + self._model.materials = openmc.Materials([moderator, dense_fuel, + light_fuel]) #################### # Geometry @@ -54,8 +55,7 @@ class DistribmatTestHarness(PyAPITestHarness): c101.region = +x0 & -x1 & +y0 & -y1 root_univ = openmc.Universe(universe_id=0, cells=[c101]) - geometry = openmc.Geometry(root_univ) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root_univ) #################### # Settings @@ -67,7 +67,7 @@ class DistribmatTestHarness(PyAPITestHarness): sets_file.particles = 1000 sets_file.source = openmc.Source(space=openmc.stats.Box( [-1, -1, -1], [1, 1, 1])) - sets_file.export_to_xml() + self._model.settings = sets_file #################### # Plots @@ -89,8 +89,7 @@ class DistribmatTestHarness(PyAPITestHarness): plot2.width = (7, 7) plot2.pixels = (400, 400) - plots = openmc.Plots([plot1, plot2]) - plots.export_to_xml() + self._model.plots = openmc.Plots([plot1, plot2]) def _get_results(self): outstr = super()._get_results() @@ -100,5 +99,5 @@ class DistribmatTestHarness(PyAPITestHarness): def test_distribmat(): - harness = DistribmatTestHarness('statepoint.5.h5') + harness = DistribmatTestHarness('statepoint.5.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat b/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat index 7348663e8..225b23ffa 100644 --- a/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat +++ b/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat @@ -1,31 +1,30 @@ - - - - - - - - - - - - - - eigenvalue - 1000 - 7 - 3 - 3 - - - -4.0 -4.0 -4.0 4.0 4.0 4.0 - - - - - - - flux - - + + + + + + + + + + + + + eigenvalue + 1000 + 7 + 3 + 3 + + + -4.0 -4.0 -4.0 4.0 4.0 4.0 + + + + + + flux + + + diff --git a/tests/regression_tests/energy_cutoff/inputs_true.dat b/tests/regression_tests/energy_cutoff/inputs_true.dat index bb02369dc..e874a0c7a 100644 --- a/tests/regression_tests/energy_cutoff/inputs_true.dat +++ b/tests/regression_tests/energy_cutoff/inputs_true.dat @@ -1,42 +1,41 @@ - - - - - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - -1 -1 -1 1 1 1 - - - - - 4.0 - - - - - - 0.0 4.0 - - - 1 - flux - - + + + + + + + + + + + + + + + + + + fixed source + 100 + 10 + + + -1 -1 -1 1 1 1 + + + + + 4.0 + + + + + 0.0 4.0 + + + 1 + flux + + + diff --git a/tests/regression_tests/energy_cutoff/test.py b/tests/regression_tests/energy_cutoff/test.py index d76edd9a0..e05d17f5f 100755 --- a/tests/regression_tests/energy_cutoff/test.py +++ b/tests/regression_tests/energy_cutoff/test.py @@ -4,7 +4,8 @@ from tests.testing_harness import PyAPITestHarness class EnergyCutoffTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # Set energy cutoff energy_cutoff = 4.0 @@ -12,8 +13,7 @@ class EnergyCutoffTestHarness(PyAPITestHarness): mat = openmc.Material(material_id=1, name='mat') mat.set_density('atom/b-cm', 0.069335) mat.add_nuclide('H1', 40.0) - materials_file = openmc.Materials([mat]) - materials_file.export_to_xml() + self._model.materials = openmc.Materials([mat]) # Cell is box with reflective boundary x1 = openmc.XPlane(surface_id=1, x0=-1) @@ -29,8 +29,7 @@ class EnergyCutoffTestHarness(PyAPITestHarness): box.fill = mat root = openmc.Universe(universe_id=0, name='root universe') root.add_cell(box) - geometry = openmc.Geometry(root) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root) # Set the running parameters settings_file = openmc.Settings() @@ -43,7 +42,7 @@ class EnergyCutoffTestHarness(PyAPITestHarness): watt_dist = openmc.stats.Watt() settings_file.source = openmc.source.Source(space=uniform_dist, energy=watt_dist) - settings_file.export_to_xml() + self._model.settings = settings_file # Tally flux under energy cutoff tallies = openmc.Tallies() @@ -52,7 +51,7 @@ class EnergyCutoffTestHarness(PyAPITestHarness): energy_filter = openmc.filter.EnergyFilter((0.0, energy_cutoff)) tally.filters = [energy_filter] tallies.append(tally) - tallies.export_to_xml() + self._model.tallies = tallies def _get_results(self): """Digest info in the statepoint and return as a string.""" @@ -70,5 +69,5 @@ class EnergyCutoffTestHarness(PyAPITestHarness): def test_energy_cutoff(): - harness = EnergyCutoffTestHarness('statepoint.10.h5') + harness = EnergyCutoffTestHarness('statepoint.10.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/energy_laws/inputs_true.dat b/tests/regression_tests/energy_laws/inputs_true.dat index 2320b21d5..c89ccc97e 100644 --- a/tests/regression_tests/energy_laws/inputs_true.dat +++ b/tests/regression_tests/energy_laws/inputs_true.dat @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + diff --git a/tests/regression_tests/external_moab/inputs_true.dat b/tests/regression_tests/external_moab/inputs_true.dat index af259eee4..2bcbad0df 100644 --- a/tests/regression_tests/external_moab/inputs_true.dat +++ b/tests/regression_tests/external_moab/inputs_true.dat @@ -1,73 +1,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - 0.0 0.0 0.0 - - - - 15000000.0 1.0 - - - - - - - test_mesh_tets.h5m - - - 1 - - - 1 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 100 + 10 + + + 0.0 0.0 0.0 + + + + 15000000.0 1.0 + + + + + + test_mesh_tets.h5m + + + 1 + + + 1 + flux + tracklength + + + diff --git a/tests/regression_tests/external_moab/test.py b/tests/regression_tests/external_moab/test.py index b9d307239..12e0e5425 100644 --- a/tests/regression_tests/external_moab/test.py +++ b/tests/regression_tests/external_moab/test.py @@ -162,8 +162,6 @@ def test_external_mesh(cpp_driver): water_mat.set_density("atom/b-cm", 0.07416) materials.append(water_mat) - materials.export_to_xml() - # Geometry fuel_min_x = openmc.XPlane(-5.0, name="minimum x") fuel_max_x = openmc.XPlane(5.0, name="maximum x") diff --git a/tests/regression_tests/filter_cellinstance/inputs_true.dat b/tests/regression_tests/filter_cellinstance/inputs_true.dat index f9d3ca58d..d00aae75d 100644 --- a/tests/regression_tests/filter_cellinstance/inputs_true.dat +++ b/tests/regression_tests/filter_cellinstance/inputs_true.dat @@ -1,65 +1,64 @@ - - - - - - - - - 2 2 - 4 4 - -4 -4 - + + + + + + + + + + + + + + + + + + + + 2 2 + 4 4 + -4 -4 + 2 3 3 3 3 2 3 3 3 3 2 3 3 3 3 2 - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - 0.0 0.0 0.0 - - - - - - - 4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 4 11 2 0 2 1 2 2 2 3 3 0 3 1 3 2 3 3 - - - 3 3 3 2 3 1 3 0 2 3 2 2 2 1 2 0 4 11 4 10 4 9 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0 - - - 1 - total - - - 2 - total - - + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + 0.0 0.0 0.0 + + + + + + 4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 4 11 2 0 2 1 2 2 2 3 3 0 3 1 3 2 3 3 + + + 3 3 3 2 3 1 3 0 2 3 2 2 2 1 2 0 4 11 4 10 4 9 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0 + + + 1 + total + + + 2 + total + + + diff --git a/tests/regression_tests/filter_energyfun/inputs_true.dat b/tests/regression_tests/filter_energyfun/inputs_true.dat index db7f91ed0..706c70e34 100644 --- a/tests/regression_tests/filter_energyfun/inputs_true.dat +++ b/tests/regression_tests/filter_energyfun/inputs_true.dat @@ -1,106 +1,105 @@ - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - - - 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 - 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 - linear-linear - - - 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 - 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 - log-log - - - 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 - 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 - linear-log - - - 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 - 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 - log-linear - - - 0.0 5000000.0 10000000.0 15000000.0 - 0.2 0.7 0.7 0.2 - linear-linear - - - 0.0 5000000.0 10000000.0 15000000.0 - 0.2 0.7 0.7 0.2 - quadratic - - - 0.0 5000000.0 10000000.0 15000000.0 - 0.2 0.7 0.7 0.2 - cubic - - - 0.0 5000000.0 10000000.0 15000000.0 - 0.2 0.7 0.7 0.2 - histogram - - - Am241 - (n,gamma) - - - 1 - Am241 - (n,gamma) - - - 3 - Am241 - (n,gamma) - - - 4 - Am241 - (n,gamma) - - - 5 - Am241 - (n,gamma) - - - 6 - Am241 - (n,gamma) - - - 7 - Am241 - (n,gamma) - - - 8 - Am241 - (n,gamma) - - - 9 - Am241 - (n,gamma) - - + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + + 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 + 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 + linear-linear + + + 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 + 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 + log-log + + + 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 + 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 + linear-log + + + 1e-05 0.369 1000.0 100000.0 600000.0 1000000.0 2000000.0 4000000.0 30000000.0 + 0.1 0.1 0.1333 0.158 0.18467 0.25618 0.4297 0.48 0.48 + log-linear + + + 0.0 5000000.0 10000000.0 15000000.0 + 0.2 0.7 0.7 0.2 + linear-linear + + + 0.0 5000000.0 10000000.0 15000000.0 + 0.2 0.7 0.7 0.2 + quadratic + + + 0.0 5000000.0 10000000.0 15000000.0 + 0.2 0.7 0.7 0.2 + cubic + + + 0.0 5000000.0 10000000.0 15000000.0 + 0.2 0.7 0.7 0.2 + histogram + + + Am241 + (n,gamma) + + + 1 + Am241 + (n,gamma) + + + 3 + Am241 + (n,gamma) + + + 4 + Am241 + (n,gamma) + + + 5 + Am241 + (n,gamma) + + + 6 + Am241 + (n,gamma) + + + 7 + Am241 + (n,gamma) + + + 8 + Am241 + (n,gamma) + + + 9 + Am241 + (n,gamma) + + + diff --git a/tests/regression_tests/filter_mesh/inputs_true.dat b/tests/regression_tests/filter_mesh/inputs_true.dat index 8b08a2a3c..d0b617903 100644 --- a/tests/regression_tests/filter_mesh/inputs_true.dat +++ b/tests/regression_tests/filter_mesh/inputs_true.dat @@ -1,152 +1,151 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - - - 5 - -7.5 - 7.5 - - - 5 5 - -7.5 -7.5 - 7.5 7.5 - - - 5 5 5 - -7.5 -7.5 -7.5 - 7.5 7.5 7.5 - - - -7.5 -6.617647058823529 -5.735294117647059 -4.852941176470589 -3.9705882352941178 -3.0882352941176467 -2.2058823529411766 -1.3235294117647065 -0.4411764705882355 0.4411764705882355 1.3235294117647065 2.2058823529411757 3.0882352941176467 3.9705882352941178 4.852941176470587 5.735294117647058 6.617647058823529 7.5 - -7.5 -6.617647058823529 -5.735294117647059 -4.852941176470589 -3.9705882352941178 -3.0882352941176467 -2.2058823529411766 -1.3235294117647065 -0.4411764705882355 0.4411764705882355 1.3235294117647065 2.2058823529411757 3.0882352941176467 3.9705882352941178 4.852941176470587 5.735294117647058 6.617647058823529 7.5 - 1.0 1.223224374241637 1.4962778697388448 1.8302835609029084 2.2388474634702153 2.7386127875258306 3.3499379133114306 4.09772570775871 5.012437964687018 6.131336292779302 7.500000000000001 - - - 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 - 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 - -7.5 -6.5625 -5.625 -4.6875 -3.75 -2.8125 -1.875 -0.9375 0.0 0.9375 1.875 2.8125 3.75 4.6875 5.625 6.5625 7.5 - 0.0 0.0 0.0 - - - 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 - 0.0 0.39269908169872414 0.7853981633974483 1.1780972450961724 1.5707963267948966 1.9634954084936207 2.356194490192345 2.748893571891069 3.141592653589793 - 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 - 0.0 0.0 0.0 - - - 1 - - - 1 - - - 2 - - - 2 - - - 3 - - - 3 - - - 4 - - - 4 - - - 5 - - - 5 - - - 6 - - - 6 - - - 1 - total - - - 7 - current - - - 2 - total - - - 8 - current - - - 3 - total - - - 9 - current - - - 4 - total - - - 10 - current - - - 5 - total - - - 11 - current - - - 6 - total - - - 12 - current - - + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + + 5 + -7.5 + 7.5 + + + 5 5 + -7.5 -7.5 + 7.5 7.5 + + + 5 5 5 + -7.5 -7.5 -7.5 + 7.5 7.5 7.5 + + + -7.5 -6.617647058823529 -5.735294117647059 -4.852941176470589 -3.9705882352941178 -3.0882352941176467 -2.2058823529411766 -1.3235294117647065 -0.4411764705882355 0.4411764705882355 1.3235294117647065 2.2058823529411757 3.0882352941176467 3.9705882352941178 4.852941176470587 5.735294117647058 6.617647058823529 7.5 + -7.5 -6.617647058823529 -5.735294117647059 -4.852941176470589 -3.9705882352941178 -3.0882352941176467 -2.2058823529411766 -1.3235294117647065 -0.4411764705882355 0.4411764705882355 1.3235294117647065 2.2058823529411757 3.0882352941176467 3.9705882352941178 4.852941176470587 5.735294117647058 6.617647058823529 7.5 + 1.0 1.223224374241637 1.4962778697388448 1.8302835609029084 2.2388474634702153 2.7386127875258306 3.3499379133114306 4.09772570775871 5.012437964687018 6.131336292779302 7.500000000000001 + + + 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 + 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 + -7.5 -6.5625 -5.625 -4.6875 -3.75 -2.8125 -1.875 -0.9375 0.0 0.9375 1.875 2.8125 3.75 4.6875 5.625 6.5625 7.5 + 0.0 0.0 0.0 + + + 0.0 0.4411764705882353 0.8823529411764706 1.3235294117647058 1.7647058823529411 2.2058823529411766 2.6470588235294117 3.0882352941176467 3.5294117647058822 3.9705882352941178 4.411764705882353 4.852941176470588 5.294117647058823 5.735294117647059 6.1764705882352935 6.617647058823529 7.0588235294117645 7.5 + 0.0 0.39269908169872414 0.7853981633974483 1.1780972450961724 1.5707963267948966 1.9634954084936207 2.356194490192345 2.748893571891069 3.141592653589793 + 0.0 0.3490658503988659 0.6981317007977318 1.0471975511965976 1.3962634015954636 1.7453292519943295 2.0943951023931953 2.443460952792061 2.792526803190927 3.141592653589793 3.490658503988659 3.839724354387525 4.1887902047863905 4.537856055185257 4.886921905584122 5.235987755982989 5.585053606381854 5.93411945678072 6.283185307179586 + 0.0 0.0 0.0 + + + 1 + + + 1 + + + 2 + + + 2 + + + 3 + + + 3 + + + 4 + + + 4 + + + 5 + + + 5 + + + 6 + + + 6 + + + 1 + total + + + 7 + current + + + 2 + total + + + 8 + current + + + 3 + total + + + 9 + current + + + 4 + total + + + 10 + current + + + 5 + total + + + 11 + current + + + 6 + total + + + 12 + current + + + diff --git a/tests/regression_tests/filter_translations/inputs_true.dat b/tests/regression_tests/filter_translations/inputs_true.dat index d38bec39f..8ed705413 100644 --- a/tests/regression_tests/filter_translations/inputs_true.dat +++ b/tests/regression_tests/filter_translations/inputs_true.dat @@ -1,84 +1,83 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - - - 3 4 5 - -9 -9 -9 - 9 9 9 - - - -9.0 0.0 9.0 - -9.0 -3.0 3.0 9.0 - -9.0 -4.5 0.0 4.5 9.0 - - - 3 4 5 - -19 -4 -9 - -1 14 9 - - - -19.0 -10.0 -1.0 - -4.0 2.0 8.0 14.0 - -9.0 -4.5 0.0 4.5 9.0 - - - 1 - - - 2 - - - 3 - - - 4 - - - 1 - total - - - 2 - total - - - 3 - total - - - 4 - total - - + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + + 3 4 5 + -9 -9 -9 + 9 9 9 + + + -9.0 0.0 9.0 + -9.0 -3.0 3.0 9.0 + -9.0 -4.5 0.0 4.5 9.0 + + + 3 4 5 + -19 -4 -9 + -1 14 9 + + + -19.0 -10.0 -1.0 + -4.0 2.0 8.0 14.0 + -9.0 -4.5 0.0 4.5 9.0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 1 + total + + + 2 + total + + + 3 + total + + + 4 + total + + + diff --git a/tests/regression_tests/fixed_source/inputs_true.dat b/tests/regression_tests/fixed_source/inputs_true.dat index f1aebb3b2..57dcdb724 100644 --- a/tests/regression_tests/fixed_source/inputs_true.dat +++ b/tests/regression_tests/fixed_source/inputs_true.dat @@ -1,31 +1,30 @@ - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - 0.0 0.0 0.0 - - - 294 - - - - - flux - - + + + + + + + + + + + + + + fixed source + 100 + 10 + + + 0.0 0.0 0.0 + + + 294 + + + + flux + + + diff --git a/tests/regression_tests/iso_in_lab/inputs_true.dat b/tests/regression_tests/iso_in_lab/inputs_true.dat index 2a302ada6..6dd8578ff 100644 --- a/tests/regression_tests/iso_in_lab/inputs_true.dat +++ b/tests/regression_tests/iso_in_lab/inputs_true.dat @@ -1,38 +1,199 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + + + + + + + + U234 U235 U238 Xe135 O16 + + + + + + + + + Zr90 Zr91 Zr92 Zr94 Zr96 + + + + + + + + + H1 O16 B10 B11 + + + + + + + + + H1 O16 B10 B11 + + + + + + + + + + + + + + Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Mn55 Cr52 C0 Cu63 + + + + + + + + + + + + + + + + H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 + + + + + + + + + + + + + + + + H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 + + + + + + + + + + + + + + + + H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 + + + + + + + + + + + + + + + + H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 + + + + + + + + + + + + + + + + H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 + + + + + + + + + + + + + + H1 O16 B10 B11 Zr90 Zr91 Zr92 Zr94 Zr96 + + + + + + + + + + + + + + H1 O16 B10 B11 Zr90 Zr91 Zr92 Zr94 Zr96 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 @@ -50,12 +211,12 @@ 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 @@ -73,12 +234,12 @@ 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 @@ -100,12 +261,12 @@ 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 @@ -127,195 +288,34 @@ 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - U234 U235 U238 Xe135 O16 - - - - - - - - - Zr90 Zr91 Zr92 Zr94 Zr96 - - - - - - - - - H1 O16 B10 B11 - - - - - - - - - H1 O16 B10 B11 - - - - - - - - - - - - - - Fe54 Fe56 Fe57 Fe58 Ni58 Ni60 Mn55 Cr52 C0 Cu63 - - - - - - - - - - - - - - - - H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 - - - - - - - - - - - - - - - - H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 - - - - - - - - - - - - - - - - H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 - - - - - - - - - - - - - - - - H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 - - - - - - - - - - - - - - - - H1 O16 B10 B11 Fe54 Fe56 Fe57 Fe58 Ni58 Mn55 Cr52 - - - - - - - - - - - - - - H1 O16 B10 B11 Zr90 Zr91 Zr92 Zr94 Zr96 - - - - - - - - - - - - - - H1 O16 B10 B11 Zr90 Zr91 Zr92 Zr94 Zr96 - - - - - eigenvalue - 100 - 10 - 5 - - - -160 -160 -183 160 160 183 - - - + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -160 -160 -183 160 160 183 + + + + diff --git a/tests/regression_tests/lattice_hex_coincident/inputs_true.dat b/tests/regression_tests/lattice_hex_coincident/inputs_true.dat index 0388a4f55..639235726 100644 --- a/tests/regression_tests/lattice_hex_coincident/inputs_true.dat +++ b/tests/regression_tests/lattice_hex_coincident/inputs_true.dat @@ -1,81 +1,81 @@ - - - - - - - - - - - 1.4 - 11 -
0.0 0.0
- - 10 -10 10 - 9 -10 10 - 10 -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 2 - - - -0.9899494936611666 -0.9899494936611666 0.0 0.9899494936611666 0.9899494936611666 10.0 - - - - false - - 22 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.4 + 3 +
0.0 0.0
+ + 2 +2 2 + 1 +2 2 + 2 +
+ + + + + + + + + + + + +
+ + eigenvalue + 1000 + 5 + 2 + + + -0.9899494936611666 -0.9899494936611666 0.0 0.9899494936611666 0.9899494936611666 10.0 + + + + false + + 22 + +
diff --git a/tests/regression_tests/lattice_hex_coincident/test.py b/tests/regression_tests/lattice_hex_coincident/test.py index 30bc470f2..fae7f939b 100644 --- a/tests/regression_tests/lattice_hex_coincident/test.py +++ b/tests/regression_tests/lattice_hex_coincident/test.py @@ -6,7 +6,8 @@ from tests.testing_harness import PyAPITestHarness class HexLatticeCoincidentTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) materials = openmc.Materials() fuel_mat = openmc.Material() @@ -40,7 +41,7 @@ class HexLatticeCoincidentTestHarness(PyAPITestHarness): zirc.add_nuclide('Zr96', 1.131E-03, 'ao') materials.append(zirc) - materials.export_to_xml() + self._model.materials = materials ### Geometry ### pin_rad = 0.7 # cm @@ -124,8 +125,7 @@ class HexLatticeCoincidentTestHarness(PyAPITestHarness): root_univ = openmc.Universe(name="root universe", cells=[pincell_only_cell,]) - geom = openmc.Geometry(root_univ) - geom.export_to_xml() + self._model.geometry = openmc.Geometry(root_univ) ### Settings ### @@ -144,8 +144,9 @@ class HexLatticeCoincidentTestHarness(PyAPITestHarness): settings.inactive = 2 settings.particles = 1000 settings.seed = 22 - settings.export_to_xml() + self._model.settings = settings def test_lattice_hex_coincident_surf(): - harness = HexLatticeCoincidentTestHarness('statepoint.5.h5') + harness = HexLatticeCoincidentTestHarness('statepoint.5.h5', + model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/lattice_hex_x/inputs_true.dat b/tests/regression_tests/lattice_hex_x/inputs_true.dat index b528a97b7..2cff10f75 100644 --- a/tests/regression_tests/lattice_hex_x/inputs_true.dat +++ b/tests/regression_tests/lattice_hex_x/inputs_true.dat @@ -1,23 +1,53 @@ - - - - - - - - - - - - - - - - 1.235 5.0 - 4 -
0.0 0.0 5.0
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.235 5.0 + 4 +
0.0 0.0 5.0
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 @@ -60,64 +90,34 @@ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - -13.62546635287517 -13.62546635287517 0.0 13.62546635287517 13.62546635287517 10.0 - - - 22 - +
+ + + + + + + + + + + + + + + + +
+ + eigenvalue + 1000 + 10 + 5 + + + -13.62546635287517 -13.62546635287517 0.0 13.62546635287517 13.62546635287517 10.0 + + + 22 + + diff --git a/tests/regression_tests/lattice_hex_x/test.py b/tests/regression_tests/lattice_hex_x/test.py index ecb27c9c2..e582c68ae 100644 --- a/tests/regression_tests/lattice_hex_x/test.py +++ b/tests/regression_tests/lattice_hex_x/test.py @@ -4,8 +4,8 @@ import numpy as np class HexLatticeOXTestHarness(PyAPITestHarness): - - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) materials = openmc.Materials() fuel_mat = openmc.Material(material_id=1, name="UO2") @@ -35,7 +35,7 @@ class HexLatticeOXTestHarness(PyAPITestHarness): zirc.add_element('Zr', 4.23e-2) materials.append(zirc) - materials.export_to_xml() + self._model.materials = materials # Geometry # @@ -165,7 +165,7 @@ class HexLatticeOXTestHarness(PyAPITestHarness): (4, 21), (5, 20), (4, 27), (5, 25), (4, 33)] for i, j in channels: universes[i][j] = abs_ch_univ - lattice = openmc.HexLattice(name="regular fuel assembly") + lattice = openmc.HexLattice(lattice_id=6, name="regular fuel assembly") lattice.orientation = "x" lattice.center = (0., 0., length/2.0) lattice.pitch = (assembly_pitch, length/2.0) @@ -180,8 +180,7 @@ class HexLatticeOXTestHarness(PyAPITestHarness): root_univ = openmc.Universe(universe_id=5, name="root universe", cells=[assembly_cell]) - geom = openmc.Geometry(root_univ) - geom.export_to_xml() + self._model.geometry = openmc.Geometry(root_univ) # Settings # @@ -198,9 +197,9 @@ class HexLatticeOXTestHarness(PyAPITestHarness): settings.inactive = 5 settings.particles = 1000 settings.seed = 22 - settings.export_to_xml() + self._model.settings = settings def test_lattice_hex_ox_surf(): - harness = HexLatticeOXTestHarness('statepoint.10.h5') + harness = HexLatticeOXTestHarness('statepoint.10.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/lattice_multiple/inputs_true.dat b/tests/regression_tests/lattice_multiple/inputs_true.dat index c92e841bc..0eed3c201 100644 --- a/tests/regression_tests/lattice_multiple/inputs_true.dat +++ b/tests/regression_tests/lattice_multiple/inputs_true.dat @@ -1,53 +1,53 @@ - - - - - - - - - 1.2 1.2 - 1 - 2 2 - -1.2 -1.2 - + + + + + + + + + + + + + + + + + + + + + + + 1.2 1.2 + 1 + 2 2 + -1.2 -1.2 + 2 1 1 1 - - - 2.4 2.4 - 2 2 - -2.4 -2.4 - + + + 2.4 2.4 + 2 2 + -2.4 -2.4 + 4 4 4 4 - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + diff --git a/tests/regression_tests/lattice_rotated/inputs_true.dat b/tests/regression_tests/lattice_rotated/inputs_true.dat index 8ee34b4f3..8e54bdf88 100644 --- a/tests/regression_tests/lattice_rotated/inputs_true.dat +++ b/tests/regression_tests/lattice_rotated/inputs_true.dat @@ -1,18 +1,35 @@ - - - - - - - - - - - 1.25 - 30 -
0.0 0.0
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.25 + 30 +
0.0 0.0
+ 2 1 1 1 2 1 @@ -22,50 +39,33 @@ 1 1 1 1 1 1 -
- - 1.25 1.25 - 30 - 4 4 - -2.5 -2.5 - +
+ + 1.25 1.25 + 30 + 4 4 + -2.5 -2.5 + 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 - - - - - - -
- - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - 0.0 0.0 0.0 - - - + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + 0.0 0.0 0.0 + + + + diff --git a/tests/regression_tests/mg_basic/inputs_true.dat b/tests/regression_tests/mg_basic/inputs_true.dat index 4f2fd3f0b..06406b5f2 100644 --- a/tests/regression_tests/mg_basic/inputs_true.dat +++ b/tests/regression_tests/mg_basic/inputs_true.dat @@ -1,64 +1,64 @@ - - - - - - - - - - - - - - - - - - 2g.h5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - 0.0 -1000.0 -1000.0 154.90833333333333 1000.0 1000.0 - - - - false - - multi-group - - false - - + + + 2g.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + 0.0 -1000.0 -1000.0 154.90833333333333 1000.0 1000.0 + + + + false + + multi-group + + false + + + diff --git a/tests/regression_tests/mg_basic_delayed/inputs_true.dat b/tests/regression_tests/mg_basic_delayed/inputs_true.dat index 9fb7afe7e..05108d87d 100644 --- a/tests/regression_tests/mg_basic_delayed/inputs_true.dat +++ b/tests/regression_tests/mg_basic_delayed/inputs_true.dat @@ -1,63 +1,63 @@ - - - - - - - - - - - - - - - - - - 2g.h5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - 0.0 -1000.0 -1000.0 154.90833333333333 1000.0 1000.0 - - - - false - - multi-group - - false - - + + + 2g.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + 0.0 -1000.0 -1000.0 154.90833333333333 1000.0 1000.0 + + + + false + + multi-group + + false + + + diff --git a/tests/regression_tests/mg_convert/inputs_true.dat b/tests/regression_tests/mg_convert/inputs_true.dat index 753c0d304..9276a7a7b 100644 --- a/tests/regression_tests/mg_convert/inputs_true.dat +++ b/tests/regression_tests/mg_convert/inputs_true.dat @@ -1,29 +1,29 @@ - - - - - - - - - - mgxs.h5 - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -5 -5 -5 5 5 5 - - - multi-group - + + + mgxs.h5 + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -5 -5 -5 5 5 5 + + + multi-group + + diff --git a/tests/regression_tests/mg_convert/test.py b/tests/regression_tests/mg_convert/test.py index c6ab485ea..d9c4a57bd 100755 --- a/tests/regression_tests/mg_convert/test.py +++ b/tests/regression_tests/mg_convert/test.py @@ -61,7 +61,8 @@ def build_mgxs_library(convert): class MGXSTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # Instantiate some Macroscopic Data uo2_data = openmc.Macroscopic('UO2') @@ -73,7 +74,7 @@ class MGXSTestHarness(PyAPITestHarness): # Instantiate a Materials collection and export to XML materials_file = openmc.Materials([mat]) materials_file.cross_sections = "./mgxs.h5" - materials_file.export_to_xml() + self._model.materials = materials_file # Instantiate ZCylinder surfaces left = openmc.XPlane(surface_id=4, x0=-5., name='left') @@ -102,8 +103,7 @@ class MGXSTestHarness(PyAPITestHarness): root.add_cells([fuel]) # Instantiate a Geometry, register the root Universe, and export to XML - geometry = openmc.Geometry(root) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root) settings_file = openmc.Settings() settings_file.energy_mode = "multi-group" @@ -116,7 +116,7 @@ class MGXSTestHarness(PyAPITestHarness): uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:]) settings_file.source = openmc.source.Source(space=uniform_dist) - settings_file.export_to_xml() + self._model.settings = settings_file def _run_openmc(self): # Run multiple conversions to compare results @@ -194,5 +194,5 @@ class MGXSTestHarness(PyAPITestHarness): def test_mg_convert(): - harness = MGXSTestHarness('statepoint.10.h5') + harness = MGXSTestHarness('statepoint.10.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/mg_legendre/inputs_true.dat b/tests/regression_tests/mg_legendre/inputs_true.dat index ad3b434e6..d90dfb802 100644 --- a/tests/regression_tests/mg_legendre/inputs_true.dat +++ b/tests/regression_tests/mg_legendre/inputs_true.dat @@ -1,33 +1,33 @@ - - - - - - - - 2g.h5 - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 - - - - false - - multi-group - - false - - + + + 2g.h5 + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 + + + + false + + multi-group + + false + + + diff --git a/tests/regression_tests/mg_max_order/inputs_true.dat b/tests/regression_tests/mg_max_order/inputs_true.dat index 2ac83852c..9bfcd54df 100644 --- a/tests/regression_tests/mg_max_order/inputs_true.dat +++ b/tests/regression_tests/mg_max_order/inputs_true.dat @@ -1,34 +1,34 @@ - - - - - - - - 2g.h5 - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 - - - - false - - multi-group - 1 - - false - - + + + 2g.h5 + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 + + + + false + + multi-group + 1 + + false + + + diff --git a/tests/regression_tests/mg_survival_biasing/inputs_true.dat b/tests/regression_tests/mg_survival_biasing/inputs_true.dat index 5ece3ce9f..a3a2a726f 100644 --- a/tests/regression_tests/mg_survival_biasing/inputs_true.dat +++ b/tests/regression_tests/mg_survival_biasing/inputs_true.dat @@ -1,34 +1,34 @@ - - - - - - - - 2g.h5 - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 - - - - false - - multi-group - true - - false - - + + + 2g.h5 + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 + + + + false + + multi-group + true + + false + + + diff --git a/tests/regression_tests/mg_tallies/inputs_true.dat b/tests/regression_tests/mg_tallies/inputs_true.dat index 562958722..bdd41c7f8 100644 --- a/tests/regression_tests/mg_tallies/inputs_true.dat +++ b/tests/regression_tests/mg_tallies/inputs_true.dat @@ -1,165 +1,164 @@ - - - - - - - - 2g.h5 - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 - - - - false - - multi-group - - false - - - - - - 10 1 1 - 0.0 0.0 0.0 - 929.45 1000 1000 - - - 1 - - - 1 - - - 0.0 20000000.0 - - - 0.0 20000000.0 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 5 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux - analog - - - 5 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux - tracklength - - - 6 1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux scatter nu-scatter - analog - - - 6 1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux - collision - - - 6 1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux - tracklength - - - 6 1 2 - scatter nu-scatter nu-fission - - - 6 3 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux scatter nu-scatter - analog - - - 6 3 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux - collision - - - 6 3 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux - tracklength - - - 6 3 4 - scatter nu-scatter nu-fission - - - 5 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate - analog - - - 5 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate - tracklength - - - 6 1 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate scatter nu-scatter - analog - - - 6 1 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate - collision - - - 6 1 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate - tracklength - - - 6 1 2 - mat_1 - scatter nu-scatter nu-fission - - - 6 3 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate scatter nu-scatter - analog - - - 6 3 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate - collision - - - 6 3 - mat_1 - total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate - tracklength - - - 6 3 4 - mat_1 - scatter nu-scatter nu-fission - - + + + 2g.h5 + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 + + + + false + + multi-group + + false + + + + + 10 1 1 + 0.0 0.0 0.0 + 929.45 1000 1000 + + + 1 + + + 1 + + + 0.0 20000000.0 + + + 0.0 20000000.0 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 5 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux + analog + + + 5 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux + tracklength + + + 6 1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux scatter nu-scatter + analog + + + 6 1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux + collision + + + 6 1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux + tracklength + + + 6 1 2 + scatter nu-scatter nu-fission + + + 6 3 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux scatter nu-scatter + analog + + + 6 3 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux + collision + + + 6 3 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate flux + tracklength + + + 6 3 4 + scatter nu-scatter nu-fission + + + 5 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate + analog + + + 5 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate + tracklength + + + 6 1 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate scatter nu-scatter + analog + + + 6 1 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate + collision + + + 6 1 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate + tracklength + + + 6 1 2 + mat_1 + scatter nu-scatter nu-fission + + + 6 3 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate scatter nu-scatter + analog + + + 6 3 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate + collision + + + 6 3 + mat_1 + total absorption fission nu-fission inverse-velocity prompt-nu-fission delayed-nu-fission kappa-fission events decay-rate + tracklength + + + 6 3 4 + mat_1 + scatter nu-scatter nu-fission + + + diff --git a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat index bc5c4b2d4..533160577 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat @@ -1,251 +1,250 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 3 - - - 2 - - - 3 - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - flux - analog - - - 1 2 7 - total - nu-fission - analog - - - 1 2 - total - flux - analog - - - 1 2 7 11 - total - nu-scatter - analog - - - 1 2 7 - total - nu-scatter - analog - - - 1 2 7 - total - scatter - analog - - - 15 2 - total - flux - tracklength - - - 15 2 - total - total - tracklength - - - 15 2 - total - flux - tracklength - - - 15 2 - total - absorption - tracklength - - - 15 2 - total - flux - analog - - - 15 2 7 - total - nu-fission - analog - - - 15 2 - total - flux - analog - - - 15 2 7 11 - total - nu-scatter - analog - - - 15 2 7 - total - nu-scatter - analog - - - 15 2 7 - total - scatter - analog - - - 29 2 - total - flux - tracklength - - - 29 2 - total - total - tracklength - - - 29 2 - total - flux - tracklength - - - 29 2 - total - absorption - tracklength - - - 29 2 - total - flux - analog - - - 29 2 7 - total - nu-fission - analog - - - 29 2 - total - flux - analog - - - 29 2 7 11 - total - nu-scatter - analog - - - 29 2 7 - total - nu-scatter - analog - - - 29 2 7 - total - scatter - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 3 + + + 2 + + + 3 + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + flux + analog + + + 1 2 7 + total + nu-fission + analog + + + 1 2 + total + flux + analog + + + 1 2 7 11 + total + nu-scatter + analog + + + 1 2 7 + total + nu-scatter + analog + + + 1 2 7 + total + scatter + analog + + + 15 2 + total + flux + tracklength + + + 15 2 + total + total + tracklength + + + 15 2 + total + flux + tracklength + + + 15 2 + total + absorption + tracklength + + + 15 2 + total + flux + analog + + + 15 2 7 + total + nu-fission + analog + + + 15 2 + total + flux + analog + + + 15 2 7 11 + total + nu-scatter + analog + + + 15 2 7 + total + nu-scatter + analog + + + 15 2 7 + total + scatter + analog + + + 29 2 + total + flux + tracklength + + + 29 2 + total + total + tracklength + + + 29 2 + total + flux + tracklength + + + 29 2 + total + absorption + tracklength + + + 29 2 + total + flux + analog + + + 29 2 7 + total + nu-fission + analog + + + 29 2 + total + flux + analog + + + 29 2 7 11 + total + nu-scatter + analog + + + 29 2 7 + total + nu-scatter + analog + + + 29 2 7 + total + scatter + analog + + + diff --git a/tests/regression_tests/mgxs_library_ce_to_mg/test.py b/tests/regression_tests/mgxs_library_ce_to_mg/test.py index 72f052e68..4dff67323 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg/test.py +++ b/tests/regression_tests/mgxs_library_ce_to_mg/test.py @@ -48,15 +48,12 @@ class MGXSTestHarness(PyAPITestHarness): # Modify materials and settings so we can run in MG mode self._model.materials.cross_sections = './mgxs.h5' self._model.settings.energy_mode = 'multi-group' + # Dont need tallies so clear them from the model + self._model.tallies = openmc.Tallies() # Write modified input files - self._model.settings.export_to_xml() - self._model.geometry.export_to_xml() - self._model.materials.export_to_xml() + self._model.export_to_model_xml() self._model.mgxs_file.export_to_hdf5() - # Dont need tallies.xml, so remove the file - if os.path.exists('tallies.xml'): - os.remove('tallies.xml') # Enforce closing statepoint and summary files so HDF5 # does not throw an error during the next OpenMC execution diff --git a/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat index 576f27966..fe154a018 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat @@ -1,251 +1,250 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 3 - - - 2 - - - 3 - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - absorption - tracklength - - - 1 2 - total - flux - analog - - - 1 2 7 - U234 U235 U238 O16 - nu-fission - analog - - - 1 2 - total - flux - analog - - - 1 2 7 11 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 2 7 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 2 7 - U234 U235 U238 O16 - scatter - analog - - - 15 2 - total - flux - tracklength - - - 15 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total - tracklength - - - 15 2 - total - flux - tracklength - - - 15 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - absorption - tracklength - - - 15 2 - total - flux - analog - - - 15 2 7 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission - analog - - - 15 2 - total - flux - analog - - - 15 2 7 11 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 15 2 7 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 15 2 7 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 29 2 - total - flux - tracklength - - - 29 2 - H1 O16 B10 B11 - total - tracklength - - - 29 2 - total - flux - tracklength - - - 29 2 - H1 O16 B10 B11 - absorption - tracklength - - - 29 2 - total - flux - analog - - - 29 2 7 - H1 O16 B10 B11 - nu-fission - analog - - - 29 2 - total - flux - analog - - - 29 2 7 11 - H1 O16 B10 B11 - nu-scatter - analog - - - 29 2 7 - H1 O16 B10 B11 - nu-scatter - analog - - - 29 2 7 - H1 O16 B10 B11 - scatter - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 3 + + + 2 + + + 3 + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + absorption + tracklength + + + 1 2 + total + flux + analog + + + 1 2 7 + U234 U235 U238 O16 + nu-fission + analog + + + 1 2 + total + flux + analog + + + 1 2 7 11 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 2 7 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 2 7 + U234 U235 U238 O16 + scatter + analog + + + 15 2 + total + flux + tracklength + + + 15 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total + tracklength + + + 15 2 + total + flux + tracklength + + + 15 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + absorption + tracklength + + + 15 2 + total + flux + analog + + + 15 2 7 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-fission + analog + + + 15 2 + total + flux + analog + + + 15 2 7 11 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 15 2 7 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 15 2 7 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 29 2 + total + flux + tracklength + + + 29 2 + H1 O16 B10 B11 + total + tracklength + + + 29 2 + total + flux + tracklength + + + 29 2 + H1 O16 B10 B11 + absorption + tracklength + + + 29 2 + total + flux + analog + + + 29 2 7 + H1 O16 B10 B11 + nu-fission + analog + + + 29 2 + total + flux + analog + + + 29 2 7 11 + H1 O16 B10 B11 + nu-scatter + analog + + + 29 2 7 + H1 O16 B10 B11 + nu-scatter + analog + + + 29 2 7 + H1 O16 B10 B11 + scatter + analog + + + diff --git a/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/test.py b/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/test.py index b624140d4..ee0cdf0d9 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/test.py +++ b/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/test.py @@ -48,15 +48,12 @@ class MGXSTestHarness(PyAPITestHarness): # Modify materials and settings so we can run in MG mode self._model.materials.cross_sections = './mgxs.h5' self._model.settings.energy_mode = 'multi-group' + # Dont need tallies so clear them from the model + self._model.tallies = openmc.Tallies() # Write modified input files - self._model.settings.export_to_xml() - self._model.geometry.export_to_xml() - self._model.materials.export_to_xml() + self._model.export_to_model_xml() self._model.mgxs_file.export_to_hdf5() - # Dont need tallies.xml, so remove the file - if os.path.exists('tallies.xml'): - os.remove('tallies.xml') # Enforce closing statepoint and summary files so HDF5 # does not throw an error during the next OpenMC execution diff --git a/tests/regression_tests/mgxs_library_condense/inputs_true.dat b/tests/regression_tests/mgxs_library_condense/inputs_true.dat index cac18ffcd..c8f140f80 100644 --- a/tests/regression_tests/mgxs_library_condense/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_condense/inputs_true.dat @@ -1,532 +1,531 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 2 2 - -100.0 -100.0 - 100.0 100.0 - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 1 - - - 3 - - - 0.0 20000000.0 - - - 1 - - - 1 2 3 4 5 6 - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - (n,2n) - tracklength - - - 1 2 - total - (n,3n) - tracklength - - - 1 2 - total - (n,4n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - nu-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - kappa-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 - total - flux - analog - - - 1 2 - total - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - nu-scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - total - nu-fission - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 54 - total - nu-fission - analog - - - 1 5 - total - nu-fission - analog - - - 1 54 - total - prompt-nu-fission - analog - - - 1 5 - total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - inverse-velocity - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - prompt-nu-fission - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - total - prompt-nu-fission - analog - - - 68 2 - total - current - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 79 2 - total - delayed-nu-fission - tracklength - - - 1 79 54 - total - delayed-nu-fission - analog - - - 1 79 5 - total - delayed-nu-fission - analog - - - 1 2 - total - nu-fission - tracklength - - - 1 79 2 - total - delayed-nu-fission - tracklength - - - 1 79 - total - delayed-nu-fission - tracklength - - - 1 79 - total - decay-rate - tracklength - - - 1 2 - total - flux - analog - - - 1 79 2 5 - total - delayed-nu-fission - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 2 2 + -100.0 -100.0 + 100.0 100.0 + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 1 + + + 3 + + + 0.0 20000000.0 + + + 1 + + + 1 2 3 4 5 6 + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + (n,2n) + tracklength + + + 1 2 + total + (n,3n) + tracklength + + + 1 2 + total + (n,4n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + nu-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + kappa-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 + total + flux + analog + + + 1 2 + total + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + nu-scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + total + nu-fission + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 54 + total + nu-fission + analog + + + 1 5 + total + nu-fission + analog + + + 1 54 + total + prompt-nu-fission + analog + + + 1 5 + total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + inverse-velocity + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + prompt-nu-fission + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + total + prompt-nu-fission + analog + + + 68 2 + total + current + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 79 2 + total + delayed-nu-fission + tracklength + + + 1 79 54 + total + delayed-nu-fission + analog + + + 1 79 5 + total + delayed-nu-fission + analog + + + 1 2 + total + nu-fission + tracklength + + + 1 79 2 + total + delayed-nu-fission + tracklength + + + 1 79 + total + delayed-nu-fission + tracklength + + + 1 79 + total + decay-rate + tracklength + + + 1 2 + total + flux + analog + + + 1 79 2 5 + total + delayed-nu-fission + analog + + + diff --git a/tests/regression_tests/mgxs_library_correction/inputs_true.dat b/tests/regression_tests/mgxs_library_correction/inputs_true.dat index 8c1cd4d16..a1cc111de 100644 --- a/tests/regression_tests/mgxs_library_correction/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_correction/inputs_true.dat @@ -1,344 +1,343 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 1 - - - 0 - - - 2 - - - 3 - - - 1 2 - total - flux - analog - - - 1 2 3 4 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 3 4 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 3 12 - total - scatter - analog - - - 1 3 4 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 3 12 - total - scatter - analog - - - 1 2 3 - total - nu-scatter - analog - - - 1 3 4 - total - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 19 2 - total - flux - analog - - - 19 2 3 4 - total - scatter - analog - - - 19 2 - total - flux - analog - - - 19 2 3 4 - total - nu-scatter - analog - - - 19 2 - total - flux - tracklength - - - 19 2 - total - scatter - tracklength - - - 19 2 3 12 - total - scatter - analog - - - 19 3 4 - total - scatter - analog - - - 19 2 - total - flux - analog - - - 19 2 - total - flux - tracklength - - - 19 2 - total - scatter - tracklength - - - 19 2 3 12 - total - scatter - analog - - - 19 2 3 - total - nu-scatter - analog - - - 19 3 4 - total - nu-scatter - analog - - - 19 2 - total - flux - analog - - - 37 2 - total - flux - analog - - - 37 2 3 4 - total - scatter - analog - - - 37 2 - total - flux - analog - - - 37 2 3 4 - total - nu-scatter - analog - - - 37 2 - total - flux - tracklength - - - 37 2 - total - scatter - tracklength - - - 37 2 3 12 - total - scatter - analog - - - 37 3 4 - total - scatter - analog - - - 37 2 - total - flux - analog - - - 37 2 - total - flux - tracklength - - - 37 2 - total - scatter - tracklength - - - 37 2 3 12 - total - scatter - analog - - - 37 2 3 - total - nu-scatter - analog - - - 37 3 4 - total - nu-scatter - analog - - - 37 2 - total - flux - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 1 + + + 0 + + + 2 + + + 3 + + + 1 2 + total + flux + analog + + + 1 2 3 4 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 3 4 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 12 + total + scatter + analog + + + 1 3 4 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 12 + total + scatter + analog + + + 1 2 3 + total + nu-scatter + analog + + + 1 3 4 + total + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 19 2 + total + flux + analog + + + 19 2 3 4 + total + scatter + analog + + + 19 2 + total + flux + analog + + + 19 2 3 4 + total + nu-scatter + analog + + + 19 2 + total + flux + tracklength + + + 19 2 + total + scatter + tracklength + + + 19 2 3 12 + total + scatter + analog + + + 19 3 4 + total + scatter + analog + + + 19 2 + total + flux + analog + + + 19 2 + total + flux + tracklength + + + 19 2 + total + scatter + tracklength + + + 19 2 3 12 + total + scatter + analog + + + 19 2 3 + total + nu-scatter + analog + + + 19 3 4 + total + nu-scatter + analog + + + 19 2 + total + flux + analog + + + 37 2 + total + flux + analog + + + 37 2 3 4 + total + scatter + analog + + + 37 2 + total + flux + analog + + + 37 2 3 4 + total + nu-scatter + analog + + + 37 2 + total + flux + tracklength + + + 37 2 + total + scatter + tracklength + + + 37 2 3 12 + total + scatter + analog + + + 37 3 4 + total + scatter + analog + + + 37 2 + total + flux + analog + + + 37 2 + total + flux + tracklength + + + 37 2 + total + scatter + tracklength + + + 37 2 3 12 + total + scatter + analog + + + 37 2 3 + total + nu-scatter + analog + + + 37 3 4 + total + nu-scatter + analog + + + 37 2 + total + flux + analog + + + diff --git a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat index bd6abbb7c..895389fb9 100644 --- a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat @@ -1,17 +1,43 @@ - - - - - - - - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 @@ -29,514 +55,487 @@ 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -10.71 -10.71 -1 10.71 10.71 1 - - - - - - - 1 - - - 0.0 20000000.0 - - - 0.0 20000000.0 - - - 1 - - - 3 - - - 1 2 3 4 5 6 - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - (n,2n) - tracklength - - - 1 2 - total - (n,3n) - tracklength - - - 1 2 - total - (n,4n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - nu-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - kappa-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 - total - flux - analog - - - 1 2 - total - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - nu-scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - total - nu-fission - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 2 - total - nu-fission - analog - - - 1 5 - total - nu-fission - analog - - - 1 2 - total - prompt-nu-fission - analog - - - 1 5 - total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - inverse-velocity - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - prompt-nu-fission - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 75 2 - total - delayed-nu-fission - tracklength - - - 1 75 2 - total - delayed-nu-fission - analog - - - 1 75 5 - total - delayed-nu-fission - analog - - - 1 2 - total - nu-fission - tracklength - - - 1 75 2 - total - delayed-nu-fission - tracklength - - - 1 75 - total - delayed-nu-fission - tracklength - - - 1 75 - total - decay-rate - tracklength - - - 1 2 - total - flux - analog - - - 1 75 2 5 - total - delayed-nu-fission - analog - - + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -10.71 -10.71 -1 10.71 10.71 1 + + + + + + 1 + + + 0.0 20000000.0 + + + 0.0 20000000.0 + + + 1 + + + 3 + + + 1 2 3 4 5 6 + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + (n,2n) + tracklength + + + 1 2 + total + (n,3n) + tracklength + + + 1 2 + total + (n,4n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + nu-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + kappa-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 + total + flux + analog + + + 1 2 + total + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + nu-scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + total + nu-fission + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 2 + total + nu-fission + analog + + + 1 5 + total + nu-fission + analog + + + 1 2 + total + prompt-nu-fission + analog + + + 1 5 + total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + inverse-velocity + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + prompt-nu-fission + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 75 2 + total + delayed-nu-fission + tracklength + + + 1 75 2 + total + delayed-nu-fission + analog + + + 1 75 5 + total + delayed-nu-fission + analog + + + 1 2 + total + nu-fission + tracklength + + + 1 75 2 + total + delayed-nu-fission + tracklength + + + 1 75 + total + delayed-nu-fission + tracklength + + + 1 75 + total + decay-rate + tracklength + + + 1 2 + total + flux + analog + + + 1 75 2 5 + total + delayed-nu-fission + analog + + + diff --git a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat index cac18ffcd..c8f140f80 100644 --- a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat @@ -1,532 +1,531 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 2 2 - -100.0 -100.0 - 100.0 100.0 - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 1 - - - 3 - - - 0.0 20000000.0 - - - 1 - - - 1 2 3 4 5 6 - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - (n,2n) - tracklength - - - 1 2 - total - (n,3n) - tracklength - - - 1 2 - total - (n,4n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - nu-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - kappa-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 - total - flux - analog - - - 1 2 - total - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - nu-scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - total - nu-fission - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 54 - total - nu-fission - analog - - - 1 5 - total - nu-fission - analog - - - 1 54 - total - prompt-nu-fission - analog - - - 1 5 - total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - inverse-velocity - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - prompt-nu-fission - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - total - prompt-nu-fission - analog - - - 68 2 - total - current - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 79 2 - total - delayed-nu-fission - tracklength - - - 1 79 54 - total - delayed-nu-fission - analog - - - 1 79 5 - total - delayed-nu-fission - analog - - - 1 2 - total - nu-fission - tracklength - - - 1 79 2 - total - delayed-nu-fission - tracklength - - - 1 79 - total - delayed-nu-fission - tracklength - - - 1 79 - total - decay-rate - tracklength - - - 1 2 - total - flux - analog - - - 1 79 2 5 - total - delayed-nu-fission - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 2 2 + -100.0 -100.0 + 100.0 100.0 + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 1 + + + 3 + + + 0.0 20000000.0 + + + 1 + + + 1 2 3 4 5 6 + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + (n,2n) + tracklength + + + 1 2 + total + (n,3n) + tracklength + + + 1 2 + total + (n,4n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + nu-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + kappa-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 + total + flux + analog + + + 1 2 + total + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + nu-scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + total + nu-fission + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 54 + total + nu-fission + analog + + + 1 5 + total + nu-fission + analog + + + 1 54 + total + prompt-nu-fission + analog + + + 1 5 + total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + inverse-velocity + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + prompt-nu-fission + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + total + prompt-nu-fission + analog + + + 68 2 + total + current + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 79 2 + total + delayed-nu-fission + tracklength + + + 1 79 54 + total + delayed-nu-fission + analog + + + 1 79 5 + total + delayed-nu-fission + analog + + + 1 2 + total + nu-fission + tracklength + + + 1 79 2 + total + delayed-nu-fission + tracklength + + + 1 79 + total + delayed-nu-fission + tracklength + + + 1 79 + total + decay-rate + tracklength + + + 1 2 + total + flux + analog + + + 1 79 2 5 + total + delayed-nu-fission + analog + + + diff --git a/tests/regression_tests/mgxs_library_histogram/inputs_true.dat b/tests/regression_tests/mgxs_library_histogram/inputs_true.dat index d1bd197a7..0ea55bb04 100644 --- a/tests/regression_tests/mgxs_library_histogram/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_histogram/inputs_true.dat @@ -1,269 +1,268 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - -1.0 -0.8181818181818181 -0.6363636363636364 -0.4545454545454546 -0.2727272727272727 -0.09090909090909083 0.09090909090909083 0.2727272727272727 0.4545454545454546 0.6363636363636365 0.8181818181818183 1.0 - - - 2 - - - 3 - - - 1 2 - total - flux - analog - - - 1 2 3 4 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 3 4 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 3 4 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 3 4 - total - scatter - analog - - - 1 2 3 - total - nu-scatter - analog - - - 17 2 - total - flux - analog - - - 17 2 3 4 - total - scatter - analog - - - 17 2 - total - flux - analog - - - 17 2 3 4 - total - nu-scatter - analog - - - 17 2 - total - flux - tracklength - - - 17 2 - total - scatter - tracklength - - - 17 2 3 4 - total - scatter - analog - - - 17 2 - total - flux - tracklength - - - 17 2 - total - scatter - tracklength - - - 17 2 3 4 - total - scatter - analog - - - 17 2 3 - total - nu-scatter - analog - - - 33 2 - total - flux - analog - - - 33 2 3 4 - total - scatter - analog - - - 33 2 - total - flux - analog - - - 33 2 3 4 - total - nu-scatter - analog - - - 33 2 - total - flux - tracklength - - - 33 2 - total - scatter - tracklength - - - 33 2 3 4 - total - scatter - analog - - - 33 2 - total - flux - tracklength - - - 33 2 - total - scatter - tracklength - - - 33 2 3 4 - total - scatter - analog - - - 33 2 3 - total - nu-scatter - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + -1.0 -0.8181818181818181 -0.6363636363636364 -0.4545454545454546 -0.2727272727272727 -0.09090909090909083 0.09090909090909083 0.2727272727272727 0.4545454545454546 0.6363636363636365 0.8181818181818183 1.0 + + + 2 + + + 3 + + + 1 2 + total + flux + analog + + + 1 2 3 4 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 3 4 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 4 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 4 + total + scatter + analog + + + 1 2 3 + total + nu-scatter + analog + + + 17 2 + total + flux + analog + + + 17 2 3 4 + total + scatter + analog + + + 17 2 + total + flux + analog + + + 17 2 3 4 + total + nu-scatter + analog + + + 17 2 + total + flux + tracklength + + + 17 2 + total + scatter + tracklength + + + 17 2 3 4 + total + scatter + analog + + + 17 2 + total + flux + tracklength + + + 17 2 + total + scatter + tracklength + + + 17 2 3 4 + total + scatter + analog + + + 17 2 3 + total + nu-scatter + analog + + + 33 2 + total + flux + analog + + + 33 2 3 4 + total + scatter + analog + + + 33 2 + total + flux + analog + + + 33 2 3 4 + total + nu-scatter + analog + + + 33 2 + total + flux + tracklength + + + 33 2 + total + scatter + tracklength + + + 33 2 3 4 + total + scatter + analog + + + 33 2 + total + flux + tracklength + + + 33 2 + total + scatter + tracklength + + + 33 2 3 4 + total + scatter + analog + + + 33 2 3 + total + nu-scatter + analog + + + diff --git a/tests/regression_tests/mgxs_library_mesh/inputs_true.dat b/tests/regression_tests/mgxs_library_mesh/inputs_true.dat index ac2ff0c81..b18e9773b 100644 --- a/tests/regression_tests/mgxs_library_mesh/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_mesh/inputs_true.dat @@ -1,512 +1,511 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - - - 2 2 - -100.0 -100.0 - 100.0 100.0 - - - 1 - - - 0.0 20000000.0 - - - 0.0 20000000.0 - - - 1 - - - 3 - - - 1 - - - 1 2 3 4 5 6 - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - (n,2n) - tracklength - - - 1 2 - total - (n,3n) - tracklength - - - 1 2 - total - (n,4n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - nu-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - kappa-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 - total - flux - analog - - - 1 2 - total - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - nu-scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - total - nu-fission - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 2 - total - nu-fission - analog - - - 1 5 - total - nu-fission - analog - - - 1 2 - total - prompt-nu-fission - analog - - - 1 5 - total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - inverse-velocity - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - prompt-nu-fission - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - total - prompt-nu-fission - analog - - - 68 2 - total - current - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 79 2 - total - delayed-nu-fission - tracklength - - - 1 79 2 - total - delayed-nu-fission - analog - - - 1 79 5 - total - delayed-nu-fission - analog - - - 1 2 - total - nu-fission - tracklength - - - 1 79 2 - total - delayed-nu-fission - tracklength - - - 1 79 - total - delayed-nu-fission - tracklength - - - 1 79 - total - decay-rate - tracklength - - - 1 2 - total - flux - analog - - - 1 79 2 5 - total - delayed-nu-fission - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + + 2 2 + -100.0 -100.0 + 100.0 100.0 + + + 1 + + + 0.0 20000000.0 + + + 0.0 20000000.0 + + + 1 + + + 3 + + + 1 + + + 1 2 3 4 5 6 + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + (n,2n) + tracklength + + + 1 2 + total + (n,3n) + tracklength + + + 1 2 + total + (n,4n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + nu-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + kappa-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 + total + flux + analog + + + 1 2 + total + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + nu-scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + total + nu-fission + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 2 + total + nu-fission + analog + + + 1 5 + total + nu-fission + analog + + + 1 2 + total + prompt-nu-fission + analog + + + 1 5 + total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + inverse-velocity + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + prompt-nu-fission + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + total + prompt-nu-fission + analog + + + 68 2 + total + current + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 79 2 + total + delayed-nu-fission + tracklength + + + 1 79 2 + total + delayed-nu-fission + analog + + + 1 79 5 + total + delayed-nu-fission + analog + + + 1 2 + total + nu-fission + tracklength + + + 1 79 2 + total + delayed-nu-fission + tracklength + + + 1 79 + total + delayed-nu-fission + tracklength + + + 1 79 + total + decay-rate + tracklength + + + 1 2 + total + flux + analog + + + 1 79 2 5 + total + delayed-nu-fission + analog + + + diff --git a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat index 59cbddec4..54d095ac6 100644 --- a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat @@ -1,1952 +1,1951 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 1 - - - 3 - - - 0.0 20000000.0 - - - 1 2 3 4 5 6 - - - 2 - - - 3 - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - (n,2n) - tracklength - - - 1 2 - total - (n,3n) - tracklength - - - 1 2 - total - (n,4n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - absorption - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - nu-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - kappa-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 - total - flux - analog - - - 1 2 - total - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - total - nu-scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - total - nu-fission - analog - - - 1 2 5 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - scatter - tracklength - - - 1 2 5 30 - total - scatter - analog - - - 1 2 5 - total - nu-scatter - analog - - - 1 54 - total - nu-fission - analog - - - 1 5 - total - nu-fission - analog - - - 1 54 - total - prompt-nu-fission - analog - - - 1 5 - total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - inverse-velocity - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - prompt-nu-fission - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,elastic) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,level) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,2n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,na) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,nc) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,gamma) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,a) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,Xa) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - heating - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - damage-energy - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,n1) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - total - (n,a0) - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - total - (n,nc) - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - total - (n,n1) - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - total - (n,2n) - analog - - - 1 2 - total - flux - tracklength - - - 1 108 2 - total - delayed-nu-fission - tracklength - - - 1 108 54 - total - delayed-nu-fission - analog - - - 1 108 5 - total - delayed-nu-fission - analog - - - 1 2 - total - nu-fission - tracklength - - - 1 108 2 - total - delayed-nu-fission - tracklength - - - 1 108 - total - delayed-nu-fission - tracklength - - - 1 108 - total - decay-rate - tracklength - - - 1 2 - total - flux - analog - - - 1 108 2 5 - total - delayed-nu-fission - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - total - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - total - tracklength - - - 122 2 - total - flux - analog - - - 122 5 6 - total - scatter - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - total - tracklength - - - 122 2 - total - flux - analog - - - 122 5 6 - total - nu-scatter - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - absorption - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - absorption - tracklength - - - 122 2 - total - (n,2n) - tracklength - - - 122 2 - total - (n,3n) - tracklength - - - 122 2 - total - (n,4n) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - absorption - tracklength - - - 122 2 - total - fission - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - fission - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - nu-fission - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - kappa-fission - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - scatter - tracklength - - - 122 2 - total - flux - analog - - - 122 2 - total - nu-scatter - analog - - - 122 2 - total - flux - analog - - - 122 2 5 30 - total - scatter - analog - - - 122 2 - total - flux - analog - - - 122 2 5 30 - total - nu-scatter - analog - - - 122 2 5 - total - nu-scatter - analog - - - 122 2 5 - total - scatter - analog - - - 122 2 - total - flux - analog - - - 122 2 5 - total - nu-fission - analog - - - 122 2 5 - total - scatter - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - scatter - tracklength - - - 122 2 5 30 - total - scatter - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - scatter - tracklength - - - 122 2 5 30 - total - scatter - analog - - - 122 2 5 - total - nu-scatter - analog - - - 122 54 - total - nu-fission - analog - - - 122 5 - total - nu-fission - analog - - - 122 54 - total - prompt-nu-fission - analog - - - 122 5 - total - prompt-nu-fission - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - inverse-velocity - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - prompt-nu-fission - tracklength - - - 122 2 - total - flux - analog - - - 122 2 5 - total - prompt-nu-fission - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - total - tracklength - - - 122 2 - total - flux - analog - - - 122 5 6 - total - scatter - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - total - tracklength - - - 122 2 - total - flux - analog - - - 122 5 6 - total - nu-scatter - analog - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,elastic) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,level) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,2n) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,na) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,nc) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,gamma) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,a) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,Xa) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - heating - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - damage-energy - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,n1) - tracklength - - - 122 2 - total - flux - tracklength - - - 122 2 - total - (n,a0) - tracklength - - - 122 2 - total - flux - analog - - - 122 2 5 - total - (n,nc) - analog - - - 122 2 - total - flux - analog - - - 122 2 5 - total - (n,n1) - analog - - - 122 2 - total - flux - analog - - - 122 2 5 - total - (n,2n) - analog - - - 122 2 - total - flux - tracklength - - - 122 108 2 - total - delayed-nu-fission - tracklength - - - 122 108 54 - total - delayed-nu-fission - analog - - - 122 108 5 - total - delayed-nu-fission - analog - - - 122 2 - total - nu-fission - tracklength - - - 122 108 2 - total - delayed-nu-fission - tracklength - - - 122 108 - total - delayed-nu-fission - tracklength - - - 122 108 - total - decay-rate - tracklength - - - 122 2 - total - flux - analog - - - 122 108 2 5 - total - delayed-nu-fission - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - total - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - total - tracklength - - - 243 2 - total - flux - analog - - - 243 5 6 - total - scatter - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - total - tracklength - - - 243 2 - total - flux - analog - - - 243 5 6 - total - nu-scatter - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - absorption - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - absorption - tracklength - - - 243 2 - total - (n,2n) - tracklength - - - 243 2 - total - (n,3n) - tracklength - - - 243 2 - total - (n,4n) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - absorption - tracklength - - - 243 2 - total - fission - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - fission - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - nu-fission - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - kappa-fission - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - scatter - tracklength - - - 243 2 - total - flux - analog - - - 243 2 - total - nu-scatter - analog - - - 243 2 - total - flux - analog - - - 243 2 5 30 - total - scatter - analog - - - 243 2 - total - flux - analog - - - 243 2 5 30 - total - nu-scatter - analog - - - 243 2 5 - total - nu-scatter - analog - - - 243 2 5 - total - scatter - analog - - - 243 2 - total - flux - analog - - - 243 2 5 - total - nu-fission - analog - - - 243 2 5 - total - scatter - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - scatter - tracklength - - - 243 2 5 30 - total - scatter - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - scatter - tracklength - - - 243 2 5 30 - total - scatter - analog - - - 243 2 5 - total - nu-scatter - analog - - - 243 54 - total - nu-fission - analog - - - 243 5 - total - nu-fission - analog - - - 243 54 - total - prompt-nu-fission - analog - - - 243 5 - total - prompt-nu-fission - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - inverse-velocity - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - prompt-nu-fission - tracklength - - - 243 2 - total - flux - analog - - - 243 2 5 - total - prompt-nu-fission - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - total - tracklength - - - 243 2 - total - flux - analog - - - 243 5 6 - total - scatter - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - total - tracklength - - - 243 2 - total - flux - analog - - - 243 5 6 - total - nu-scatter - analog - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,elastic) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,level) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,2n) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,na) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,nc) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,gamma) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,a) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,Xa) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - heating - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - damage-energy - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,n1) - tracklength - - - 243 2 - total - flux - tracklength - - - 243 2 - total - (n,a0) - tracklength - - - 243 2 - total - flux - analog - - - 243 2 5 - total - (n,nc) - analog - - - 243 2 - total - flux - analog - - - 243 2 5 - total - (n,n1) - analog - - - 243 2 - total - flux - analog - - - 243 2 5 - total - (n,2n) - analog - - - 243 2 - total - flux - tracklength - - - 243 108 2 - total - delayed-nu-fission - tracklength - - - 243 108 54 - total - delayed-nu-fission - analog - - - 243 108 5 - total - delayed-nu-fission - analog - - - 243 2 - total - nu-fission - tracklength - - - 243 108 2 - total - delayed-nu-fission - tracklength - - - 243 108 - total - delayed-nu-fission - tracklength - - - 243 108 - total - decay-rate - tracklength - - - 243 2 - total - flux - analog - - - 243 108 2 5 - total - delayed-nu-fission - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 1 + + + 3 + + + 0.0 20000000.0 + + + 1 2 3 4 5 6 + + + 2 + + + 3 + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + (n,2n) + tracklength + + + 1 2 + total + (n,3n) + tracklength + + + 1 2 + total + (n,4n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + absorption + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + nu-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + kappa-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 + total + flux + analog + + + 1 2 + total + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + total + nu-scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + total + nu-fission + analog + + + 1 2 5 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 5 30 + total + scatter + analog + + + 1 2 5 + total + nu-scatter + analog + + + 1 54 + total + nu-fission + analog + + + 1 5 + total + nu-fission + analog + + + 1 54 + total + prompt-nu-fission + analog + + + 1 5 + total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + inverse-velocity + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + prompt-nu-fission + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + total + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,elastic) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,level) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,2n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,na) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,nc) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,gamma) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,a) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,Xa) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + heating + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + damage-energy + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,n1) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + total + (n,a0) + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + total + (n,nc) + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + total + (n,n1) + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + total + (n,2n) + analog + + + 1 2 + total + flux + tracklength + + + 1 108 2 + total + delayed-nu-fission + tracklength + + + 1 108 54 + total + delayed-nu-fission + analog + + + 1 108 5 + total + delayed-nu-fission + analog + + + 1 2 + total + nu-fission + tracklength + + + 1 108 2 + total + delayed-nu-fission + tracklength + + + 1 108 + total + delayed-nu-fission + tracklength + + + 1 108 + total + decay-rate + tracklength + + + 1 2 + total + flux + analog + + + 1 108 2 5 + total + delayed-nu-fission + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + total + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + total + tracklength + + + 122 2 + total + flux + analog + + + 122 5 6 + total + scatter + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + total + tracklength + + + 122 2 + total + flux + analog + + + 122 5 6 + total + nu-scatter + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + absorption + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + absorption + tracklength + + + 122 2 + total + (n,2n) + tracklength + + + 122 2 + total + (n,3n) + tracklength + + + 122 2 + total + (n,4n) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + absorption + tracklength + + + 122 2 + total + fission + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + fission + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + nu-fission + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + kappa-fission + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + scatter + tracklength + + + 122 2 + total + flux + analog + + + 122 2 + total + nu-scatter + analog + + + 122 2 + total + flux + analog + + + 122 2 5 30 + total + scatter + analog + + + 122 2 + total + flux + analog + + + 122 2 5 30 + total + nu-scatter + analog + + + 122 2 5 + total + nu-scatter + analog + + + 122 2 5 + total + scatter + analog + + + 122 2 + total + flux + analog + + + 122 2 5 + total + nu-fission + analog + + + 122 2 5 + total + scatter + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + scatter + tracklength + + + 122 2 5 30 + total + scatter + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + scatter + tracklength + + + 122 2 5 30 + total + scatter + analog + + + 122 2 5 + total + nu-scatter + analog + + + 122 54 + total + nu-fission + analog + + + 122 5 + total + nu-fission + analog + + + 122 54 + total + prompt-nu-fission + analog + + + 122 5 + total + prompt-nu-fission + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + inverse-velocity + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + prompt-nu-fission + tracklength + + + 122 2 + total + flux + analog + + + 122 2 5 + total + prompt-nu-fission + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + total + tracklength + + + 122 2 + total + flux + analog + + + 122 5 6 + total + scatter + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + total + tracklength + + + 122 2 + total + flux + analog + + + 122 5 6 + total + nu-scatter + analog + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,elastic) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,level) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,2n) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,na) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,nc) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,gamma) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,a) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,Xa) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + heating + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + damage-energy + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,n1) + tracklength + + + 122 2 + total + flux + tracklength + + + 122 2 + total + (n,a0) + tracklength + + + 122 2 + total + flux + analog + + + 122 2 5 + total + (n,nc) + analog + + + 122 2 + total + flux + analog + + + 122 2 5 + total + (n,n1) + analog + + + 122 2 + total + flux + analog + + + 122 2 5 + total + (n,2n) + analog + + + 122 2 + total + flux + tracklength + + + 122 108 2 + total + delayed-nu-fission + tracklength + + + 122 108 54 + total + delayed-nu-fission + analog + + + 122 108 5 + total + delayed-nu-fission + analog + + + 122 2 + total + nu-fission + tracklength + + + 122 108 2 + total + delayed-nu-fission + tracklength + + + 122 108 + total + delayed-nu-fission + tracklength + + + 122 108 + total + decay-rate + tracklength + + + 122 2 + total + flux + analog + + + 122 108 2 5 + total + delayed-nu-fission + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + total + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + total + tracklength + + + 243 2 + total + flux + analog + + + 243 5 6 + total + scatter + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + total + tracklength + + + 243 2 + total + flux + analog + + + 243 5 6 + total + nu-scatter + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + absorption + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + absorption + tracklength + + + 243 2 + total + (n,2n) + tracklength + + + 243 2 + total + (n,3n) + tracklength + + + 243 2 + total + (n,4n) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + absorption + tracklength + + + 243 2 + total + fission + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + fission + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + nu-fission + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + kappa-fission + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + scatter + tracklength + + + 243 2 + total + flux + analog + + + 243 2 + total + nu-scatter + analog + + + 243 2 + total + flux + analog + + + 243 2 5 30 + total + scatter + analog + + + 243 2 + total + flux + analog + + + 243 2 5 30 + total + nu-scatter + analog + + + 243 2 5 + total + nu-scatter + analog + + + 243 2 5 + total + scatter + analog + + + 243 2 + total + flux + analog + + + 243 2 5 + total + nu-fission + analog + + + 243 2 5 + total + scatter + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + scatter + tracklength + + + 243 2 5 30 + total + scatter + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + scatter + tracklength + + + 243 2 5 30 + total + scatter + analog + + + 243 2 5 + total + nu-scatter + analog + + + 243 54 + total + nu-fission + analog + + + 243 5 + total + nu-fission + analog + + + 243 54 + total + prompt-nu-fission + analog + + + 243 5 + total + prompt-nu-fission + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + inverse-velocity + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + prompt-nu-fission + tracklength + + + 243 2 + total + flux + analog + + + 243 2 5 + total + prompt-nu-fission + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + total + tracklength + + + 243 2 + total + flux + analog + + + 243 5 6 + total + scatter + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + total + tracklength + + + 243 2 + total + flux + analog + + + 243 5 6 + total + nu-scatter + analog + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,elastic) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,level) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,2n) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,na) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,nc) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,gamma) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,a) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,Xa) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + heating + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + damage-energy + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,n1) + tracklength + + + 243 2 + total + flux + tracklength + + + 243 2 + total + (n,a0) + tracklength + + + 243 2 + total + flux + analog + + + 243 2 5 + total + (n,nc) + analog + + + 243 2 + total + flux + analog + + + 243 2 5 + total + (n,n1) + analog + + + 243 2 + total + flux + analog + + + 243 2 5 + total + (n,2n) + analog + + + 243 2 + total + flux + tracklength + + + 243 108 2 + total + delayed-nu-fission + tracklength + + + 243 108 54 + total + delayed-nu-fission + analog + + + 243 108 5 + total + delayed-nu-fission + analog + + + 243 2 + total + nu-fission + tracklength + + + 243 108 2 + total + delayed-nu-fission + tracklength + + + 243 108 + total + delayed-nu-fission + tracklength + + + 243 108 + total + decay-rate + tracklength + + + 243 2 + total + flux + analog + + + 243 108 2 5 + total + delayed-nu-fission + analog + + + diff --git a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat index e45fe389e..5e9720ced 100644 --- a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat @@ -1,1769 +1,1768 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 1 - - - 0.0 0.625 20000000.0 - - - 0.0 0.625 20000000.0 - - - 1 - - - 3 - - - 0.0 20000000.0 - - - 2 - - - 3 - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - total - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - U234 U235 U238 O16 - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - absorption - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - absorption - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,2n) - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,3n) - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,4n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - absorption - tracklength - - - 1 2 - U234 U235 U238 O16 - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - nu-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - kappa-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - scatter - tracklength - - - 1 2 - total - flux - analog - - - 1 2 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - U234 U235 U238 O16 - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 2 5 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 2 5 - U234 U235 U238 O16 - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - U234 U235 U238 O16 - nu-fission - analog - - - 1 2 5 - U234 U235 U238 O16 - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - scatter - tracklength - - - 1 2 5 30 - U234 U235 U238 O16 - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - scatter - tracklength - - - 1 2 5 30 - U234 U235 U238 O16 - scatter - analog - - - 1 2 5 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 54 - U234 U235 U238 O16 - nu-fission - analog - - - 1 5 - U234 U235 U238 O16 - nu-fission - analog - - - 1 54 - U234 U235 U238 O16 - prompt-nu-fission - analog - - - 1 5 - U234 U235 U238 O16 - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - inverse-velocity - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - prompt-nu-fission - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - U234 U235 U238 O16 - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - U234 U235 U238 O16 - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - U234 U235 U238 O16 - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,elastic) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,level) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,2n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,na) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,nc) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,gamma) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,a) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,Xa) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - heating - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - damage-energy - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,n1) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U234 U235 U238 O16 - (n,a0) - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - U234 U235 U238 O16 - (n,nc) - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - U234 U235 U238 O16 - (n,n1) - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - U234 U235 U238 O16 - (n,2n) - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total - tracklength - - - 106 2 - total - flux - analog - - - 106 5 6 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total - tracklength - - - 106 2 - total - flux - analog - - - 106 5 6 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - absorption - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - absorption - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,2n) - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,3n) - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,4n) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - absorption - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - kappa-fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - tracklength - - - 106 2 - total - flux - analog - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 106 2 - total - flux - analog - - - 106 2 5 30 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 106 2 - total - flux - analog - - - 106 2 5 30 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - tracklength - - - 106 2 5 30 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - tracklength - - - 106 2 5 30 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 106 54 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission - analog - - - 106 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission - analog - - - 106 54 - Zr90 Zr91 Zr92 Zr94 Zr96 - prompt-nu-fission - analog - - - 106 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - prompt-nu-fission - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - inverse-velocity - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - prompt-nu-fission - tracklength - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - prompt-nu-fission - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total - tracklength - - - 106 2 - total - flux - analog - - - 106 5 6 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total - tracklength - - - 106 2 - total - flux - analog - - - 106 5 6 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,elastic) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,level) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,2n) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,na) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,nc) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,gamma) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,a) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,Xa) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - heating - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - damage-energy - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,n1) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,a0) - tracklength - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,nc) - analog - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,n1) - analog - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - (n,2n) - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - total - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 - H1 O16 B10 B11 - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 - H1 O16 B10 B11 - nu-scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - absorption - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - absorption - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,2n) - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,3n) - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,4n) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - absorption - tracklength - - - 211 2 - H1 O16 B10 B11 - fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - nu-fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - kappa-fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - scatter - tracklength - - - 211 2 - total - flux - analog - - - 211 2 - H1 O16 B10 B11 - nu-scatter - analog - - - 211 2 - total - flux - analog - - - 211 2 5 30 - H1 O16 B10 B11 - scatter - analog - - - 211 2 - total - flux - analog - - - 211 2 5 30 - H1 O16 B10 B11 - nu-scatter - analog - - - 211 2 5 - H1 O16 B10 B11 - nu-scatter - analog - - - 211 2 5 - H1 O16 B10 B11 - scatter - analog - - - 211 2 - total - flux - analog - - - 211 2 5 - H1 O16 B10 B11 - nu-fission - analog - - - 211 2 5 - H1 O16 B10 B11 - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - scatter - tracklength - - - 211 2 5 30 - H1 O16 B10 B11 - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - scatter - tracklength - - - 211 2 5 30 - H1 O16 B10 B11 - scatter - analog - - - 211 2 5 - H1 O16 B10 B11 - nu-scatter - analog - - - 211 54 - H1 O16 B10 B11 - nu-fission - analog - - - 211 5 - H1 O16 B10 B11 - nu-fission - analog - - - 211 54 - H1 O16 B10 B11 - prompt-nu-fission - analog - - - 211 5 - H1 O16 B10 B11 - prompt-nu-fission - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - inverse-velocity - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - prompt-nu-fission - tracklength - - - 211 2 - total - flux - analog - - - 211 2 5 - H1 O16 B10 B11 - prompt-nu-fission - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 - H1 O16 B10 B11 - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 - H1 O16 B10 B11 - nu-scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,elastic) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,level) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,2n) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,na) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,nc) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,gamma) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,a) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,Xa) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - heating - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - damage-energy - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,n1) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 O16 B10 B11 - (n,a0) - tracklength - - - 211 2 - total - flux - analog - - - 211 2 5 - H1 O16 B10 B11 - (n,nc) - analog - - - 211 2 - total - flux - analog - - - 211 2 5 - H1 O16 B10 B11 - (n,n1) - analog - - - 211 2 - total - flux - analog - - - 211 2 5 - H1 O16 B10 B11 - (n,2n) - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 1 + + + 3 + + + 0.0 20000000.0 + + + 2 + + + 3 + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + total + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U234 U235 U238 O16 + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + absorption + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + absorption + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,2n) + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,3n) + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,4n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + absorption + tracklength + + + 1 2 + U234 U235 U238 O16 + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + nu-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + kappa-fission + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + scatter + tracklength + + + 1 2 + total + flux + analog + + + 1 2 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + U234 U235 U238 O16 + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 30 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 2 5 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 2 5 + U234 U235 U238 O16 + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + U234 U235 U238 O16 + nu-fission + analog + + + 1 2 5 + U234 U235 U238 O16 + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + scatter + tracklength + + + 1 2 5 30 + U234 U235 U238 O16 + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + scatter + tracklength + + + 1 2 5 30 + U234 U235 U238 O16 + scatter + analog + + + 1 2 5 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 54 + U234 U235 U238 O16 + nu-fission + analog + + + 1 5 + U234 U235 U238 O16 + nu-fission + analog + + + 1 54 + U234 U235 U238 O16 + prompt-nu-fission + analog + + + 1 5 + U234 U235 U238 O16 + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + inverse-velocity + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + prompt-nu-fission + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + U234 U235 U238 O16 + prompt-nu-fission + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U234 U235 U238 O16 + scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + total + tracklength + + + 1 2 + total + flux + analog + + + 1 5 6 + U234 U235 U238 O16 + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,elastic) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,level) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,2n) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,na) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,nc) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,gamma) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,a) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,Xa) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + heating + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + damage-energy + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,n1) + tracklength + + + 1 2 + total + flux + tracklength + + + 1 2 + U234 U235 U238 O16 + (n,a0) + tracklength + + + 1 2 + total + flux + analog + + + 1 2 5 + U234 U235 U238 O16 + (n,nc) + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + U234 U235 U238 O16 + (n,n1) + analog + + + 1 2 + total + flux + analog + + + 1 2 5 + U234 U235 U238 O16 + (n,2n) + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + absorption + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + absorption + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,2n) + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,3n) + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,4n) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + absorption + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + kappa-fission + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + tracklength + + + 106 2 + total + flux + analog + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 106 2 + total + flux + analog + + + 106 2 5 30 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 106 2 + total + flux + analog + + + 106 2 5 30 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-fission + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + tracklength + + + 106 2 5 30 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + tracklength + + + 106 2 5 30 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 106 54 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-fission + analog + + + 106 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-fission + analog + + + 106 54 + Zr90 Zr91 Zr92 Zr94 Zr96 + prompt-nu-fission + analog + + + 106 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + prompt-nu-fission + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + inverse-velocity + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + prompt-nu-fission + tracklength + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + prompt-nu-fission + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total + tracklength + + + 106 2 + total + flux + analog + + + 106 5 6 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,elastic) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,level) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,2n) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,na) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,nc) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,gamma) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,a) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,Xa) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + heating + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + damage-energy + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,n1) + tracklength + + + 106 2 + total + flux + tracklength + + + 106 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,a0) + tracklength + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,nc) + analog + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,n1) + analog + + + 106 2 + total + flux + analog + + + 106 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + (n,2n) + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + total + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 O16 B10 B11 + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 O16 B10 B11 + nu-scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + absorption + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + absorption + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,2n) + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,3n) + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,4n) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + absorption + tracklength + + + 211 2 + H1 O16 B10 B11 + fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + nu-fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + kappa-fission + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + scatter + tracklength + + + 211 2 + total + flux + analog + + + 211 2 + H1 O16 B10 B11 + nu-scatter + analog + + + 211 2 + total + flux + analog + + + 211 2 5 30 + H1 O16 B10 B11 + scatter + analog + + + 211 2 + total + flux + analog + + + 211 2 5 30 + H1 O16 B10 B11 + nu-scatter + analog + + + 211 2 5 + H1 O16 B10 B11 + nu-scatter + analog + + + 211 2 5 + H1 O16 B10 B11 + scatter + analog + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 O16 B10 B11 + nu-fission + analog + + + 211 2 5 + H1 O16 B10 B11 + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + scatter + tracklength + + + 211 2 5 30 + H1 O16 B10 B11 + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + scatter + tracklength + + + 211 2 5 30 + H1 O16 B10 B11 + scatter + analog + + + 211 2 5 + H1 O16 B10 B11 + nu-scatter + analog + + + 211 54 + H1 O16 B10 B11 + nu-fission + analog + + + 211 5 + H1 O16 B10 B11 + nu-fission + analog + + + 211 54 + H1 O16 B10 B11 + prompt-nu-fission + analog + + + 211 5 + H1 O16 B10 B11 + prompt-nu-fission + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + inverse-velocity + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + prompt-nu-fission + tracklength + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 O16 B10 B11 + prompt-nu-fission + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 O16 B10 B11 + scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + total + tracklength + + + 211 2 + total + flux + analog + + + 211 5 6 + H1 O16 B10 B11 + nu-scatter + analog + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,elastic) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,level) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,2n) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,na) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,nc) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,gamma) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,a) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,Xa) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + heating + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + damage-energy + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,n1) + tracklength + + + 211 2 + total + flux + tracklength + + + 211 2 + H1 O16 B10 B11 + (n,a0) + tracklength + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 O16 B10 B11 + (n,nc) + analog + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 O16 B10 B11 + (n,n1) + analog + + + 211 2 + total + flux + analog + + + 211 2 5 + H1 O16 B10 B11 + (n,2n) + analog + + + diff --git a/tests/regression_tests/multipole/inputs_true.dat b/tests/regression_tests/multipole/inputs_true.dat index 3bbcc2024..3a602b28b 100644 --- a/tests/regression_tests/multipole/inputs_true.dat +++ b/tests/regression_tests/multipole/inputs_true.dat @@ -1,55 +1,54 @@ - - - - - - - 2.0 2.0 - 1 - 2 2 - -2.0 -2.0 - + + + + + + + + + + + + + + + + + + + + 2.0 2.0 + 1 + 2 2 + -2.0 -2.0 + 11 11 11 11 - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - -1 -1 -1 1 1 1 - - - true - 1000 - - - - - U235 O16 total - total fission (n,gamma) elastic (n,p) - - + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + -1 -1 -1 1 1 1 + + + true + 1000 + + + + U235 O16 total + total fission (n,gamma) elastic (n,p) + + + diff --git a/tests/regression_tests/ncrystal/inputs_true.dat b/tests/regression_tests/ncrystal/inputs_true.dat index 7a3f20eb3..a609edcae 100644 --- a/tests/regression_tests/ncrystal/inputs_true.dat +++ b/tests/regression_tests/ncrystal/inputs_true.dat @@ -1,45 +1,44 @@ - - - - - - - - - - - - - - - - fixed source - 100000 - 10 - - - 0 0 -20 - - - - 0.012 1.0 - - - - - - - 1 - - - 0.0 0.017453292519943295 0.03490658503988659 0.05235987755982989 0.06981317007977318 0.08726646259971647 0.10471975511965978 0.12217304763960307 0.13962634015954636 0.15707963267948966 0.17453292519943295 0.19198621771937624 0.20943951023931956 0.22689280275926285 0.24434609527920614 0.2617993877991494 0.2792526803190927 0.29670597283903605 0.3141592653589793 0.33161255787892263 0.3490658503988659 0.3665191429188092 0.3839724354387525 0.4014257279586958 0.4188790204786391 0.4363323129985824 0.4537856055185257 0.47123889803846897 0.4886921905584123 0.5061454830783556 0.5235987755982988 0.5410520681182421 0.5585053606381855 0.5759586531581288 0.5934119456780721 0.6108652381980153 0.6283185307179586 0.6457718232379019 0.6632251157578453 0.6806784082777885 0.6981317007977318 0.7155849933176751 0.7330382858376184 0.7504915783575618 0.767944870877505 0.7853981633974483 0.8028514559173916 0.8203047484373349 0.8377580409572782 0.8552113334772214 0.8726646259971648 0.8901179185171081 0.9075712110370514 0.9250245035569946 0.9424777960769379 0.9599310885968813 0.9773843811168246 0.9948376736367679 1.0122909661567112 1.0297442586766545 1.0471975511965976 1.064650843716541 1.0821041362364843 1.0995574287564276 1.117010721276371 1.1344640137963142 1.1519173063162575 1.1693705988362009 1.1868238913561442 1.2042771838760873 1.2217304763960306 1.239183768915974 1.2566370614359172 1.2740903539558606 1.2915436464758039 1.3089969389957472 1.3264502315156905 1.3439035240356338 1.361356816555577 1.3788101090755203 1.3962634015954636 1.413716694115407 1.4311699866353502 1.4486232791552935 1.4660765716752369 1.4835298641951802 1.5009831567151235 1.5184364492350666 1.53588974175501 1.5533430342749532 1.5707963267948966 1.5882496193148399 1.6057029118347832 1.6231562043547265 1.6406094968746698 1.6580627893946132 1.6755160819145565 1.6929693744344996 1.710422666954443 1.7278759594743862 1.7453292519943295 1.7627825445142729 1.7802358370342162 1.7976891295541595 1.8151424220741028 1.8325957145940461 1.8500490071139892 1.8675022996339325 1.8849555921538759 1.9024088846738192 1.9198621771937625 1.9373154697137058 1.9547687622336491 1.9722220547535925 1.9896753472735358 2.007128639793479 2.0245819323134224 2.0420352248333655 2.059488517353309 2.076941809873252 2.0943951023931953 2.111848394913139 2.129301687433082 2.1467549799530254 2.1642082724729685 2.181661564992912 2.199114857512855 2.2165681500327987 2.234021442552742 2.251474735072685 2.2689280275926285 2.2863813201125716 2.303834612632515 2.321287905152458 2.3387411976724017 2.356194490192345 2.3736477827122884 2.3911010752322315 2.4085543677521746 2.426007660272118 2.443460952792061 2.4609142453120048 2.478367537831948 2.4958208303518914 2.5132741228718345 2.530727415391778 2.548180707911721 2.5656340004316642 2.5830872929516078 2.600540585471551 2.6179938779914944 2.6354471705114375 2.652900463031381 2.670353755551324 2.6878070480712677 2.705260340591211 2.722713633111154 2.7401669256310974 2.7576202181510405 2.775073510670984 2.792526803190927 2.8099800957108707 2.827433388230814 2.8448866807507573 2.8623399732707004 2.8797932657906435 2.897246558310587 2.91469985083053 2.9321531433504737 2.949606435870417 2.9670597283903604 2.9845130209103035 3.001966313430247 3.01941960595019 3.036872898470133 3.0543261909900767 3.07177948351002 3.0892327760299634 3.1066860685499065 3.12413936106985 3.141592653589793 - - - 1 - - - 1 2 3 - current - - + + + + + + + + + + + + + + + fixed source + 100000 + 10 + + + 0 0 -20 + + + + 0.012 1.0 + + + + + + 1 + + + 0.0 0.017453292519943295 0.03490658503988659 0.05235987755982989 0.06981317007977318 0.08726646259971647 0.10471975511965978 0.12217304763960307 0.13962634015954636 0.15707963267948966 0.17453292519943295 0.19198621771937624 0.20943951023931956 0.22689280275926285 0.24434609527920614 0.2617993877991494 0.2792526803190927 0.29670597283903605 0.3141592653589793 0.33161255787892263 0.3490658503988659 0.3665191429188092 0.3839724354387525 0.4014257279586958 0.4188790204786391 0.4363323129985824 0.4537856055185257 0.47123889803846897 0.4886921905584123 0.5061454830783556 0.5235987755982988 0.5410520681182421 0.5585053606381855 0.5759586531581288 0.5934119456780721 0.6108652381980153 0.6283185307179586 0.6457718232379019 0.6632251157578453 0.6806784082777885 0.6981317007977318 0.7155849933176751 0.7330382858376184 0.7504915783575618 0.767944870877505 0.7853981633974483 0.8028514559173916 0.8203047484373349 0.8377580409572782 0.8552113334772214 0.8726646259971648 0.8901179185171081 0.9075712110370514 0.9250245035569946 0.9424777960769379 0.9599310885968813 0.9773843811168246 0.9948376736367679 1.0122909661567112 1.0297442586766545 1.0471975511965976 1.064650843716541 1.0821041362364843 1.0995574287564276 1.117010721276371 1.1344640137963142 1.1519173063162575 1.1693705988362009 1.1868238913561442 1.2042771838760873 1.2217304763960306 1.239183768915974 1.2566370614359172 1.2740903539558606 1.2915436464758039 1.3089969389957472 1.3264502315156905 1.3439035240356338 1.361356816555577 1.3788101090755203 1.3962634015954636 1.413716694115407 1.4311699866353502 1.4486232791552935 1.4660765716752369 1.4835298641951802 1.5009831567151235 1.5184364492350666 1.53588974175501 1.5533430342749532 1.5707963267948966 1.5882496193148399 1.6057029118347832 1.6231562043547265 1.6406094968746698 1.6580627893946132 1.6755160819145565 1.6929693744344996 1.710422666954443 1.7278759594743862 1.7453292519943295 1.7627825445142729 1.7802358370342162 1.7976891295541595 1.8151424220741028 1.8325957145940461 1.8500490071139892 1.8675022996339325 1.8849555921538759 1.9024088846738192 1.9198621771937625 1.9373154697137058 1.9547687622336491 1.9722220547535925 1.9896753472735358 2.007128639793479 2.0245819323134224 2.0420352248333655 2.059488517353309 2.076941809873252 2.0943951023931953 2.111848394913139 2.129301687433082 2.1467549799530254 2.1642082724729685 2.181661564992912 2.199114857512855 2.2165681500327987 2.234021442552742 2.251474735072685 2.2689280275926285 2.2863813201125716 2.303834612632515 2.321287905152458 2.3387411976724017 2.356194490192345 2.3736477827122884 2.3911010752322315 2.4085543677521746 2.426007660272118 2.443460952792061 2.4609142453120048 2.478367537831948 2.4958208303518914 2.5132741228718345 2.530727415391778 2.548180707911721 2.5656340004316642 2.5830872929516078 2.600540585471551 2.6179938779914944 2.6354471705114375 2.652900463031381 2.670353755551324 2.6878070480712677 2.705260340591211 2.722713633111154 2.7401669256310974 2.7576202181510405 2.775073510670984 2.792526803190927 2.8099800957108707 2.827433388230814 2.8448866807507573 2.8623399732707004 2.8797932657906435 2.897246558310587 2.91469985083053 2.9321531433504737 2.949606435870417 2.9670597283903604 2.9845130209103035 3.001966313430247 3.01941960595019 3.036872898470133 3.0543261909900767 3.07177948351002 3.0892327760299634 3.1066860685499065 3.12413936106985 3.141592653589793 + + + 1 + + + 1 2 3 + current + + + diff --git a/tests/regression_tests/periodic/inputs_true.dat b/tests/regression_tests/periodic/inputs_true.dat index c1f6d1563..9934e2de0 100644 --- a/tests/regression_tests/periodic/inputs_true.dat +++ b/tests/regression_tests/periodic/inputs_true.dat @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 4 - 0 - - - 0 0 0 5 5 0 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 4 + 0 + + + 0 0 0 5 5 0 + + + + diff --git a/tests/regression_tests/periodic_6fold/inputs_true.dat b/tests/regression_tests/periodic_6fold/inputs_true.dat index 35bbcc047..9c2899417 100644 --- a/tests/regression_tests/periodic_6fold/inputs_true.dat +++ b/tests/regression_tests/periodic_6fold/inputs_true.dat @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 4 - 0 - - - 0 0 0 5 5 0 - - - + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 4 + 0 + + + 0 0 0 5 5 0 + + + + diff --git a/tests/regression_tests/periodic_hex/inputs_true.dat b/tests/regression_tests/periodic_hex/inputs_true.dat index 00e539d4b..f4869fa58 100644 --- a/tests/regression_tests/periodic_hex/inputs_true.dat +++ b/tests/regression_tests/periodic_hex/inputs_true.dat @@ -1,24 +1,24 @@ - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + diff --git a/tests/regression_tests/photon_production/inputs_true.dat b/tests/regression_tests/photon_production/inputs_true.dat index 09f1fd290..0b2b43468 100644 --- a/tests/regression_tests/photon_production/inputs_true.dat +++ b/tests/regression_tests/photon_production/inputs_true.dat @@ -1,68 +1,67 @@ - - - - - - - - - - - - - - - - - - - fixed source - 10000 - 1 - - - 0 0 0 - - - - 14000000.0 1.0 - - - ttb - true - - 1000.0 - - - - - - 1 - - - neutron photon electron positron - - - 1 2 - current - - - 2 - Al27 total - total (n,gamma) - tracklength - - - 2 - Al27 total - total heating (n,gamma) - collision - - - 2 - Al27 total - total heating (n,gamma) - analog - - + + + + + + + + + + + + + + + + + + fixed source + 10000 + 1 + + + 0 0 0 + + + + 14000000.0 1.0 + + + ttb + true + + 1000.0 + + + + + 1 + + + neutron photon electron positron + + + 1 2 + current + + + 2 + Al27 total + total (n,gamma) + tracklength + + + 2 + Al27 total + total heating (n,gamma) + collision + + + 2 + Al27 total + total heating (n,gamma) + analog + + + diff --git a/tests/regression_tests/photon_production_fission/inputs_true.dat b/tests/regression_tests/photon_production_fission/inputs_true.dat index c317f6273..ea6e9d9ee 100644 --- a/tests/regression_tests/photon_production_fission/inputs_true.dat +++ b/tests/regression_tests/photon_production_fission/inputs_true.dat @@ -1,49 +1,48 @@ - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 2 - - - 0 0 0 - - - true - - - - - neutron photon - - - 1 - U235 total - fission heating-local - tracklength - - - 1 - U235 total - fission heating heating-local - collision - - - 1 - U235 total - fission heating heating-local - analog - - + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 2 + + + 0 0 0 + + + true + + + + neutron photon + + + 1 + U235 total + fission heating-local + tracklength + + + 1 + U235 total + fission heating heating-local + collision + + + 1 + U235 total + fission heating heating-local + analog + + + diff --git a/tests/regression_tests/photon_source/inputs_true.dat b/tests/regression_tests/photon_source/inputs_true.dat index f7c9c24b4..4c61b47fc 100644 --- a/tests/regression_tests/photon_source/inputs_true.dat +++ b/tests/regression_tests/photon_source/inputs_true.dat @@ -1,45 +1,44 @@ - - - - - - - - - - - - - - - - - fixed source - 10000 - 1 - - - 0 0 0 - - - - 10000000.0 1.0 - - - ttb - true - - 1000.0 - - - - - - photon - - - 1 - flux (n,gamma) - - + + + + + + + + + + + + + + + + fixed source + 10000 + 1 + + + 0 0 0 + + + + 10000000.0 1.0 + + + ttb + true + + 1000.0 + + + + + photon + + + 1 + flux (n,gamma) + + + diff --git a/tests/regression_tests/photon_source/test.py b/tests/regression_tests/photon_source/test.py index a2bfb9038..d4b4a69fd 100644 --- a/tests/regression_tests/photon_source/test.py +++ b/tests/regression_tests/photon_source/test.py @@ -7,20 +7,19 @@ from tests.testing_harness import PyAPITestHarness class SourceTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) mat = openmc.Material() mat.set_density('g/cm3', 0.998207) mat.add_element('H', 0.111894) mat.add_element('O', 0.888106) - materials = openmc.Materials([mat]) - materials.export_to_xml() + self._model.materials = openmc.Materials([mat]) sphere = openmc.Sphere(r=1.0e9, boundary_type='reflective') inside_sphere = openmc.Cell() inside_sphere.region = -sphere inside_sphere.fill = mat - geometry = openmc.Geometry([inside_sphere]) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry([inside_sphere]) source = openmc.Source() source.space = openmc.stats.Point((0, 0, 0)) @@ -36,16 +35,16 @@ class SourceTestHarness(PyAPITestHarness): settings.cutoff = {'energy_photon' : 1000.0} settings.run_mode = 'fixed source' settings.source = source - settings.export_to_xml() + self._model.settings = settings particle_filter = openmc.ParticleFilter('photon') tally = openmc.Tally() tally.filters = [particle_filter] tally.scores = ['flux', '(n,gamma)'] tallies = openmc.Tallies([tally]) - tallies.export_to_xml() + self._model.tallies = tallies def test_photon_source(): - harness = SourceTestHarness('statepoint.1.h5') + harness = SourceTestHarness('statepoint.1.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/resonance_scattering/inputs_true.dat b/tests/regression_tests/resonance_scattering/inputs_true.dat index 57a5e1a4b..7165fa72b 100644 --- a/tests/regression_tests/resonance_scattering/inputs_true.dat +++ b/tests/regression_tests/resonance_scattering/inputs_true.dat @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - -4 -4 -4 4 4 4 - - - - true - rvs - 1.0 - 210.0 - U238 U235 Pu239 - - + + + + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + -4 -4 -4 4 4 4 + + + + true + rvs + 1.0 + 210.0 + U238 U235 Pu239 + + + diff --git a/tests/regression_tests/resonance_scattering/test.py b/tests/regression_tests/resonance_scattering/test.py index e77dd9258..d9f76fac5 100644 --- a/tests/regression_tests/resonance_scattering/test.py +++ b/tests/regression_tests/resonance_scattering/test.py @@ -4,7 +4,8 @@ from tests.testing_harness import PyAPITestHarness class ResonanceScatteringTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # Materials mat = openmc.Material(material_id=1) mat.set_density('g/cc', 1.0) @@ -13,15 +14,13 @@ class ResonanceScatteringTestHarness(PyAPITestHarness): mat.add_nuclide('Pu239', 0.02) mat.add_nuclide('H1', 20.0) - mats_file = openmc.Materials([mat]) - mats_file.export_to_xml() + self._model.materials = openmc.Materials([mat]) # Geometry dumb_surface = openmc.XPlane(100, boundary_type='reflective') c1 = openmc.Cell(cell_id=1, fill=mat, region=-dumb_surface) root_univ = openmc.Universe(universe_id=0, cells=[c1]) - geometry = openmc.Geometry(root_univ) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root_univ) # Resonance elastic scattering settings res_scat_settings = { @@ -39,9 +38,10 @@ class ResonanceScatteringTestHarness(PyAPITestHarness): settings.source = openmc.source.Source( space=openmc.stats.Box([-4, -4, -4], [4, 4, 4])) settings.resonance_scattering = res_scat_settings - settings.export_to_xml() + self._model.settings = settings def test_resonance_scattering(): - harness = ResonanceScatteringTestHarness('statepoint.10.h5') + harness = ResonanceScatteringTestHarness('statepoint.10.h5', + model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/salphabeta/inputs_true.dat b/tests/regression_tests/salphabeta/inputs_true.dat index 29d8065cf..31a81b2c8 100644 --- a/tests/regression_tests/salphabeta/inputs_true.dat +++ b/tests/regression_tests/salphabeta/inputs_true.dat @@ -1,60 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 400 - 5 - 0 - - - -4 -4 -4 4 4 4 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 400 + 5 + 0 + + + -4 -4 -4 4 4 4 + + + + diff --git a/tests/regression_tests/score_current/inputs_true.dat b/tests/regression_tests/score_current/inputs_true.dat index 2b81f508f..f9c9ba494 100644 --- a/tests/regression_tests/score_current/inputs_true.dat +++ b/tests/regression_tests/score_current/inputs_true.dat @@ -1,55 +1,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - - - 3 3 3 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - 1 - - - 0.0 0.253 20000000.0 - - - 1 - current - - - 1 2 - current - - + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + + 3 3 3 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + 1 + + + 0.0 0.253 20000000.0 + + + 1 + current + + + 1 2 + current + + + diff --git a/tests/regression_tests/source/inputs_true.dat b/tests/regression_tests/source/inputs_true.dat index c9c9c4277..adf60c814 100644 --- a/tests/regression_tests/source/inputs_true.dat +++ b/tests/regression_tests/source/inputs_true.dat @@ -1,150 +1,150 @@ - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - - - -4.0 -1.0 3.0 0.2 0.3 0.5 - - - -2.0 0.0 2.0 0.2 0.3 0.2 - - - - - -1.0 0.0 1.0 0.5 0.25 0.25 - - - - - - - - -4.0 -4.0 -4.0 4.0 4.0 4.0 - - - - - - - 1.2 -2.3 0.781 - - - - 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - - - - - - - 0.7071067811865476 0.0 -0.7071067811865475 0.3 0.4 0.3 - - - - - - 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - - - - - - - - -2.0 0.0 2.0 0.2 0.3 0.2 - - - - - 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - - - - - - - - -2.0 0.0 2.0 0.2 0.3 0.2 - - - - - - - - - - - - - 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - - - - - - - - - 0.7071067811865476 0.0 -0.7071067811865475 0.3 0.4 0.3 - - - - - - - - - - - - - - 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - - - - + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + + + -4.0 -1.0 3.0 0.2 0.3 0.5 + + + -2.0 0.0 2.0 0.2 0.3 0.2 + + + + + -1.0 0.0 1.0 0.5 0.25 0.25 + + + + + + + + -4.0 -4.0 -4.0 4.0 4.0 4.0 + + + + + + + 1.2 -2.3 0.781 + + + + 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 + + + + + + + 0.7071067811865476 0.0 -0.7071067811865475 0.3 0.4 0.3 + + + + + + 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 + + + + + + + + -2.0 0.0 2.0 0.2 0.3 0.2 + + + + + 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 + + + + + + + + -2.0 0.0 2.0 0.2 0.3 0.2 + + + + + + + + + + + + + 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 + + + + + + + + + 0.7071067811865476 0.0 -0.7071067811865475 0.3 0.4 0.3 + + + + + + + + + + + + + + 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 + + + + + diff --git a/tests/regression_tests/source/test.py b/tests/regression_tests/source/test.py index a1175c48f..af9e67baa 100644 --- a/tests/regression_tests/source/test.py +++ b/tests/regression_tests/source/test.py @@ -7,12 +7,12 @@ from tests.testing_harness import PyAPITestHarness class SourceTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) mat1 = openmc.Material(material_id=1, temperature=294) mat1.set_density('g/cm3', 4.5) mat1.add_nuclide(openmc.Nuclide('U235'), 1.0) - materials = openmc.Materials([mat1]) - materials.export_to_xml() + self._model.materials = openmc.Materials([mat1]) sphere = openmc.Sphere(surface_id=1, r=10.0, boundary_type='vacuum') inside_sphere = openmc.Cell(cell_id=1) @@ -21,9 +21,7 @@ class SourceTestHarness(PyAPITestHarness): root = openmc.Universe(universe_id=0) root.add_cell(inside_sphere) - geometry = openmc.Geometry() - geometry.root_universe = root - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root) # Create an array of different sources x_dist = openmc.stats.Uniform(-3., 3.) @@ -84,9 +82,9 @@ class SourceTestHarness(PyAPITestHarness): settings.inactive = 5 settings.particles = 1000 settings.source = [source1, source2, source3, source4, source5, source6, source7, source8] - settings.export_to_xml() + self._model.settings = settings def test_source(): - harness = SourceTestHarness('statepoint.10.h5') + harness = SourceTestHarness('statepoint.10.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/source_dlopen/inputs_true.dat b/tests/regression_tests/source_dlopen/inputs_true.dat index 23878ac20..1a447ae3d 100644 --- a/tests/regression_tests/source_dlopen/inputs_true.dat +++ b/tests/regression_tests/source_dlopen/inputs_true.dat @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - 0 - - + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + 0 + + + diff --git a/tests/regression_tests/source_parameterized_dlopen/inputs_true.dat b/tests/regression_tests/source_parameterized_dlopen/inputs_true.dat index f4a0eba73..208030e2e 100644 --- a/tests/regression_tests/source_parameterized_dlopen/inputs_true.dat +++ b/tests/regression_tests/source_parameterized_dlopen/inputs_true.dat @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - 0 - - + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + 0 + + + diff --git a/tests/regression_tests/surface_source/inputs_true_read.dat b/tests/regression_tests/surface_source/inputs_true_read.dat index 3a122c737..fb843a6d1 100644 --- a/tests/regression_tests/surface_source/inputs_true_read.dat +++ b/tests/regression_tests/surface_source/inputs_true_read.dat @@ -1,34 +1,33 @@ - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - surface_source_true.h5 - - 1 - - - - - 3 - - - 1 - flux - - + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + surface_source_true.h5 + + 1 + + + + 3 + + + 1 + flux + + + diff --git a/tests/regression_tests/surface_source/inputs_true_write.dat b/tests/regression_tests/surface_source/inputs_true_write.dat index 48dde9900..dbdf22395 100644 --- a/tests/regression_tests/surface_source/inputs_true_write.dat +++ b/tests/regression_tests/surface_source/inputs_true_write.dat @@ -1,40 +1,39 @@ - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - 0 0 0 - - - - 1 - 1000 - - 1 - - - - - 3 - - - 1 - flux - - + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + 0 0 0 + + + + 1 + 1000 + + 1 + + + + 3 + + + 1 + flux + + + diff --git a/tests/regression_tests/surface_source/surface_source_true.h5 b/tests/regression_tests/surface_source/surface_source_true.h5 index c1b6402118e353f0e55f01ab33d0f034b3d777bc..9090c9fac498c9bf36710154a028cd48ad748e8b 100644 GIT binary patch delta 11109 zcmYjXcUYI@_kM>9)J&Y<1Xth$N8$!egG$9MngdM*ZGfgZa^M8hl%t+BCr!;tZ5Wo7 zwv;9|44aab+Jq+7w|;k@`@GlnM^noNJH zarNt6sZncGH3xskTuBel2$3&3a;yf)$9&1CMRKt#-c=;;^rYCh|8peExKDXmBc)eQ3%TXV_(n7^-;rC?;M|Rhl5yCH*OZAC=*^#)$v{&ItRDF`S`*Jy&TJDy-hBR_T7DkYI zTvkL=`~_F?TT$j;M{-TvN9gU-dLo>y33$enBlSooI}&4J3p~kcLhcDi$|5rU^K)=L z`WY{EBWS3fD?6exq;+*{OB-&>FP<#wK*^=99E&0Omn#t+==yP~Y)prr5Vr~SRBkl@RR&J_MtHaDhl ze^<^mqeQkZ5s6%1Cg(eF{cl%#^&s;_No-0tpOmELT(0U!YA=eruH=}eLEv^Ix0fgB z7S~rCDQrsaN=Fu%sf7~Ro4Sr-U!%F6*OL1`gscV0L&&aHbgP<_4x$3j zm9j*x_x8lQhUBZ*trmo?k`fE=09TH*B=b7i-j4Efk-f=eE|R|*G` zTm-M|W4rotr46MHOUe*R{f=xgRsTrhKr;J4D2?*ID_Pf2sJbMz=lW}oB(&rDYV2NH zl7kT|^FK+l(+Dl{~3jaJx=QuC#B5D}0g?p%LH;%9OFdHC0r>nV;T_awOh-715m>&a!)T2msI(0+B<7fbmb$SL!` zAFA7gPGT#2(o~+r_9yf-T7tQ<61`^@*DK{xCn_BzMSX~T7Q2~4^DlUE><*Gk(TJ_S zQqgm6C)dLs_9b~2#QKq}g}PoxvIY)_=_LE3#4U-gmAt+*mXFPvOJA-?*dY2+EJ<^? z{E92Nw{v-wRQBicQK?Me@^!9c4B+xY8Q+i08&C*~XmXh+85ZB3zT^xdw6>HM5E|x6 z@c=^CWB;z_`kPX|le@)Wz zx&ERjy;gC(iYFsdNEZ2$eh;C4%f3~Fu0bEP4@km3rV_ds?Y|G9LnPK3KpjW&ZG8h0 zbp)YrJ5u~8$(pWI^rciUnYxh%UPt#F!u6X_wKtJGhW5EB6x1G@8PpY+GWv57v(K4f zTpZ5DC8&nc)clU@A2Ce^pheYqhG%9iq_Rb$H$HJYac{`Nk@VnsL~{o5I6{U~YM8`6!o2@S_HCy8K-8t}Y$`T! zABA2VpLQjD63NYIcZW&l6GUk)52SquXQNuEIRn%KYSvb)F~gz?NY6hQA-a??;#WhAe5B`Sk1 zESJ28=t6aD_i?VT$1G?r)|a{?xd%5&!+QKuym+&j(M&N8KA^Daoi%eNVM{;J9 zo9jz%G3~liI-7R4I8tGIG1!xc=LrqNZr(=d30XLW(2dKI;Q z3!$SNx$+6gw^92a5$fsbt6gI2qtV<+z&2#LZTt{y{1kGBVY|Pe*ha~=90*56nbayo z_AahBmXi6@`U-OBZpwdz9QlIeI{0;tJ$CHN-hrP7Uv(kd~6X&yfRjNRGkj^&QDP%obJ@Rj^T3HEEaxe8kI}zb}9Lj*s3t~JF)o)LJrBXj)Z?nG8IL*n&j(fQfsK7iEPiMg0<+P>&YyY z%@^rlZO!ap`PCR%XB9F+BLAV#DRk+7sdO{0)TVTY##eEvpqge^Hw7iQ^jM8vhlXj9 zy#ZtKdTMBjEzP3`Z|Div#Ma{iGM|8Ps7L#Rb-pg@V)2MX6>cKp9E$rFs<=uvTg8ra z^*{~7p2p^wx%(Z>xY{MSx@OlmduLp|T+`SEQf{NtU}V$p#NH@HHp%4SkiD0No1r{6 zkUZtdZSQ&3y2tnP%fsj@shHYq5K4QCR4W4(R209;bKqogHo!2e)bPl z)Im{fB$3HAOE1r3DlUDXHkD9o;sG&gwF|;TT@g@I0D)|&$ z%Zh9?I;^SQg%^`$1f)B9riH0^)6*l3jNX8*VCeO}mbEhDVRC63zqT0JW=2{#ni_6^ zt2MEgdDqm{+%~4}16RYNjo#wwu^_xdC1o-7U5`$>n?8MptyoTS49*R+vfI&|K*dI! z!7GWFfE(OSl5hHQOiA8@8aHh%9bMGdOgD2SwUCI<9gT~1|2zA1W30==??YFU8`y`` z)uOicAzKmJUEJ+GlC+m~@s_4V+WIgg_%3SQfLo@yo`NiDYj)p4yM34%zR>b^CU>u= zXF8a~b)+WB;X(!{+R>OK)79M7!j49N$xC;!|@Vih>fUa3uY=#kc0H|OFbQDe!lJLj=;($+!n3G$LaYl)+B04>;`&z zv!j=TO|R!^#vuE?7LxcF5$_;z9tzDIV;*MMV;oHnT4Nf{-UsRKy}ssjvJZL(jr2*f z&m-I7jeQo4p|jDOJ&oyR)@n<(UB4!w5(6cQ;dg^ot?nCQU)K^dntjm?vd^4s<>(b; zN9eJtKDPG&$wJIIPmp}q*W3g{yo;H~5Sx7Uu%{ux5x5#YL$b`#d^i_ke~kVF$mrYgB-^Pm+XzOUDbzJydZcN;1{J(eU5KwAMJHo+jcwU&Dj%Zh&ks zuOGm1Qbfd8jz$CxcqHy6kCVOG*OT2%^?TUBz^77I<9e9aqT{>U&TrS~p+?4NSZ|AI z9W-0}@-`ST?aDF*#tUfWCY<<38G;f?Q-0tCeBe`Df6&n*!6rAv9D1DW3%KbRq5$R9 z)%+QynTck(#M8oF#y+Pm*r7OY(d|7AvBTBkG()t~lzzs(8kcvAOj}2eyg=v9Na-GG zm?|r_ks2zQM@c;-r%%%LuQ6#HrH|rE!cIz0)TBP;^*NPyK8)<0})BEvGVYj#pG)TK;4fAD@O~4O3dZ3T(+!-7?LBptv>)9JL@{OE- zo<_F#T7c~gCFE%A{$7$dqc;yQ_NT6;sOpXrHY3%}wa<2CAd6sJpX14l~fL2mGL+4mab zwawS`WK+Bgcg%MwcG1y-fyVv-_d464G_7hq>}xPdV>veA5QFk=5>@@Iz(S@!J%JFuwp9xkmMy?dxGHY zMrZ;ZAL51c3?XNcy6=%}j{>~GG}o8Pcc}S*qghjodyOWgSV*_)rT!Muad>BWhbr#F zv%^`EA49Qa#0boNLF@VgQ+p{h;<7CKkTLHd@z0W)Aq$_N-6^h~3*xy4j{)yf?PIv5 zAj?A)-bD9LGaq6RIG6~rKhkpar%;+VK*zq(*gG^9`4D1{M_QV`?YPO<6|EFS^Eg$E zl;~1A)KOxerqEQ>$xXHiU*Z<~IUV{A4_EehFw@bfz}j9tJ;_j{T!!c;fJL}Tb3=y$Lf`lz#-IoQzYxa@yPedln~v!{_!Xs_l{Cltq51bmM- zikC>vax^>$XfqsBpOXDJhN3Jp(q7$>W@M+Q>BG#WeHcZD8|1uZ2TiS!BtFN`WS}}s z-TfG^pQYx}NQMg}KSAq(2A+i|dAnQwfcBMQ>rWuBgLoCXnsuwmbwDYNGDpiaX^ef#F1)Uq|XjQ=C+H}*9Eua?@9iMUN_!U zG?tVXXnPtixkYqnj1+y%)Ob?%zrp1!oU7R;)KMeHo88@>o*QkhJ%Haazov;@nEihw z`57u>tRcQalK((`5uYVwc~aFkB2Zi!HQ#f?142(OssFLpU%_kerU& z{M+dlGJwcHKN8+by}q`Pyr$Irp`eEHdZ1 zXfy&7D!_+y-zf7l+SAKHj(nn}8OCmcef^7meu=JcHug$nvGq3HH`So~(16V2Zs^?q zP^tpYpY}#{tJFP3sqvC&uLVz`TE^H%O!hQlsnPMSmQ6R`zu6jXCeHhs5k%r)+-Ck{ z0_>AmYwR71qzv=wbIMr8} zM+r!{b5wVml)uHqN%u9YssYM;jSG&#DM%61QRr*2Z;&3i|I9M_TU^7>P~R*qnPSEt zaWy^D5X~?I%(O3fK-1C<(#qRfVTfmNE2wVtujn6>js6USy!Fl7QO04${t6vymC;>c z$Tj)_{K{$XRugTR-ENFW@_E(#(Y#Ov&_E-aUBd|@+_R1 zW9pjwnqS-K-*8=DYpT2H_^V9x0vrrN*cuOp_WXPY!UoCER`%4yYJnk4C-5)ST|Wof z284;erru)g3|#r@8vQ$hb-U3mP#U+H#)tH9xM@6!JN9~mba&N@F#2oUhA=OLEVc2p zEC}dBz9t0f6ESH7X20;H;v2%V(bTZzA>XIz{sw004;-s=O=C+m%%IagtVJ6Q(gQ80 zjzOMtv@r1ZlAdp9kZ;iMkRc(z_TvrE4*e|rVo*x%&1gTt(@HP&v#ZRNhcyXfM#!tS zT0YCjFQw!=CUy>b&TPX@*P`Hw;7?p}=bOQ3q-W4Xkmrx- z>1KxRBPm}oYLoFUX4AnOS7YupE8n4Y{K`+8=V)?_v9DlO4;(D>^kh)?*LYgc)G*KE zl_1CH8J_l9Z07fC=@Rp>6}};W@5hDuK7%LXQ6VtZ7s=V$_~l z=<>GxY4_V#^l~-7ok9Kv1TS@=v_6ipAt;o`@$6;K(DPA0%MH>RRuPvF{0BUJ1z!}0 z5y@tf+wf`~+4dOLn_`iaUj)WxwJQuwu};Y-YBre+4G^^;n;$`A+f zCQ!}Ia2+{OrJmlG>+*-)pYUL|#w@nQtYl-w9j;ac@$Z1~)Dm!-uLtfn^dSTbbm%j` z(eq2qP8RZPok1Q);nXyGA$r1UqkqODyUhjJ$g_OY(oPa9`8m^3H^BxS#(g)axQq*;h5mxp<@uI?-Yb0~-zgq{ey%pMen| zILe;V!^@1_*;6lIU(&pLjr|K0BDNu$w`%4VW5;2zi8Gr^FjJychCDxn5e0`$2tH5C z5v>r}MN9Gd|GoM4%Xj(za+mdVfhqeHkJQyo!Avv+#5E*!o9c{@$Aqoy=6 zZx^6S#1KdIaF7FCJw0~6Dft6&t8a7`l3OR;(;-l~%2Pz1RI*bANdGbp7VccFviZGjl)ec)sqA=j-lmQm@Xp#V5u; z-lEk$dR)RbL#%H$Z=dp4%8?01xFGa z=6K~zWNpI<5$P$ul%2=LD?G_Gz5}iloBDaKWHrb+CouXy$!#<~B6Y@U!LhW9L)q5lOpXd|-0V1rs7_7E4VG)pYfxAckE1Wmok0h`XL6I~!BWi;m=* zmZ`ESZhS<%kHj~l_@mf)Y-BfG;<%e`zLd70Y^o!tnh@UMOIGuobAq$*CAJBLUvebH z%slJL!RBP`<;jso^k}|RG$rd$S2Zo^JM)sEa7R z$Cvch5jXd=rkhE=q+U$fs~zz!r0g`A4vE0aI*#PTl2|E66REJD6t$tk$9y^4mf}kt z+25J)a$gQ!LO1|>kEi@}ISr{m={b%ZZ^iY4j^tfRxEE602>ZK|pGc`?lH8NFy2I6u zT))PVr1o6Tmm<4^=UmBb%Jl`V?6zGcdy>+U)W2OhYgaNGq0)@h{~S324+6jHI#O!8 zc^TnpyiaUncBPNYWmiY;VTLaa61o10 zBMDt;w;t>!k-8sJy(x9IOdr7W?kQ)ID1Rq%q&t^aNOcb`Un@mjx%?{5r8{-jN9@|Z zpLgYmUF<@sNFeJ!t|YdlrWA>8MdBRf%0+arEn~vxDZ(y~fc-)uW zy-1zuOW~D-E0ODV6oVYex{lNwY;5ux!Xhvv5H4~hryb#3Pj+@7ywZ~_i+|UZGK+B^>5?v7{{v}w zGv$Y%e&iBf~_L*yc(kk=OMPn5Z;Aibq8T@1kA03 zLvh+Y>B39mj$sLFjOf0R#J9xlLBIZU<(T<(0L3hy>(@!t668?fy)bgNt{5FccY$6;yFe;lAcZKVMnT#P=1KG zxs-a&m!v|j_wyxXHrF#GdJ5MUB7Y{6xK84GlURw6vU1^gQrw&Jg*e6mgnc~OpF*km za_DkO)j^Hp(@yozJLlci_}s_8q6VF zjHk?s$w60APym9MaA9j8;Znq>m97PNs?tgAi_4zNjW@yjG=tP?MD0C5oS8a#qTDN#bCNpOxI*6uMrbR}#H1u|HYT z02}C2EXu-WQdgjh*+^X*+tAye)rEJKYcr!N-rM)8rR3b>-VVY zI?M+T626W%{!OypB$YQYnqH7yk5Z@z<@8~4ZifF53eKV>4t^)8M^Sl35&i?KN2zMC z6um_SV^OY-aD5c^x`*p;NYu?-e+?tney$heto9OaK>^uATNmMuc2Vk>WKX2jIVeWA zFxYMh3&`}_xpp-k=r1WSM5?Q~qno9CI8l_uA0=a!E460&5VrXYO|M2ESg379Rd}5J z!^N^>FQq;~=VwjBi*oWKD!oNUeM>Y{qAG~0q<;-XMk9@0p!PKgbc=^=2wBU+PjNLB z+-@tRueCp~!#}&w{~>&*P(xi$4vZ&U<;u<<2#2AU`jT)Q^iCu!^yKV!gkw;u%!fBI zH&v3l9dE29z+I?&vq&9)X37%aGcz<+spC z{7g+_api9i?m)~OB3z47F`4isJTTB7MC#`<9g!M@S3C;L-(1hY#n={e5cIjEzJWLH z9m2a&*nTIx86D0W)b+MZpF?Nrp>7_IM9SL36C&CZ(6zlnwl5^gg63aLYI!6U$-b$S zT?*$GQuj4jA4}NK)x2|D;!IyMYYE3AJwG5^hYJ2a;ZAfe|D)bpr1EVZ)nPgM9(URX zkAhW-FA?W6$yq7MXXwGLj-G00wywvR|0%VWAb&q0@4Y&`o=fI&cxugqcaYW7$a@GS z>|Med#PczR*(HFBsG+`8{6_`1Ihq$^)<)npx89@}lZr*ge+Z}I($D~WlQyHt!ZY~a!`KfQ}03e`w8J!h~yL8d^_y3mFd0F*V^+8PeeA%BzF}) z0@&`Nu+blB`2pGW6R&W+x~q5hXWZP3LI4=yeMrjBP{Tcv zHjn5{Ikc7zG{BJ~A%i^bfIR+*GAA^-wVBP+4m}Nyk`9Y0wFaL@tkqh9XtJJS5Spq# zsNe&Q?{3acK-apAUb+5;1oKrf{r^kqE+pMl!bXU^-w40O+5f{BOVqi&O<9(&ne9x) z?Ra&-5!~d5nwxAK6J0H~G8ZZPG0D|~uHlb-O|5VEVMpV_YOo23wt~LiC26bZ$x57; zbwO#~hGKL2q?XskUIL#wA)~G{ZDV{r*u(G?l!G#7&lypMfN zY;1CmU|;8(nKI1?@;xxq+0m4`#&XKh1~(WU>uXGJ!&5PwmvHZ|db)Fjk@H+F4EJ~x zot#Y+Z@Ze`#8@76G#zCja!;GZ-O9b6>uK?56Ov_q(4imN$bi1_y@zHeb$k=4@Y+E;jrV=xu-lN4lZE zETir^$YrbG(XOUWGw!LtVY+|j>yb`I-|lNwqTzkG?wN*j5aDAC&p>8&01hlAA%HHi z)BIVIxAE3qNBg>w_TO+?a<~iDbf%$!_uL+Y(ZYCb1LaK;ywYIw%?~cF=tNv-=`Nlro)y#04 zU!oLUW%MUdNctGwi4wZR@NIa%rW&4wM|~R)@m zLG-}4ru!&YqTPB~tk>wt#bGqT@&0DyNk?-~StD0S+OLRm78Ch=D=o z_wO2emtDe4?Vo05zD7w3>-qx-#_P?@Gl+~uh6_+q+Gr9&!`BbirJiMQIcy8`7$vla&Zz@MH{p{l| zt1u8$(vN7(&M=R$p(nPiXFXW1fxo;%Tb5OVc(P^>$RDo6Y|N z2%x31Dg#` z_VxI!hM&dhO)$I*{#PCgHFfhvKUYIZ!%ZsYVJ6*`5pQ_ z`%3brr?p}Ecn;}yyD8c2ON@oidNeXN)~?0yXmj3hPj`pK@T{Ym6CoIQ(i<<{7E@B- z>X9jipGU#4DLl%T1S`hPu;V~7*v{WbmdU22k0ZMeko-O-<+lhgz}Fp{?%tA;N`~16 zByI5g1jhTK`G>*C>HH(ruaM(zbghS}Ap`yXcEaZ9wO@)1k1xE$Z(1MVH&7exns}PB z$`s9)lT}powkNw^r}RAtx;F{e;ZQ!L%}iNxFIiilkA0Qv4Sn6e#`d@X?|^Ce5Wkbz z_|g=g&1~d7j9K&uBB<(ToA`ai<%P@uY>Bz>YZ8x1@)smF#y4V{YhtDPd#c`CI+kZQ;TyxRWOxsQk9{}!6u&~e zM(V|Y=0P;-Kz+OI3lXJfscoycf6)cieGN?SDEvff>+j2^Kk3+Ki08K{)JiKG8EZ>S zqL|o%{EG26)S7{9_<7`C@@~{k(Z-vFH#;0nKEUrI_HE;HiNY6+KtpR+8-$JeMaYG} zsrUlC7WFJyw(B9^)NS%KGu8}_#`60g%rgJPtg|N5&*wdJ1#$KbFIvRUx%=q8X+cs#fF*HRyZwAjVH13_+zo~I=LFL5k z7%5UWYfT#?AN4e`rIC+oY?3`q@p9-S1K<*!8-4|8?rVNHGTf^rEltH%PtW!=i`L^(vwojO#hb=$o|c9Ed; z$G6jc-OTO#wWz(p?Hb$GV5~-kjoGL0HSCnX###bx@&eyL{kGxi7ZZlK|hTmwFwgdZTvvE!g+ z3qmj3({xPK5th&OWOyYPYX2K;L+vygp%h{0pw;0-{SXG)D^15vPphsld;(M7V8c1M z?%}5U3oTDEuUcZd4IlFM$bxVfPsFu_WArXeFky>)FQPO2wD7H~XG4|abr*b$?BYvL z5A-vu7x`Kcb`_U;dJNedalWHgWZ6D;Yx1=Q?^8G2(s!;Fj5Ow3wPdX6uE7VTL8kj+ zoPVz24xS!F=tt~#g6r9aAI8Wr#PI!y(6F&QiL?p(tJ{!dp^wM$|@Rwy%fm~0|G z2uw2kh^sqW8}96CQl`22fX0Rm!S1<{AD9&;L}zkK(l3 z8}5QCa+Bc)aeO(3zjw7N?3^Z|7R@z!Cj?N)ACFQq&FEiy8W+wjd*E_MqhE$7zs2xF zsK()O{(#dDdYm9AC*gP&8tx2R;E!Bkf}Wmf_x6oe&NBFzrXeLGf?eT!cnG^Z%@5D= zN2LBNQ<#h5S!fEoXzTp9+>RFM1M#QbbEP6qGr}($3ei z6^2hDnwA@W95pITjP6K)c}9N}LBG=Q6hy&dQ-4~sOYO>%^eFa$|0dKv#V$M3Q;0P< z60zRi*Yt1(+k@*0%Uln{$ZFFzRZkb1wpvZzV18eYT5*?Yc@j~5x8d(WhaVB`m*NB1 zGSl*yZpt*#o~{;yJ#ve8sJqgX|Ee_`jiWn?RoJaQg^(8G{y{638cPQZtgFn - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 0 - - - -0.62992 -0.62992 -1 0.62992 0.62992 1 - - - - - - - 13 - - - 14 - - - 0.0 4000000.0 20000000.0 - - - 0.0 0.7853981633974483 3.141592653589793 - - - 0.0 0.7853981633974483 3.141592653589793 - - - 1 - - - 14 - - - 13 - - - 2 - - - 3 - - - 5 6 1 2 3 - current - - - 5 4 1 2 3 - current - - - 7 8 1 2 3 - current - - - 7 4 1 2 3 - current - - - 4 1 2 3 - current - - - 10 1 2 3 - current - - - 11 1 - current - - - 11 1 - current - - + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 0 + + + -0.62992 -0.62992 -1 0.62992 0.62992 1 + + + + + + 1 + + + 2 + + + 0.0 4000000.0 20000000.0 + + + 0.0 0.7853981633974483 3.141592653589793 + + + 0.0 0.7853981633974483 3.141592653589793 + + + 1 + + + 2 + + + 1 + + + 2 + + + 3 + + + 5 6 1 2 3 + current + + + 5 4 1 2 3 + current + + + 7 8 1 2 3 + current + + + 7 4 1 2 3 + current + + + 4 1 2 3 + current + + + 10 1 2 3 + current + + + 11 1 + current + + + 11 1 + current + + + diff --git a/tests/regression_tests/surface_tally/test.py b/tests/regression_tests/surface_tally/test.py index d21f361e6..001fe6448 100644 --- a/tests/regression_tests/surface_tally/test.py +++ b/tests/regression_tests/surface_tally/test.py @@ -6,7 +6,8 @@ from tests.testing_harness import PyAPITestHarness class SurfaceTallyTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # Instantiate some Materials and register the appropriate Nuclides uo2 = openmc.Material(name='UO2 fuel at 2.4% wt enrichment') uo2.set_density('g/cc', 10.0) @@ -21,8 +22,7 @@ class SurfaceTallyTestHarness(PyAPITestHarness): borated_water.add_nuclide('O16', 1.0) # Instantiate a Materials collection and export to XML - materials_file = openmc.Materials([uo2, borated_water]) - materials_file.export_to_xml() + self._model.materials = openmc.Materials([uo2, borated_water]) # Instantiate ZCylinder surfaces fuel_or = openmc.ZCylinder(surface_id=1, x0=0, y0=0, r=1, @@ -61,8 +61,7 @@ class SurfaceTallyTestHarness(PyAPITestHarness): root_univ.add_cell(root_cell) # Instantiate a Geometry, register the root Universe - geometry = openmc.Geometry(root_univ) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root_univ) # Instantiate a Settings object, set all runtime parameters settings_file = openmc.Settings() @@ -76,7 +75,7 @@ class SurfaceTallyTestHarness(PyAPITestHarness): uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:],\ only_fissionable=True) settings_file.source = openmc.source.Source(space=uniform_dist) - settings_file.export_to_xml() + self._model.settings = settings_file # Tallies file tallies_file = openmc.Tallies() @@ -156,7 +155,7 @@ class SurfaceTallyTestHarness(PyAPITestHarness): surf_tally3.scores = ['current'] tallies_file.append(surf_tally3) - tallies_file.export_to_xml() + self._model.tallies = tallies_file def _get_results(self): """Digest info in the statepoint and return as a string.""" @@ -174,5 +173,5 @@ class SurfaceTallyTestHarness(PyAPITestHarness): def test_surface_tally(): - harness = SurfaceTallyTestHarness('statepoint.10.h5') + harness = SurfaceTallyTestHarness('statepoint.10.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/tallies/inputs_true.dat b/tests/regression_tests/tallies/inputs_true.dat index 61daba0d4..e6725024a 100644 --- a/tests/regression_tests/tallies/inputs_true.dat +++ b/tests/regression_tests/tallies/inputs_true.dat @@ -1,38 +1,187 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 @@ -50,12 +199,12 @@ 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 @@ -73,12 +222,12 @@ 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 @@ -100,12 +249,12 @@ 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 @@ -127,378 +276,228 @@ 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 400 - 5 - 0 - - - -160 -160 -183 160 160 183 - - - - - - - 2 2 - -182.07 -182.07 - 182.07 182.07 - - - -3.14159 -1.885 -0.6283 0.6283 1.885 3.14159 - - - 1 - - - 10 21 22 23 - - - 1 2 3 4 5 6 - - - 0.0 0.253 1000.0 1000000.0 20000000.0 - - - 0.0 0.253 1000.0 1000000.0 20000000.0 - - - 1 2 3 4 - - - -1.0 -0.5 0.0 0.5 1.0 - - - 0.0 0.6283 1.2566 1.885 2.5132 3.14159 - - - 4 - - - 4 - - - 1 2 3 4 6 8 - - - 1 2 5 3 6 - - - 10 21 22 23 60 - - - 21 22 23 27 28 29 60 - - - 1 - flux - tracklength - - - 1 - flux - analog - - - 1 2 - flux - tracklength - - - 3 - total - - - 4 - U235 O16 total - delayed-nu-fission decay-rate - - - 5 - total - - - 6 - scatter - - - 5 6 - scatter nu-fission - - - 7 - total - - - 8 - scatter nu-scatter - - - 8 2 - scatter nu-scatter - - - 9 - flux - tracklength - - - 9 - flux - analog - - - 9 2 - flux - tracklength - - - 10 - scatter nu-scatter - analog - - - 11 - scatter nu-scatter flux total - analog - - - 11 - flux total - collision - - - 11 - flux total - tracklength - - - 12 - total - - - 15 - scatter - - - 13 - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate - tracklength - - - 13 - U235 O16 total - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate - tracklength - - - 13 - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate - analog - - - 13 - U235 O16 total - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate - analog - - - 13 - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate - collision - - - 13 - U235 O16 total - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate - collision - - - 14 - flux - tracklength - - - 14 - flux - analog - - - 14 - flux - collision - - - H1-production H2-production H3-production He3-production He4-production heating damage-energy - - + + + + + + + + + + + + + + + + + + + + + eigenvalue + 400 + 5 + 0 + + + -160 -160 -183 160 160 183 + + + + + + 2 2 + -182.07 -182.07 + 182.07 182.07 + + + -3.14159 -1.885 -0.6283 0.6283 1.885 3.14159 + + + 1 + + + 10 21 22 23 + + + 1 2 3 4 5 6 + + + 0.0 0.253 1000.0 1000000.0 20000000.0 + + + 0.0 0.253 1000.0 1000000.0 20000000.0 + + + 1 2 3 4 + + + -1.0 -0.5 0.0 0.5 1.0 + + + 0.0 0.6283 1.2566 1.885 2.5132 3.14159 + + + 4 + + + 4 + + + 1 2 3 4 6 8 + + + 1 2 5 3 6 + + + 10 21 22 23 60 + + + 21 22 23 27 28 29 60 + + + 1 + flux + tracklength + + + 1 + flux + analog + + + 1 2 + flux + tracklength + + + 3 + total + + + 4 + U235 O16 total + delayed-nu-fission decay-rate + + + 5 + total + + + 6 + scatter + + + 5 6 + scatter nu-fission + + + 7 + total + + + 8 + scatter nu-scatter + + + 8 2 + scatter nu-scatter + + + 9 + flux + tracklength + + + 9 + flux + analog + + + 9 2 + flux + tracklength + + + 10 + scatter nu-scatter + analog + + + 11 + scatter nu-scatter flux total + analog + + + 11 + flux total + collision + + + 11 + flux total + tracklength + + + 12 + total + + + 15 + scatter + + + 13 + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate + tracklength + + + 13 + U235 O16 total + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate + tracklength + + + 13 + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate + analog + + + 13 + U235 O16 total + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate + analog + + + 13 + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate + collision + + + 13 + U235 O16 total + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable decay-rate + collision + + + 14 + flux + tracklength + + + 14 + flux + analog + + + 14 + flux + collision + + + H1-production H2-production H3-production He3-production He4-production heating damage-energy + + + diff --git a/tests/regression_tests/tally_aggregation/inputs_true.dat b/tests/regression_tests/tally_aggregation/inputs_true.dat index 80356f711..bb2dcddc5 100644 --- a/tests/regression_tests/tally_aggregation/inputs_true.dat +++ b/tests/regression_tests/tally_aggregation/inputs_true.dat @@ -1,57 +1,56 @@ - - - - - - 1.2 1.2 - 1 - 2 2 - -1.2 -1.2 - + + + + + + + + + + + + + + + + + + + + + + 1.2 1.2 + 1 + 2 2 + -1.2 -1.2 + 1 1 1 1 - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - - - - - 0.0 0.253 1000.0 1000000.0 20000000.0 - - - 1 - - - 1 2 - U234 U235 U238 - nu-fission total - - + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + + + 0.0 0.253 1000.0 1000000.0 20000000.0 + + + 1 + + + 1 2 + U234 U235 U238 + nu-fission total + + + diff --git a/tests/regression_tests/tally_arithmetic/inputs_true.dat b/tests/regression_tests/tally_arithmetic/inputs_true.dat index fbbf94fa9..41760f3cf 100644 --- a/tests/regression_tests/tally_arithmetic/inputs_true.dat +++ b/tests/regression_tests/tally_arithmetic/inputs_true.dat @@ -1,56 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 5 - 0 - - - - - 2 2 - -10.0 -10.0 - 10.0 10.0 - - - 1 2 - - - 0.0 10.0 20000000.0 - - - 1 - - - 2 1 - U234 U235 - nu-fission total - - - 1 3 - U238 U235 - total fission - - + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 5 + 0 + + + + 2 2 + -10.0 -10.0 + 10.0 10.0 + + + 1 2 + + + 0.0 10.0 20000000.0 + + + 1 + + + 2 1 + U234 U235 + nu-fission total + + + 1 3 + U238 U235 + total fission + + + diff --git a/tests/regression_tests/tally_slice_merge/inputs_true.dat b/tests/regression_tests/tally_slice_merge/inputs_true.dat index 6f421b1d9..5b5731efb 100644 --- a/tests/regression_tests/tally_slice_merge/inputs_true.dat +++ b/tests/regression_tests/tally_slice_merge/inputs_true.dat @@ -1,38 +1,187 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 @@ -50,12 +199,12 @@ 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 @@ -73,12 +222,12 @@ 3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 @@ -100,12 +249,12 @@ 5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - - - 21.42 21.42 - 21 21 - -224.91 -224.91 - + + + 21.42 21.42 + 21 21 + -224.91 -224.91 + 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 @@ -127,222 +276,72 @@ 7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -160 -160 -183 160 160 183 - - - - - - - - 2 2 - -50.0 -50.0 - 50.0 50.0 - - - 21 27 - - - 0.0 0.625 20000000.0 - - - 21 - - - 1 - - - 16 8 - U235 U238 - fission nu-fission - tracklength - - - 6 8 - U235 U238 - fission nu-fission - tracklength - - - 7 8 - U235 U238 - fission nu-fission - tracklength - - + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -160 -160 -183 160 160 183 + + + + + + + 2 2 + -50.0 -50.0 + 50.0 50.0 + + + 21 27 + + + 0.0 0.625 20000000.0 + + + 21 + + + 1 + + + 16 8 + U235 U238 + fission nu-fission + tracklength + + + 6 8 + U235 U238 + fission nu-fission + tracklength + + + 7 8 + U235 U238 + fission nu-fission + tracklength + + + diff --git a/tests/regression_tests/torus/inputs_true.dat b/tests/regression_tests/torus/inputs_true.dat index 0ccbda400..c4aa2072a 100644 --- a/tests/regression_tests/torus/inputs_true.dat +++ b/tests/regression_tests/torus/inputs_true.dat @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 1000 - 10 - 5 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 10 + 5 + + diff --git a/tests/regression_tests/torus/large_major/inputs_true.dat b/tests/regression_tests/torus/large_major/inputs_true.dat index ae3f72d0f..8e3c9a9e3 100644 --- a/tests/regression_tests/torus/large_major/inputs_true.dat +++ b/tests/regression_tests/torus/large_major/inputs_true.dat @@ -1,37 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - -1000.0 0 0 - - - - - - - flux - - + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + -1000.0 0 0 + + + + + + flux + + + diff --git a/tests/regression_tests/trigger_statepoint_restart/inputs_true.dat b/tests/regression_tests/trigger_statepoint_restart/inputs_true.dat index 2c422697b..d30f24fc0 100644 --- a/tests/regression_tests/trigger_statepoint_restart/inputs_true.dat +++ b/tests/regression_tests/trigger_statepoint_restart/inputs_true.dat @@ -1,35 +1,34 @@ - - - - - - - - - - - - - - eigenvalue - 400 - 15 - 10 - - 0.003 - std_dev - - - true - 1000 - 1 - - 1 - - - - - flux - - + + + + + + + + + + + + + eigenvalue + 400 + 15 + 10 + + 0.003 + std_dev + + + true + 1000 + 1 + + 1 + + + + flux + + + diff --git a/tests/regression_tests/triso/inputs_true.dat b/tests/regression_tests/triso/inputs_true.dat index 2ea049465..c43483884 100644 --- a/tests/regression_tests/triso/inputs_true.dat +++ b/tests/regression_tests/triso/inputs_true.dat @@ -1,442 +1,442 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.3333333333333333 0.3333333333333333 0.3333333333333333 - 38 - 3 3 3 - -0.5 -0.5 -0.5 - -17 18 19 -14 15 16 -11 12 13 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.3333333333333333 0.3333333333333333 0.3333333333333333 + 30 + 3 3 3 + -0.5 -0.5 -0.5 + +9 10 11 +6 7 8 +3 4 5 -26 27 28 -23 24 25 -20 21 22 +18 19 20 +15 16 17 +12 13 14 -35 36 37 -32 33 34 -29 30 31 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 4 - 0 - - - 0.0 0.0 0.0 - - - +27 28 29 +24 25 26 +21 22 23 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 4 + 0 + + + 0.0 0.0 0.0 + + + + diff --git a/tests/regression_tests/triso/test.py b/tests/regression_tests/triso/test.py index c44715691..248724cc2 100644 --- a/tests/regression_tests/triso/test.py +++ b/tests/regression_tests/triso/test.py @@ -9,7 +9,8 @@ from tests.testing_harness import PyAPITestHarness class TRISOTestHarness(PyAPITestHarness): - def _build_inputs(self): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # Define TRISO matrials fuel = openmc.Material() fuel.set_density('g/cm3', 10.5) @@ -78,20 +79,19 @@ class TRISOTestHarness(PyAPITestHarness): box.fill = lattice root = openmc.Universe(0, cells=[box]) - geom = openmc.Geometry(root) - geom.export_to_xml() + self._model.geometry = openmc.Geometry(root) settings = openmc.Settings() settings.batches = 4 settings.inactive = 0 settings.particles = 100 settings.source = openmc.Source(space=openmc.stats.Point()) - settings.export_to_xml() + self._model.settings = settings - mats = openmc.Materials([fuel, porous_carbon, ipyc, sic, opyc, graphite]) - mats.export_to_xml() + self._model.materials = openmc.Materials([fuel, porous_carbon, ipyc, + sic, opyc, graphite]) def test_triso(): - harness = TRISOTestHarness('statepoint.4.h5') + harness = TRISOTestHarness('statepoint.4.h5', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/unstructured_mesh/inputs_true.dat b/tests/regression_tests/unstructured_mesh/inputs_true.dat index e556782ad..dba721d7e 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_hexes.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_hexes.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true0.dat b/tests/regression_tests/unstructured_mesh/inputs_true0.dat index 2e2594cde..7c3b5a53a 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true0.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true0.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true1.dat b/tests/regression_tests/unstructured_mesh/inputs_true1.dat index 84a3b186b..2a0ca5168 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true1.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true1.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true10.dat b/tests/regression_tests/unstructured_mesh/inputs_true10.dat index e9272a333..1290a9835 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true10.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true10.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true11.dat b/tests/regression_tests/unstructured_mesh/inputs_true11.dat index 0b89d280c..5edb5cf0f 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true11.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true11.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true12.dat b/tests/regression_tests/unstructured_mesh/inputs_true12.dat index b3673a254..d8def3b5b 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true12.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true12.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.e - - - 1 - - - 2 - - - 1 - flux - tracklength - - - 2 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.e + + + 1 + + + 2 + + + 1 + flux + tracklength + + + 2 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true13.dat b/tests/regression_tests/unstructured_mesh/inputs_true13.dat index c466396b6..3afb0ce50 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true13.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true13.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.e - - - 1 - - - 2 - - - 1 - flux - tracklength - - - 2 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.e + + + 1 + + + 2 + + + 1 + flux + tracklength + + + 2 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true14.dat b/tests/regression_tests/unstructured_mesh/inputs_true14.dat index 8c6a5120a..b7de468ea 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true14.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true14.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.e - - - 1 - - - 2 - - - 1 - flux - tracklength - - - 2 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.e + + + 1 + + + 2 + + + 1 + flux + tracklength + + + 2 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true15.dat b/tests/regression_tests/unstructured_mesh/inputs_true15.dat index 1b9abbd83..bdb1dd037 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true15.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true15.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.e - - - 1 - - - 2 - - - 1 - flux - tracklength - - - 2 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.e + + + 1 + + + 2 + + + 1 + flux + tracklength + + + 2 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true2.dat b/tests/regression_tests/unstructured_mesh/inputs_true2.dat index 7136d485a..b2a998786 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true2.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true2.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true3.dat b/tests/regression_tests/unstructured_mesh/inputs_true3.dat index 23900a060..4a66dc2a6 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true3.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true3.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true4.dat b/tests/regression_tests/unstructured_mesh/inputs_true4.dat index 995a1828f..7006c0f41 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true4.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true4.dat @@ -1,92 +1,91 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.exo - - - 9 - - - 10 - - - 9 - flux - tracklength - - - 10 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 100 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.exo + + + 9 + + + 10 + + + 9 + flux + tracklength + + + 10 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true5.dat b/tests/regression_tests/unstructured_mesh/inputs_true5.dat index 60229e5e5..6c20900fa 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true5.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true5.dat @@ -1,92 +1,91 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.exo - - - 11 - - - 12 - - - 11 - flux - tracklength - - - 12 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 100 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.exo + + + 11 + + + 12 + + + 11 + flux + tracklength + + + 12 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true6.dat b/tests/regression_tests/unstructured_mesh/inputs_true6.dat index 7a9257cb7..e0be90360 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true6.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true6.dat @@ -1,92 +1,91 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.exo - - - 13 - - - 14 - - - 13 - flux - tracklength - - - 14 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 100 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.exo + + + 13 + + + 14 + + + 13 + flux + tracklength + + + 14 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true7.dat b/tests/regression_tests/unstructured_mesh/inputs_true7.dat index 52802febf..3a4cc1b83 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true7.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true7.dat @@ -1,92 +1,91 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 100 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.exo - - - 15 - - - 16 - - - 15 - flux - tracklength - - - 16 - flux - tracklength - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 100 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.exo + + + 15 + + + 16 + + + 15 + flux + tracklength + + + 16 + flux + tracklength + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true8.dat b/tests/regression_tests/unstructured_mesh/inputs_true8.dat index a0cbbcae7..bd19a95ae 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true8.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true8.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets_w_holes.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets_w_holes.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/unstructured_mesh/inputs_true9.dat b/tests/regression_tests/unstructured_mesh/inputs_true9.dat index 930bd8579..2e595a96c 100644 --- a/tests/regression_tests/unstructured_mesh/inputs_true9.dat +++ b/tests/regression_tests/unstructured_mesh/inputs_true9.dat @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 10 - - - - - 1.0 1.0 - - - 0.0 1.0 - - - - 15000000.0 1.0 - - - - - - - 10 10 10 - -10.0 -10.0 -10.0 - 10.0 10.0 10.0 - - - test_mesh_tets.e - - - 1 - - - 2 - - - 1 - flux - collision - - - 2 - flux - collision - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 10 + + + + + 1.0 1.0 + + + 0.0 1.0 + + + + 15000000.0 1.0 + + + + + + 10 10 10 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + test_mesh_tets.e + + + 1 + + + 2 + + + 1 + flux + collision + + + 2 + flux + collision + + + diff --git a/tests/regression_tests/void/inputs_true.dat b/tests/regression_tests/void/inputs_true.dat index 644952097..443c168bd 100644 --- a/tests/regression_tests/void/inputs_true.dat +++ b/tests/regression_tests/void/inputs_true.dat @@ -1,132 +1,131 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 1000 - 3 - - - 0.0 0.0 0.0 - - - - - - - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 - - - 1 - total - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 1000 + 3 + + + 0.0 0.0 0.0 + + + + + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 + + + 1 + total + + + diff --git a/tests/regression_tests/volume_calc/inputs_true.dat b/tests/regression_tests/volume_calc/inputs_true.dat index aaf6d8b00..879e05b8f 100644 --- a/tests/regression_tests/volume_calc/inputs_true.dat +++ b/tests/regression_tests/volume_calc/inputs_true.dat @@ -1,75 +1,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - volume - - cell - 1 2 3 - 100000 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - material - 1 2 - 100000 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - universe - 0 - 100000 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - cell - 1 2 3 - 100 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - - material - 1 2 - 100 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - - cell - 1 2 3 - 100 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + volume + + cell + 1 2 3 + 100000 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + material + 1 2 + 100000 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + universe + 0 + 100000 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + cell + 1 2 3 + 100 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + + material + 1 2 + 100 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + + cell + 1 2 3 + 100 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + + diff --git a/tests/regression_tests/volume_calc/inputs_true_mg.dat b/tests/regression_tests/volume_calc/inputs_true_mg.dat index 21c2a9834..f114bd8c2 100644 --- a/tests/regression_tests/volume_calc/inputs_true_mg.dat +++ b/tests/regression_tests/volume_calc/inputs_true_mg.dat @@ -1,76 +1,76 @@ - - - - - - - - - - - - - mg_lib.h5 - - - - - - - - - - - - - - - volume - multi-group - - cell - 1 2 3 - 100000 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - material - 1 2 - 100000 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - universe - 0 - 100000 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - cell - 1 2 3 - 100 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - - material - 1 2 - 100 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - - cell - 1 2 3 - 100 - -1.0 -1.0 -6.0 - 1.0 1.0 6.0 - - - + + + mg_lib.h5 + + + + + + + + + + + + + + + + + + + + + + + + volume + multi-group + + cell + 1 2 3 + 100000 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + material + 1 2 + 100000 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + universe + 0 + 100000 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + cell + 1 2 3 + 100 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + + material + 1 2 + 100 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + + cell + 1 2 3 + 100 + -1.0 -1.0 -6.0 + 1.0 1.0 6.0 + + + + diff --git a/tests/regression_tests/volume_calc/test.py b/tests/regression_tests/volume_calc/test.py index e04eac7ff..c94d16c79 100644 --- a/tests/regression_tests/volume_calc/test.py +++ b/tests/regression_tests/volume_calc/test.py @@ -21,7 +21,6 @@ class VolumeTest(PyAPITestHarness): if not is_ce: self.inputs_true = 'inputs_true_mg.dat' - def _build_inputs(self): # Define materials water = openmc.Material(1) water.add_nuclide('H1', 2.0) @@ -39,7 +38,7 @@ class VolumeTest(PyAPITestHarness): materials = openmc.Materials((water, fuel)) if not self.is_ce: materials.cross_sections = 'mg_lib.h5' - materials.export_to_xml() + self._model.materials = materials cyl = openmc.ZCylinder(surface_id=1, r=1.0, boundary_type='vacuum') top_sphere = openmc.Sphere(surface_id=2, z0=5., r=1., boundary_type='vacuum') @@ -53,8 +52,7 @@ class VolumeTest(PyAPITestHarness): bottom_hemisphere = openmc.Cell(3, fill=water, region=-bottom_sphere & -top_plane) root = openmc.Universe(0, cells=(inside_cyl, top_hemisphere, bottom_hemisphere)) - geometry = openmc.Geometry(root) - geometry.export_to_xml() + self._model.geometry = openmc.Geometry(root) # Set up stochastic volume calculation ll, ur = root.bounding_box @@ -79,7 +77,7 @@ class VolumeTest(PyAPITestHarness): if not self.is_ce: settings.energy_mode = 'multi-group' settings.volume_calculations = vol_calcs - settings.export_to_xml() + self._model.settings = settings # Create the MGXS file if necessary if not self.is_ce: @@ -170,5 +168,5 @@ class VolumeTest(PyAPITestHarness): @pytest.mark.parametrize('is_ce', [True, False]) def test_volume_calc(is_ce): - harness = VolumeTest(is_ce, '') + harness = VolumeTest(is_ce, '', model=openmc.Model()) harness.main() diff --git a/tests/regression_tests/weightwindows/inputs_true.dat b/tests/regression_tests/weightwindows/inputs_true.dat index eb42baddf..16f03a4a0 100644 --- a/tests/regression_tests/weightwindows/inputs_true.dat +++ b/tests/regression_tests/weightwindows/inputs_true.dat @@ -1,96 +1,95 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fixed source - 200 - 2 - - - 0.001 0.001 0.001 - - - 14000000.0 1.0 - - - true - - 2 - neutron - 0.0 0.5 20000000.0 - -1.0 0.007673145137236567 6.542700644645627e-07 0.0017541380096893788 0.0007245451610090619 7.476545089278482e-06 2.253382683081525e-06 2.1040609012865134e-05 0.08285899874014539 -1.0 1.0262431550731535e-13 3.3164825349503764e-16 0.0064803314120165335 3.5981031766416143e-06 -1.0 1.6205064883026195e-11 1.7770136411255912e-05 0.0001670700632870335 4.323138781337963e-05 -1.0 -1.0 6.922231352729155e-05 0.06550426960512012 -1.0 2.5639656866250453e-06 1.4508262073256659e-13 -1.0 -1.0 0.0009127050763987511 3.8523247550378815e-12 -1.0 0.0008175033526488423 -1.0 0.015148978428271613 2.5157355790201773e-07 2.1612150425221703e-06 1.3181562352445092e-10 2.9282097947816224e-05 2.762955748645507e-05 2.936268747135548e-14 1.6859219614058024e-19 3.937160538176268e-07 2.6011787393916806e-06 0.001570829313580841 -1.0 1.7041669224797384e-09 1.6421491993751715e-11 0.4899999304038166 6.948292975998466e-07 -1.0 -1.0 0.08657573566388353 0.006639379668946672 1.681305446488884e-11 2.2487617828938326e-05 4.109066205029878e-05 0.08288806458368345 -1.0 0.007385384405891666 -1.0 -1.0 1.008394964750947e-06 6.655926357459275e-08 0.0016279794552427574 1.4825219199133353e-12 -1.0 1.93847081892941e-05 1.284759166582202e-05 5.1161740516205715e-05 2.5447281241730366e-07 3.853097455417877e-06 -1.0 8.887234042637684e-05 0.01621821782442112 -1.0 1.8747824667478637e-14 5.97653814110781e-06 -1.0 -1.0 1.2296747260635405e-06 -1.0 -1.0 7.754700849337902e-06 7.091263906557291e-05 3.2799045883372075e-06 0.00020573181450240786 5.6949597066784976e-05 1.271128669411295e-07 0.0010019432401508087 -1.0 -1.0 6.848642863465585e-07 5.783974359937857e-06 2.380955631371226e-06 4.756872959630257e-05 2.1360401784344975e-18 0.00046029617115127556 1.0092905083158804e-11 0.08095280568305474 3.89841667138598e-08 4.354946981329799e-05 -1.0 0.5 0.0015447823995470042 -1.0 -1.0 0.001959411999677113 0.48573842213878143 -1.0 7.962899789920809e-06 5.619835883512353e-14 0.0835648710074336 2.7207433165796702e-11 0.00027464244062887683 4.076762579823379e-17 2.124999182004655e-05 8.037131813528501e-07 8.846493399850663e-06 1.080711295768551e-05 -1.0 -1.0 0.0010737081832502356 2.679340942769232e-06 2.1648918040467363e-05 0.0002668579837809081 1.3455341306162382e-05 2.5629068330446215e-05 1.3228013765525015e-05 -1.0 -1.0 7.002861620919232e-08 1.5172912057312398e-14 -1.0 7.989579285134734e-06 2.639268952045579e-10 -1.0 0.013330619853379314 0.00021534568699157805 2.4469456008493614e-09 8.211982683649991e-09 1.951356547084204e-15 0.00016419031150495913 5.985108617124989e-06 1.28584557092134e-05 1.5476769237571295e-14 5.5379154134462336e-08 0.0016637126543321873 2.499931357628383e-07 8.020767115181574e-07 2.7697233171399416e-13 -1.0 0.007197662162700777 -1.0 0.0833931797381589 2.8226276944532696e-05 3.353295403842037e-05 5.504813693036933e-12 0.007136750029575816 0.08636569925236791 -1.0 -1.0 6.315154082213375e-07 0.4877856021170283 -1.0 3.7051518220083886e-06 -1.0 0.0017950613169359904 7.84289689494925e-06 9.041149893307806e-07 -1.0 8.48176145671274e-10 9.03108551826469e-05 3.634644995026692e-05 2.0295213621716706e-09 1.0305672698745657e-11 1.5550455959178486e-06 0.01664109232689093 8.533030345699353e-17 0.0009252532821720597 -1.0 7.695031155172816e-14 0.0007151459162818186 -1.0 -1.0 5.182269672663266e-10 3.0160758454323657e-07 -1.0 0.06539005235506369 3.452537179033895e-05 -1.0 -1.0 3.855884234344845e-06 0.00017699858357744463 2.594951085377588e-06 1.1333627604823673e-09 -1.0 2.4306375693722205e-06 0.0063790654507599135 2.2060992580622125e-11 -1.0 -1.0 0.0848872967381878 3.932389299316285e-06 1.2911827198500372e-08 1.957092814065688e-05 0.0007213722022489493 0.0018327593437608 1.6699254277734109e-06 0.007188410694198128 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 - -10.0 0.07673145137236567 6.5427006446456266e-06 0.017541380096893787 0.0072454516100906195 7.476545089278483e-05 2.253382683081525e-05 0.00021040609012865135 0.828589987401454 -10.0 1.0262431550731535e-12 3.3164825349503764e-15 0.06480331412016534 3.5981031766416144e-05 -10.0 1.6205064883026195e-10 0.0001777013641125591 0.001670700632870335 0.0004323138781337963 -10.0 -10.0 0.0006922231352729155 0.6550426960512012 -10.0 2.5639656866250452e-05 1.4508262073256658e-12 -10.0 -10.0 0.009127050763987512 3.852324755037882e-11 -10.0 0.008175033526488424 -10.0 0.15148978428271614 2.515735579020177e-06 2.1612150425221703e-05 1.3181562352445092e-09 0.00029282097947816227 0.0002762955748645507 2.9362687471355483e-13 1.6859219614058023e-18 3.937160538176268e-06 2.6011787393916804e-05 0.015708293135808408 -10.0 1.7041669224797384e-08 1.6421491993751715e-10 4.899999304038166 6.948292975998466e-06 -10.0 -10.0 0.8657573566388354 0.06639379668946672 1.681305446488884e-10 0.00022487617828938325 0.0004109066205029878 0.8288806458368345 -10.0 0.07385384405891665 -10.0 -10.0 1.0083949647509469e-05 6.655926357459275e-07 0.016279794552427576 1.4825219199133352e-11 -10.0 0.000193847081892941 0.0001284759166582202 0.0005116174051620571 2.5447281241730365e-06 3.853097455417877e-05 -10.0 0.0008887234042637684 0.16218217824421122 -10.0 1.8747824667478637e-13 5.97653814110781e-05 -10.0 -10.0 1.2296747260635405e-05 -10.0 -10.0 7.754700849337902e-05 0.0007091263906557291 3.2799045883372076e-05 0.0020573181450240785 0.0005694959706678497 1.271128669411295e-06 0.010019432401508087 -10.0 -10.0 6.848642863465585e-06 5.7839743599378564e-05 2.380955631371226e-05 0.0004756872959630257 2.1360401784344976e-17 0.004602961711512756 1.0092905083158804e-10 0.8095280568305474 3.89841667138598e-07 0.00043549469813297995 -10.0 5.0 0.015447823995470043 -10.0 -10.0 0.01959411999677113 4.8573842213878144 -10.0 7.96289978992081e-05 5.619835883512353e-13 0.8356487100743359 2.7207433165796704e-10 0.002746424406288768 4.076762579823379e-16 0.00021249991820046548 8.037131813528501e-06 8.846493399850663e-05 0.0001080711295768551 -10.0 -10.0 0.010737081832502356 2.679340942769232e-05 0.00021648918040467362 0.0026685798378090807 0.00013455341306162382 0.00025629068330446217 0.00013228013765525016 -10.0 -10.0 7.002861620919232e-07 1.51729120573124e-13 -10.0 7.989579285134734e-05 2.639268952045579e-09 -10.0 0.13330619853379314 0.0021534568699157807 2.4469456008493615e-08 8.211982683649991e-08 1.951356547084204e-14 0.0016419031150495913 5.985108617124989e-05 0.000128584557092134 1.5476769237571296e-13 5.537915413446234e-07 0.016637126543321872 2.499931357628383e-06 8.020767115181574e-06 2.7697233171399415e-12 -10.0 0.07197662162700777 -10.0 0.8339317973815891 0.000282262769445327 0.00033532954038420373 5.504813693036933e-11 0.07136750029575815 0.8636569925236791 -10.0 -10.0 6.3151540822133754e-06 4.877856021170283 -10.0 3.7051518220083885e-05 -10.0 0.017950613169359905 7.84289689494925e-05 9.041149893307805e-06 -10.0 8.48176145671274e-09 0.000903108551826469 0.0003634644995026692 2.0295213621716707e-08 1.0305672698745658e-10 1.5550455959178486e-05 0.1664109232689093 8.533030345699353e-16 0.009252532821720597 -10.0 7.695031155172816e-13 0.007151459162818186 -10.0 -10.0 5.182269672663266e-09 3.0160758454323656e-06 -10.0 0.6539005235506369 0.0003452537179033895 -10.0 -10.0 3.855884234344845e-05 0.0017699858357744464 2.594951085377588e-05 1.1333627604823672e-08 -10.0 2.4306375693722206e-05 0.06379065450759913 2.2060992580622125e-10 -10.0 -10.0 0.848872967381878 3.9323892993162844e-05 1.2911827198500372e-07 0.0001957092814065688 0.0072137220224894934 0.018327593437608 1.669925427773411e-05 0.07188410694198127 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 - 3 - 1.5 - 10 - 1e-38 - - - 5 6 7 - -240 -240 -240 - 240 240 240 - - - 2 - neutron - 0.0 0.5 20000000.0 - -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 0.06827568359008944 0.00017329528628152923 0.018541112907970003 0.011113024641218336 8.76041935303527e-05 8.168081568291806e-05 0.00046693784586018913 0.4952432605379829 2.2512327083641865e-10 4.6258592060517866e-07 2.7044817176109556e-05 0.054902816619122045 0.00014126153603265097 8.304845400451923e-08 2.2950716170641463e-05 0.0001335621430311088 0.003432919201293737 0.0005197081842709918 5.726152701849347e-16 -1.0 0.0013332554437480327 0.4346984808472855 7.691527781829036e-17 0.00011042047857307253 3.0571050855707084e-06 -1.0 4.986698316296507e-06 0.011128424196387618 1.3106335518133802e-05 5.447493368067179e-10 0.011440381012864086 4.670673837764874e-08 0.12364069326350118 0.00012558879474108074 3.136829920007009e-05 2.34750482787598e-05 0.001537590300149361 0.0017693279949094218 6.717625881826167e-05 4.587143797469485e-08 2.6211239246796104e-05 0.00030002326388383244 0.01729816946709781 4.5757238372058234e-11 6.92296299242814e-05 3.792209399652396e-06 -1.0 9.256616392487858e-05 8.541606727879512e-07 -1.0 0.49317081643076643 0.05500108683629957 1.298062961617927e-05 0.0006870228272606287 0.0008231482263927564 0.5 3.419181071650816e-06 0.06433819434431046 6.574706543646946e-16 4.0404626147344e-13 0.0003782322077390033 0.00012637534695610975 0.017602971074583987 1.0044390728858277e-05 -1.0 0.0008787411098754915 0.00023686818807101741 0.0009304497896205121 6.949587369646497e-05 0.00012918433677593975 2.0707648529746894e-06 0.0023295401596005313 0.11819165666519223 -1.0 2.1606550732170693e-05 0.00022057970761624768 -1.0 1.0325207105027347e-08 0.0002029396545382813 2.1234980618763222e-13 -1.0 0.00024175998138228048 0.001178616843705956 0.0001399807456616496 0.0038811025614225057 0.0011076796092102186 0.00010814452764860558 0.010955637485319249 -1.0 9.382800796426366e-17 5.098747893974248e-05 0.00027052054298385255 0.00021305826462238593 0.000808100901275472 4.233410073487772e-06 0.0051513292132259495 8.616027294555462e-07 0.4873897581604287 2.9093345975075226e-05 0.000469589568463265 -1.0 -1.0 0.017802624844035688 1.3116807133030035e-15 2.617878055106949e-16 0.01884234453311008 -1.0 2.027381220364608e-16 0.0004299195570308035 1.4628847959717225e-05 0.4899952354672477 2.774067049392004e-07 0.004441328419270369 4.279460329782799e-09 0.0012297303081805393 0.0002792896409558745 0.0006934466049804711 8.370896020975689e-05 3.8270536025799805e-15 -1.0 0.01208261392046878 0.0001497958445994315 0.0015016500045374082 0.005384625561469684 0.00025519632243117644 0.0011028020390507682 0.0002362355168421952 -1.0 -1.0 8.862760180332873e-05 1.3806577785135177e-06 -1.0 0.0001319677450153934 2.6866894852481906e-05 -1.0 0.11510120013926417 0.002672923773363389 1.2257360246712472e-05 8.544159282151438e-05 2.777791741571174e-05 0.0014957033281168012 0.0003257646134837451 0.0008919466185572302 1.2907171695294846e-13 4.6842350882367666e-05 0.01721806295736377 0.00025106741008066317 0.00022234471595443313 2.101790478097517e-09 5.752120832330886e-11 0.06428782790571179 3.2478301680021854e-08 0.4903495510314233 0.001146714816952061 0.0004777967757842694 1.0882011018684852e-06 0.05708498338352203 0.4981497862127628 -1.0 3.2790914744011534e-06 0.00010077009726691265 -1.0 2.210707325798542e-07 4.3166052799897375e-05 -1.0 0.01825795827020865 0.0003182108781955478 3.8561696337086434e-05 1.0995322456277382e-06 9.53380658669839e-06 0.001550036616828061 0.0012648333883989995 5.272021975060514e-06 1.9257248009114363e-05 0.00016757997590048827 0.11891251244906934 5.515522196186723e-06 0.01102706140784316 9.904481358675478e-13 3.520674728719278e-05 0.011294708566804167 7.239087311622819e-08 -1.0 3.5740607788414942e-06 0.00035983547999740665 1.0588257623722672e-07 0.42372713683725016 0.0011273340972061078 8.582011716859219e-15 1.1514579117272292e-10 0.00043130977711323417 0.0027847329307350423 0.00017287873387910357 6.401055165502384e-06 1.722191123879782e-08 0.00020848309220162036 0.05639071613735579 1.8064550990294753e-05 1.289814511028015e-06 1.078687446476881e-14 0.4897735047310072 0.0002981891705231209 0.00016079768514218546 9.332371598523186e-05 0.011724714376848187 0.019040707071165303 0.00014242053195529864 0.06684484191345574 -1.0 - -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 0.6827568359008944 0.0017329528628152924 0.18541112907970003 0.11113024641218336 0.0008760419353035269 0.0008168081568291806 0.004669378458601891 4.952432605379829 2.2512327083641864e-09 4.625859206051786e-06 0.00027044817176109554 0.5490281661912204 0.0014126153603265096 8.304845400451923e-07 0.00022950716170641464 0.001335621430311088 0.03432919201293737 0.0051970818427099184 5.726152701849347e-15 -10.0 0.013332554437480326 4.346984808472855 7.6915277818290365e-16 0.0011042047857307254 3.0571050855707086e-05 -10.0 4.986698316296507e-05 0.11128424196387618 0.000131063355181338 5.447493368067179e-09 0.11440381012864086 4.670673837764874e-07 1.2364069326350118 0.0012558879474108074 0.0003136829920007009 0.000234750482787598 0.01537590300149361 0.01769327994909422 0.0006717625881826168 4.587143797469485e-07 0.000262112392467961 0.0030002326388383245 0.1729816946709781 4.5757238372058235e-10 0.0006922962992428139 3.792209399652396e-05 -10.0 0.0009256616392487858 8.541606727879512e-06 -10.0 4.931708164307665 0.5500108683629957 0.00012980629616179268 0.006870228272606287 0.008231482263927564 5.0 3.419181071650816e-05 0.6433819434431045 6.574706543646946e-15 4.0404626147344005e-12 0.003782322077390033 0.0012637534695610975 0.17602971074583987 0.00010044390728858278 -10.0 0.008787411098754914 0.002368681880710174 0.00930449789620512 0.0006949587369646498 0.0012918433677593976 2.0707648529746893e-05 0.023295401596005315 1.1819165666519222 -10.0 0.00021606550732170693 0.0022057970761624767 -10.0 1.0325207105027347e-07 0.0020293965453828133 2.123498061876322e-12 -10.0 0.0024175998138228046 0.01178616843705956 0.0013998074566164962 0.03881102561422506 0.011076796092102187 0.0010814452764860557 0.10955637485319249 -10.0 9.382800796426367e-16 0.0005098747893974248 0.0027052054298385255 0.0021305826462238594 0.00808100901275472 4.233410073487772e-05 0.0515132921322595 8.61602729455546e-06 4.873897581604287 0.0002909334597507523 0.0046958956846326495 -10.0 -10.0 0.1780262484403569 1.3116807133030034e-14 2.6178780551069492e-15 0.1884234453311008 -10.0 2.027381220364608e-15 0.004299195570308035 0.00014628847959717226 4.899952354672477 2.774067049392004e-06 0.04441328419270369 4.279460329782799e-08 0.012297303081805393 0.002792896409558745 0.006934466049804711 0.0008370896020975689 3.8270536025799805e-14 -10.0 0.1208261392046878 0.001497958445994315 0.015016500045374082 0.05384625561469684 0.0025519632243117644 0.011028020390507681 0.002362355168421952 -10.0 -10.0 0.0008862760180332873 1.3806577785135176e-05 -10.0 0.001319677450153934 0.00026866894852481903 -10.0 1.1510120013926417 0.026729237733633893 0.00012257360246712473 0.0008544159282151438 0.0002777791741571174 0.014957033281168012 0.0032576461348374514 0.008919466185572301 1.2907171695294846e-12 0.00046842350882367664 0.17218062957363772 0.0025106741008066318 0.0022234471595443312 2.101790478097517e-08 5.752120832330886e-10 0.6428782790571179 3.2478301680021856e-07 4.903495510314233 0.01146714816952061 0.004777967757842694 1.0882011018684853e-05 0.5708498338352204 4.981497862127628 -10.0 3.279091474401153e-05 0.0010077009726691265 -10.0 2.210707325798542e-06 0.00043166052799897375 -10.0 0.1825795827020865 0.0031821087819554777 0.00038561696337086434 1.0995322456277382e-05 9.53380658669839e-05 0.01550036616828061 0.012648333883989995 5.272021975060514e-05 0.00019257248009114364 0.0016757997590048828 1.1891251244906933 5.515522196186723e-05 0.1102706140784316 9.904481358675478e-12 0.0003520674728719278 0.11294708566804167 7.239087311622819e-07 -10.0 3.574060778841494e-05 0.0035983547999740664 1.0588257623722672e-06 4.237271368372502 0.011273340972061077 8.582011716859219e-14 1.151457911727229e-09 0.004313097771132342 0.027847329307350423 0.0017287873387910357 6.401055165502385e-05 1.722191123879782e-07 0.0020848309220162036 0.5639071613735579 0.00018064550990294753 1.289814511028015e-05 1.078687446476881e-13 4.897735047310072 0.002981891705231209 0.0016079768514218546 0.0009332371598523186 0.11724714376848187 0.19040707071165303 0.0014242053195529865 0.6684484191345574 -10.0 - 3 - 1.5 - 10 - 1e-38 - - 200 - - - - - 5 10 15 - -240 -240 -240 - 240 240 240 - - - 1 - - - 0.0 0.5 20000000.0 - - - neutron photon - - - 1 2 3 - flux - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fixed source + 200 + 2 + + + 0.001 0.001 0.001 + + + 14000000.0 1.0 + + + true + + 2 + neutron + 0.0 0.5 20000000.0 + -1.0 0.007673145137236567 6.542700644645627e-07 0.0017541380096893788 0.0007245451610090619 7.476545089278482e-06 2.253382683081525e-06 2.1040609012865134e-05 0.08285899874014539 -1.0 1.0262431550731535e-13 3.3164825349503764e-16 0.0064803314120165335 3.5981031766416143e-06 -1.0 1.6205064883026195e-11 1.7770136411255912e-05 0.0001670700632870335 4.323138781337963e-05 -1.0 -1.0 6.922231352729155e-05 0.06550426960512012 -1.0 2.5639656866250453e-06 1.4508262073256659e-13 -1.0 -1.0 0.0009127050763987511 3.8523247550378815e-12 -1.0 0.0008175033526488423 -1.0 0.015148978428271613 2.5157355790201773e-07 2.1612150425221703e-06 1.3181562352445092e-10 2.9282097947816224e-05 2.762955748645507e-05 2.936268747135548e-14 1.6859219614058024e-19 3.937160538176268e-07 2.6011787393916806e-06 0.001570829313580841 -1.0 1.7041669224797384e-09 1.6421491993751715e-11 0.4899999304038166 6.948292975998466e-07 -1.0 -1.0 0.08657573566388353 0.006639379668946672 1.681305446488884e-11 2.2487617828938326e-05 4.109066205029878e-05 0.08288806458368345 -1.0 0.007385384405891666 -1.0 -1.0 1.008394964750947e-06 6.655926357459275e-08 0.0016279794552427574 1.4825219199133353e-12 -1.0 1.93847081892941e-05 1.284759166582202e-05 5.1161740516205715e-05 2.5447281241730366e-07 3.853097455417877e-06 -1.0 8.887234042637684e-05 0.01621821782442112 -1.0 1.8747824667478637e-14 5.97653814110781e-06 -1.0 -1.0 1.2296747260635405e-06 -1.0 -1.0 7.754700849337902e-06 7.091263906557291e-05 3.2799045883372075e-06 0.00020573181450240786 5.6949597066784976e-05 1.271128669411295e-07 0.0010019432401508087 -1.0 -1.0 6.848642863465585e-07 5.783974359937857e-06 2.380955631371226e-06 4.756872959630257e-05 2.1360401784344975e-18 0.00046029617115127556 1.0092905083158804e-11 0.08095280568305474 3.89841667138598e-08 4.354946981329799e-05 -1.0 0.5 0.0015447823995470042 -1.0 -1.0 0.001959411999677113 0.48573842213878143 -1.0 7.962899789920809e-06 5.619835883512353e-14 0.0835648710074336 2.7207433165796702e-11 0.00027464244062887683 4.076762579823379e-17 2.124999182004655e-05 8.037131813528501e-07 8.846493399850663e-06 1.080711295768551e-05 -1.0 -1.0 0.0010737081832502356 2.679340942769232e-06 2.1648918040467363e-05 0.0002668579837809081 1.3455341306162382e-05 2.5629068330446215e-05 1.3228013765525015e-05 -1.0 -1.0 7.002861620919232e-08 1.5172912057312398e-14 -1.0 7.989579285134734e-06 2.639268952045579e-10 -1.0 0.013330619853379314 0.00021534568699157805 2.4469456008493614e-09 8.211982683649991e-09 1.951356547084204e-15 0.00016419031150495913 5.985108617124989e-06 1.28584557092134e-05 1.5476769237571295e-14 5.5379154134462336e-08 0.0016637126543321873 2.499931357628383e-07 8.020767115181574e-07 2.7697233171399416e-13 -1.0 0.007197662162700777 -1.0 0.0833931797381589 2.8226276944532696e-05 3.353295403842037e-05 5.504813693036933e-12 0.007136750029575816 0.08636569925236791 -1.0 -1.0 6.315154082213375e-07 0.4877856021170283 -1.0 3.7051518220083886e-06 -1.0 0.0017950613169359904 7.84289689494925e-06 9.041149893307806e-07 -1.0 8.48176145671274e-10 9.03108551826469e-05 3.634644995026692e-05 2.0295213621716706e-09 1.0305672698745657e-11 1.5550455959178486e-06 0.01664109232689093 8.533030345699353e-17 0.0009252532821720597 -1.0 7.695031155172816e-14 0.0007151459162818186 -1.0 -1.0 5.182269672663266e-10 3.0160758454323657e-07 -1.0 0.06539005235506369 3.452537179033895e-05 -1.0 -1.0 3.855884234344845e-06 0.00017699858357744463 2.594951085377588e-06 1.1333627604823673e-09 -1.0 2.4306375693722205e-06 0.0063790654507599135 2.2060992580622125e-11 -1.0 -1.0 0.0848872967381878 3.932389299316285e-06 1.2911827198500372e-08 1.957092814065688e-05 0.0007213722022489493 0.0018327593437608 1.6699254277734109e-06 0.007188410694198128 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 + -10.0 0.07673145137236567 6.5427006446456266e-06 0.017541380096893787 0.0072454516100906195 7.476545089278483e-05 2.253382683081525e-05 0.00021040609012865135 0.828589987401454 -10.0 1.0262431550731535e-12 3.3164825349503764e-15 0.06480331412016534 3.5981031766416144e-05 -10.0 1.6205064883026195e-10 0.0001777013641125591 0.001670700632870335 0.0004323138781337963 -10.0 -10.0 0.0006922231352729155 0.6550426960512012 -10.0 2.5639656866250452e-05 1.4508262073256658e-12 -10.0 -10.0 0.009127050763987512 3.852324755037882e-11 -10.0 0.008175033526488424 -10.0 0.15148978428271614 2.515735579020177e-06 2.1612150425221703e-05 1.3181562352445092e-09 0.00029282097947816227 0.0002762955748645507 2.9362687471355483e-13 1.6859219614058023e-18 3.937160538176268e-06 2.6011787393916804e-05 0.015708293135808408 -10.0 1.7041669224797384e-08 1.6421491993751715e-10 4.899999304038166 6.948292975998466e-06 -10.0 -10.0 0.8657573566388354 0.06639379668946672 1.681305446488884e-10 0.00022487617828938325 0.0004109066205029878 0.8288806458368345 -10.0 0.07385384405891665 -10.0 -10.0 1.0083949647509469e-05 6.655926357459275e-07 0.016279794552427576 1.4825219199133352e-11 -10.0 0.000193847081892941 0.0001284759166582202 0.0005116174051620571 2.5447281241730365e-06 3.853097455417877e-05 -10.0 0.0008887234042637684 0.16218217824421122 -10.0 1.8747824667478637e-13 5.97653814110781e-05 -10.0 -10.0 1.2296747260635405e-05 -10.0 -10.0 7.754700849337902e-05 0.0007091263906557291 3.2799045883372076e-05 0.0020573181450240785 0.0005694959706678497 1.271128669411295e-06 0.010019432401508087 -10.0 -10.0 6.848642863465585e-06 5.7839743599378564e-05 2.380955631371226e-05 0.0004756872959630257 2.1360401784344976e-17 0.004602961711512756 1.0092905083158804e-10 0.8095280568305474 3.89841667138598e-07 0.00043549469813297995 -10.0 5.0 0.015447823995470043 -10.0 -10.0 0.01959411999677113 4.8573842213878144 -10.0 7.96289978992081e-05 5.619835883512353e-13 0.8356487100743359 2.7207433165796704e-10 0.002746424406288768 4.076762579823379e-16 0.00021249991820046548 8.037131813528501e-06 8.846493399850663e-05 0.0001080711295768551 -10.0 -10.0 0.010737081832502356 2.679340942769232e-05 0.00021648918040467362 0.0026685798378090807 0.00013455341306162382 0.00025629068330446217 0.00013228013765525016 -10.0 -10.0 7.002861620919232e-07 1.51729120573124e-13 -10.0 7.989579285134734e-05 2.639268952045579e-09 -10.0 0.13330619853379314 0.0021534568699157807 2.4469456008493615e-08 8.211982683649991e-08 1.951356547084204e-14 0.0016419031150495913 5.985108617124989e-05 0.000128584557092134 1.5476769237571296e-13 5.537915413446234e-07 0.016637126543321872 2.499931357628383e-06 8.020767115181574e-06 2.7697233171399415e-12 -10.0 0.07197662162700777 -10.0 0.8339317973815891 0.000282262769445327 0.00033532954038420373 5.504813693036933e-11 0.07136750029575815 0.8636569925236791 -10.0 -10.0 6.3151540822133754e-06 4.877856021170283 -10.0 3.7051518220083885e-05 -10.0 0.017950613169359905 7.84289689494925e-05 9.041149893307805e-06 -10.0 8.48176145671274e-09 0.000903108551826469 0.0003634644995026692 2.0295213621716707e-08 1.0305672698745658e-10 1.5550455959178486e-05 0.1664109232689093 8.533030345699353e-16 0.009252532821720597 -10.0 7.695031155172816e-13 0.007151459162818186 -10.0 -10.0 5.182269672663266e-09 3.0160758454323656e-06 -10.0 0.6539005235506369 0.0003452537179033895 -10.0 -10.0 3.855884234344845e-05 0.0017699858357744464 2.594951085377588e-05 1.1333627604823672e-08 -10.0 2.4306375693722206e-05 0.06379065450759913 2.2060992580622125e-10 -10.0 -10.0 0.848872967381878 3.9323892993162844e-05 1.2911827198500372e-07 0.0001957092814065688 0.0072137220224894934 0.018327593437608 1.669925427773411e-05 0.07188410694198127 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 + 3 + 1.5 + 10 + 1e-38 + + + 5 6 7 + -240 -240 -240 + 240 240 240 + + + 2 + neutron + 0.0 0.5 20000000.0 + -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 0.06827568359008944 0.00017329528628152923 0.018541112907970003 0.011113024641218336 8.76041935303527e-05 8.168081568291806e-05 0.00046693784586018913 0.4952432605379829 2.2512327083641865e-10 4.6258592060517866e-07 2.7044817176109556e-05 0.054902816619122045 0.00014126153603265097 8.304845400451923e-08 2.2950716170641463e-05 0.0001335621430311088 0.003432919201293737 0.0005197081842709918 5.726152701849347e-16 -1.0 0.0013332554437480327 0.4346984808472855 7.691527781829036e-17 0.00011042047857307253 3.0571050855707084e-06 -1.0 4.986698316296507e-06 0.011128424196387618 1.3106335518133802e-05 5.447493368067179e-10 0.011440381012864086 4.670673837764874e-08 0.12364069326350118 0.00012558879474108074 3.136829920007009e-05 2.34750482787598e-05 0.001537590300149361 0.0017693279949094218 6.717625881826167e-05 4.587143797469485e-08 2.6211239246796104e-05 0.00030002326388383244 0.01729816946709781 4.5757238372058234e-11 6.92296299242814e-05 3.792209399652396e-06 -1.0 9.256616392487858e-05 8.541606727879512e-07 -1.0 0.49317081643076643 0.05500108683629957 1.298062961617927e-05 0.0006870228272606287 0.0008231482263927564 0.5 3.419181071650816e-06 0.06433819434431046 6.574706543646946e-16 4.0404626147344e-13 0.0003782322077390033 0.00012637534695610975 0.017602971074583987 1.0044390728858277e-05 -1.0 0.0008787411098754915 0.00023686818807101741 0.0009304497896205121 6.949587369646497e-05 0.00012918433677593975 2.0707648529746894e-06 0.0023295401596005313 0.11819165666519223 -1.0 2.1606550732170693e-05 0.00022057970761624768 -1.0 1.0325207105027347e-08 0.0002029396545382813 2.1234980618763222e-13 -1.0 0.00024175998138228048 0.001178616843705956 0.0001399807456616496 0.0038811025614225057 0.0011076796092102186 0.00010814452764860558 0.010955637485319249 -1.0 9.382800796426366e-17 5.098747893974248e-05 0.00027052054298385255 0.00021305826462238593 0.000808100901275472 4.233410073487772e-06 0.0051513292132259495 8.616027294555462e-07 0.4873897581604287 2.9093345975075226e-05 0.000469589568463265 -1.0 -1.0 0.017802624844035688 1.3116807133030035e-15 2.617878055106949e-16 0.01884234453311008 -1.0 2.027381220364608e-16 0.0004299195570308035 1.4628847959717225e-05 0.4899952354672477 2.774067049392004e-07 0.004441328419270369 4.279460329782799e-09 0.0012297303081805393 0.0002792896409558745 0.0006934466049804711 8.370896020975689e-05 3.8270536025799805e-15 -1.0 0.01208261392046878 0.0001497958445994315 0.0015016500045374082 0.005384625561469684 0.00025519632243117644 0.0011028020390507682 0.0002362355168421952 -1.0 -1.0 8.862760180332873e-05 1.3806577785135177e-06 -1.0 0.0001319677450153934 2.6866894852481906e-05 -1.0 0.11510120013926417 0.002672923773363389 1.2257360246712472e-05 8.544159282151438e-05 2.777791741571174e-05 0.0014957033281168012 0.0003257646134837451 0.0008919466185572302 1.2907171695294846e-13 4.6842350882367666e-05 0.01721806295736377 0.00025106741008066317 0.00022234471595443313 2.101790478097517e-09 5.752120832330886e-11 0.06428782790571179 3.2478301680021854e-08 0.4903495510314233 0.001146714816952061 0.0004777967757842694 1.0882011018684852e-06 0.05708498338352203 0.4981497862127628 -1.0 3.2790914744011534e-06 0.00010077009726691265 -1.0 2.210707325798542e-07 4.3166052799897375e-05 -1.0 0.01825795827020865 0.0003182108781955478 3.8561696337086434e-05 1.0995322456277382e-06 9.53380658669839e-06 0.001550036616828061 0.0012648333883989995 5.272021975060514e-06 1.9257248009114363e-05 0.00016757997590048827 0.11891251244906934 5.515522196186723e-06 0.01102706140784316 9.904481358675478e-13 3.520674728719278e-05 0.011294708566804167 7.239087311622819e-08 -1.0 3.5740607788414942e-06 0.00035983547999740665 1.0588257623722672e-07 0.42372713683725016 0.0011273340972061078 8.582011716859219e-15 1.1514579117272292e-10 0.00043130977711323417 0.0027847329307350423 0.00017287873387910357 6.401055165502384e-06 1.722191123879782e-08 0.00020848309220162036 0.05639071613735579 1.8064550990294753e-05 1.289814511028015e-06 1.078687446476881e-14 0.4897735047310072 0.0002981891705231209 0.00016079768514218546 9.332371598523186e-05 0.011724714376848187 0.019040707071165303 0.00014242053195529864 0.06684484191345574 -1.0 + -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 0.6827568359008944 0.0017329528628152924 0.18541112907970003 0.11113024641218336 0.0008760419353035269 0.0008168081568291806 0.004669378458601891 4.952432605379829 2.2512327083641864e-09 4.625859206051786e-06 0.00027044817176109554 0.5490281661912204 0.0014126153603265096 8.304845400451923e-07 0.00022950716170641464 0.001335621430311088 0.03432919201293737 0.0051970818427099184 5.726152701849347e-15 -10.0 0.013332554437480326 4.346984808472855 7.6915277818290365e-16 0.0011042047857307254 3.0571050855707086e-05 -10.0 4.986698316296507e-05 0.11128424196387618 0.000131063355181338 5.447493368067179e-09 0.11440381012864086 4.670673837764874e-07 1.2364069326350118 0.0012558879474108074 0.0003136829920007009 0.000234750482787598 0.01537590300149361 0.01769327994909422 0.0006717625881826168 4.587143797469485e-07 0.000262112392467961 0.0030002326388383245 0.1729816946709781 4.5757238372058235e-10 0.0006922962992428139 3.792209399652396e-05 -10.0 0.0009256616392487858 8.541606727879512e-06 -10.0 4.931708164307665 0.5500108683629957 0.00012980629616179268 0.006870228272606287 0.008231482263927564 5.0 3.419181071650816e-05 0.6433819434431045 6.574706543646946e-15 4.0404626147344005e-12 0.003782322077390033 0.0012637534695610975 0.17602971074583987 0.00010044390728858278 -10.0 0.008787411098754914 0.002368681880710174 0.00930449789620512 0.0006949587369646498 0.0012918433677593976 2.0707648529746893e-05 0.023295401596005315 1.1819165666519222 -10.0 0.00021606550732170693 0.0022057970761624767 -10.0 1.0325207105027347e-07 0.0020293965453828133 2.123498061876322e-12 -10.0 0.0024175998138228046 0.01178616843705956 0.0013998074566164962 0.03881102561422506 0.011076796092102187 0.0010814452764860557 0.10955637485319249 -10.0 9.382800796426367e-16 0.0005098747893974248 0.0027052054298385255 0.0021305826462238594 0.00808100901275472 4.233410073487772e-05 0.0515132921322595 8.61602729455546e-06 4.873897581604287 0.0002909334597507523 0.0046958956846326495 -10.0 -10.0 0.1780262484403569 1.3116807133030034e-14 2.6178780551069492e-15 0.1884234453311008 -10.0 2.027381220364608e-15 0.004299195570308035 0.00014628847959717226 4.899952354672477 2.774067049392004e-06 0.04441328419270369 4.279460329782799e-08 0.012297303081805393 0.002792896409558745 0.006934466049804711 0.0008370896020975689 3.8270536025799805e-14 -10.0 0.1208261392046878 0.001497958445994315 0.015016500045374082 0.05384625561469684 0.0025519632243117644 0.011028020390507681 0.002362355168421952 -10.0 -10.0 0.0008862760180332873 1.3806577785135176e-05 -10.0 0.001319677450153934 0.00026866894852481903 -10.0 1.1510120013926417 0.026729237733633893 0.00012257360246712473 0.0008544159282151438 0.0002777791741571174 0.014957033281168012 0.0032576461348374514 0.008919466185572301 1.2907171695294846e-12 0.00046842350882367664 0.17218062957363772 0.0025106741008066318 0.0022234471595443312 2.101790478097517e-08 5.752120832330886e-10 0.6428782790571179 3.2478301680021856e-07 4.903495510314233 0.01146714816952061 0.004777967757842694 1.0882011018684853e-05 0.5708498338352204 4.981497862127628 -10.0 3.279091474401153e-05 0.0010077009726691265 -10.0 2.210707325798542e-06 0.00043166052799897375 -10.0 0.1825795827020865 0.0031821087819554777 0.00038561696337086434 1.0995322456277382e-05 9.53380658669839e-05 0.01550036616828061 0.012648333883989995 5.272021975060514e-05 0.00019257248009114364 0.0016757997590048828 1.1891251244906933 5.515522196186723e-05 0.1102706140784316 9.904481358675478e-12 0.0003520674728719278 0.11294708566804167 7.239087311622819e-07 -10.0 3.574060778841494e-05 0.0035983547999740664 1.0588257623722672e-06 4.237271368372502 0.011273340972061077 8.582011716859219e-14 1.151457911727229e-09 0.004313097771132342 0.027847329307350423 0.0017287873387910357 6.401055165502385e-05 1.722191123879782e-07 0.0020848309220162036 0.5639071613735579 0.00018064550990294753 1.289814511028015e-05 1.078687446476881e-13 4.897735047310072 0.002981891705231209 0.0016079768514218546 0.0009332371598523186 0.11724714376848187 0.19040707071165303 0.0014242053195529865 0.6684484191345574 -10.0 + 3 + 1.5 + 10 + 1e-38 + + 200 + + + + 5 10 15 + -240 -240 -240 + 240 240 240 + + + 1 + + + 0.0 0.5 20000000.0 + + + neutron photon + + + 1 2 3 + flux + + + diff --git a/tests/testing_harness.py b/tests/testing_harness.py index 0525dd476..157f6e640 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -336,12 +336,11 @@ class PyAPITestHarness(TestHarness): def _build_inputs(self): """Write input XML files.""" - self._model.export_to_xml() + self._model.export_to_model_xml() def _get_inputs(self): """Return a hash digest of the input XML files.""" - xmls = ['geometry.xml', 'materials.xml', 'settings.xml', - 'tallies.xml', 'plots.xml'] + xmls = ['model.xml', 'plots.xml'] return ''.join([open(fname).read() for fname in xmls if os.path.exists(fname)]) @@ -371,7 +370,7 @@ class PyAPITestHarness(TestHarness): """Delete XMLs, statepoints, tally, and test files.""" super()._cleanup() output = ['materials.xml', 'geometry.xml', 'settings.xml', - 'tallies.xml', 'plots.xml', 'inputs_test.dat'] + 'tallies.xml', 'plots.xml', 'inputs_test.dat', 'model.xml'] for f in output: if os.path.exists(f): os.remove(f) From 00657ccf871ba6a4ea4d1d0cdd1ed087ba838120 Mon Sep 17 00:00:00 2001 From: guyshtot Date: Sat, 25 Mar 2023 13:50:06 +0300 Subject: [PATCH 106/136] Update openmc/mgxs/library.py apply CR suggestion Co-authored-by: Paul Romano --- openmc/mgxs/library.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 1c3a5dbb4..8ab052b0d 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -548,9 +548,9 @@ class Library: if self.nuclides: if domain_nuclides: mgxs.nuclides = [ - nuclide for nuclide in self.nuclides - if nuclide in domain_nuclides - ] + ["total"] + nuclide for nuclide in self.nuclides + if nuclide in domain_nuclides + ] + ["total"] else: mgxs.nuclides = self.nuclides From ff9d2283c428a0fe435c5fc2867426f818d18d21 Mon Sep 17 00:00:00 2001 From: guyshtot Date: Sat, 25 Mar 2023 13:52:23 +0300 Subject: [PATCH 107/136] Update tests/regression_tests/mgxs_library_specific_nuclides/test.py Remove double spaces at MGXS types in a test Co-authored-by: Paul Romano --- .../regression_tests/mgxs_library_specific_nuclides/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/test.py b/tests/regression_tests/mgxs_library_specific_nuclides/test.py index 41ae0a689..e749ca137 100644 --- a/tests/regression_tests/mgxs_library_specific_nuclides/test.py +++ b/tests/regression_tests/mgxs_library_specific_nuclides/test.py @@ -25,9 +25,9 @@ class MGXSTestHarness(PyAPITestHarness): # openmc.mgxs.ARBITRARY_MATRIX_TYPES so we can see the code works, # but not use too much resources relevant_MGXS_TYPES += [ - "(n,elastic)", "(n,level)", "(n,2n)", "(n,na)", "(n,nc)", - "(n,gamma)", "(n,a)", "(n,Xa)", "heating", "damage-energy", - "(n,n1)", "(n,a0)", "(n,nc) matrix", "(n,n1) matrix", + "(n,elastic)", "(n,level)", "(n,2n)", "(n,na)", "(n,nc)", + "(n,gamma)", "(n,a)", "(n,Xa)", "heating", "damage-energy", + "(n,n1)", "(n,a0)", "(n,nc) matrix", "(n,n1) matrix", "(n,2n) matrix"] self.mgxs_lib.mgxs_types = tuple(relevant_MGXS_TYPES) self.mgxs_lib.energy_groups = energy_groups From 4e7cae8b9858db63fc8e2806c997dc90311e3958 Mon Sep 17 00:00:00 2001 From: guyshtot Date: Sat, 25 Mar 2023 13:52:37 +0300 Subject: [PATCH 108/136] Update tests/regression_tests/mgxs_library_specific_nuclides/test.py Co-authored-by: Paul Romano --- tests/regression_tests/mgxs_library_specific_nuclides/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/test.py b/tests/regression_tests/mgxs_library_specific_nuclides/test.py index e749ca137..9af2ce17c 100644 --- a/tests/regression_tests/mgxs_library_specific_nuclides/test.py +++ b/tests/regression_tests/mgxs_library_specific_nuclides/test.py @@ -33,7 +33,7 @@ class MGXSTestHarness(PyAPITestHarness): self.mgxs_lib.energy_groups = energy_groups self.mgxs_lib.legendre_order = 3 self.mgxs_lib.domain_type = 'material' - self.mgxs_lib.nuclides=['U235','Zr90','H1'] + self.mgxs_lib.nuclides = ['U235', 'Zr90', 'H1'] self.mgxs_lib.build_library() # Add tallies From 3d1811a64a9f168d003ce6791a5b7da6c0bfd906 Mon Sep 17 00:00:00 2001 From: guyshtot Date: Sat, 25 Mar 2023 13:57:08 +0300 Subject: [PATCH 109/136] Changed merge=False to merge=True in mgxs_library_specific_nucides test to speed up the test. --- .../inputs_true.dat | 1691 +---------------- .../mgxs_library_specific_nuclides/test.py | 2 +- 2 files changed, 71 insertions(+), 1622 deletions(-) diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat index 205eb059c..061aa1b95 100644 --- a/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat @@ -50,12 +50,15 @@ - - 1 + + 1 2 3 0.0 0.625 20000000.0 + + 1 + 0.0 0.625 20000000.0 @@ -71,1699 +74,145 @@ 2 - + 3 - - 1 2 + + 383 2 total flux tracklength - + 1 2 U235 total - total + total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) tracklength - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - total - tracklength - - - 1 2 + + 383 2 total flux analog - + 1 5 6 U235 total - scatter + scatter nu-scatter analog - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - U235 total - nu-scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - absorption - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - absorption - tracklength - - - 1 2 - U235 total - (n,2n) - tracklength - - - 1 2 - U235 total - (n,3n) - tracklength - - - 1 2 - U235 total - (n,4n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - absorption - tracklength - - - 1 2 - U235 total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - nu-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - kappa-fission - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - scatter - tracklength - - - 1 2 - total - flux - analog - - - 1 2 - U235 total - nu-scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - U235 total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 30 - U235 total - nu-scatter - analog - - - 1 2 5 - U235 total - nu-scatter - analog - - - 1 2 5 - U235 total - scatter - analog - - - 1 2 - total - flux - analog - - - 1 2 5 - U235 total - nu-fission - analog - - - 1 2 5 - U235 total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - scatter - tracklength - - - 1 2 5 30 - U235 total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - scatter - tracklength - - - 1 2 5 30 - U235 total - scatter - analog - - - 1 2 5 - U235 total - nu-scatter - analog - - - 1 54 - U235 total - nu-fission - analog - - - 1 5 - U235 total - nu-fission - analog - - - 1 54 - U235 total - prompt-nu-fission - analog - - - 1 5 - U235 total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - inverse-velocity - tracklength - - - 1 2 - total - flux - tracklength - 1 2 U235 total - prompt-nu-fission - tracklength - - - 1 2 - total - flux - analog - - - 1 2 5 - U235 total - prompt-nu-fission - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - U235 total - scatter - analog - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - total - tracklength - - - 1 2 - total - flux - analog - - - 1 5 6 - U235 total nu-scatter analog - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,elastic) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,level) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,2n) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,na) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,nc) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,gamma) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,a) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,Xa) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - heating - tracklength - - - 1 2 - total - flux - tracklength - - 1 2 + 1 2 5 30 U235 total - damage-energy - tracklength + scatter nu-scatter + analog - - 1 2 - total - flux - tracklength - - - 1 2 + + 1 2 5 U235 total - (n,n1) - tracklength - - - 1 2 - total - flux - tracklength - - - 1 2 - U235 total - (n,a0) - tracklength - - - 1 2 - total - flux + nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) analog - 1 2 5 + 1 54 U235 total - (n,nc) + nu-fission prompt-nu-fission analog - 1 2 - total - flux - analog - - - 1 2 5 + 1 5 U235 total - (n,n1) + nu-fission prompt-nu-fission analog - - 1 2 - total - flux - analog - - - 1 2 5 - U235 total - (n,2n) - analog - - - 106 2 - total - flux - tracklength - - + 106 2 Zr90 total - total + total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) tracklength - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - total - tracklength - - - 106 2 - total - flux - analog - - + 106 5 6 Zr90 total - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - total - tracklength - - - 106 2 - total - flux - analog - - - 106 5 6 - Zr90 total - nu-scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - absorption - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - absorption - tracklength - - - 106 2 - Zr90 total - (n,2n) - tracklength - - - 106 2 - Zr90 total - (n,3n) - tracklength - - - 106 2 - Zr90 total - (n,4n) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - absorption - tracklength - - - 106 2 - Zr90 total - fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - nu-fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - kappa-fission - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - scatter - tracklength - - - 106 2 - total - flux - analog - - - 106 2 - Zr90 total - nu-scatter - analog - - - 106 2 - total - flux - analog - - - 106 2 5 30 - Zr90 total - scatter - analog - - - 106 2 - total - flux - analog - - - 106 2 5 30 - Zr90 total - nu-scatter - analog - - - 106 2 5 - Zr90 total - nu-scatter - analog - - - 106 2 5 - Zr90 total - scatter - analog - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 total - nu-fission - analog - - - 106 2 5 - Zr90 total - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - scatter - tracklength - - - 106 2 5 30 - Zr90 total - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - scatter - tracklength - - - 106 2 5 30 - Zr90 total - scatter - analog - - - 106 2 5 - Zr90 total - nu-scatter - analog - - - 106 54 - Zr90 total - nu-fission - analog - - - 106 5 - Zr90 total - nu-fission - analog - - - 106 54 - Zr90 total - prompt-nu-fission - analog - - - 106 5 - Zr90 total - prompt-nu-fission - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - inverse-velocity - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - prompt-nu-fission - tracklength - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 total - prompt-nu-fission - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - total - tracklength - - - 106 2 - total - flux - analog - - - 106 5 6 - Zr90 total - scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - total - tracklength - - - 106 2 - total - flux - analog - - - 106 5 6 - Zr90 total - nu-scatter - analog - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,elastic) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,level) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,2n) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,na) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,nc) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,gamma) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,a) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,Xa) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - heating - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - damage-energy - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,n1) - tracklength - - - 106 2 - total - flux - tracklength - - - 106 2 - Zr90 total - (n,a0) - tracklength - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 total - (n,nc) - analog - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 total - (n,n1) - analog - - - 106 2 - total - flux - analog - - - 106 2 5 - Zr90 total - (n,2n) - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - total - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 - H1 total - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 - H1 total - nu-scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - absorption - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - absorption - tracklength - - - 211 2 - H1 total - (n,2n) - tracklength - - - 211 2 - H1 total - (n,3n) - tracklength - - - 211 2 - H1 total - (n,4n) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - absorption - tracklength - - - 211 2 - H1 total - fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - nu-fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - kappa-fission - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - scatter - tracklength - - - 211 2 - total - flux - analog - - - 211 2 - H1 total - nu-scatter - analog - - - 211 2 - total - flux - analog - - - 211 2 5 30 - H1 total - scatter - analog - - - 211 2 - total - flux - analog - - - 211 2 5 30 - H1 total - nu-scatter - analog - - - 211 2 5 - H1 total - nu-scatter - analog - - - 211 2 5 - H1 total - scatter - analog - - - 211 2 - total - flux - analog - - - 211 2 5 - H1 total - nu-fission - analog - - - 211 2 5 - H1 total - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - scatter - tracklength - - - 211 2 5 30 - H1 total - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - scatter - tracklength - - - 211 2 5 30 - H1 total - scatter - analog - - - 211 2 5 - H1 total - nu-scatter + scatter nu-scatter analog - 211 54 - H1 total - nu-fission + 106 2 + Zr90 total + nu-scatter analog - - 211 5 - H1 total - nu-fission + + 106 2 5 30 + Zr90 total + scatter nu-scatter analog - - 211 54 - H1 total - prompt-nu-fission + + 106 2 5 + Zr90 total + nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) analog - - 211 5 - H1 total - prompt-nu-fission + + 106 54 + Zr90 total + nu-fission prompt-nu-fission analog - - 211 2 - total - flux + + 106 5 + Zr90 total + nu-fission prompt-nu-fission + analog + + + 251 2 + H1 total + total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) tracklength - - 211 2 + + 251 5 6 H1 total - inverse-velocity - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - prompt-nu-fission - tracklength - - - 211 2 - total - flux + scatter nu-scatter analog - - 211 2 5 - H1 total - prompt-nu-fission - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 - H1 total - scatter - analog - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - total - tracklength - - - 211 2 - total - flux - analog - - - 211 5 6 + + 251 2 H1 total nu-scatter analog - - 211 2 - total - flux - tracklength - - - 211 2 + + 251 2 5 30 H1 total - (n,elastic) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,level) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,2n) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,na) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,nc) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,gamma) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,a) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,Xa) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - heating - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - damage-energy - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,n1) - tracklength - - - 211 2 - total - flux - tracklength - - - 211 2 - H1 total - (n,a0) - tracklength - - - 211 2 - total - flux + scatter nu-scatter analog - - 211 2 5 + + 251 2 5 H1 total - (n,nc) + nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) analog - - 211 2 - total - flux - analog - - - 211 2 5 + + 251 54 H1 total - (n,n1) + nu-fission prompt-nu-fission analog - - 211 2 - total - flux - analog - - - 211 2 5 + + 251 5 H1 total - (n,2n) + nu-fission prompt-nu-fission analog diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/test.py b/tests/regression_tests/mgxs_library_specific_nuclides/test.py index 9af2ce17c..61910e539 100644 --- a/tests/regression_tests/mgxs_library_specific_nuclides/test.py +++ b/tests/regression_tests/mgxs_library_specific_nuclides/test.py @@ -37,7 +37,7 @@ class MGXSTestHarness(PyAPITestHarness): self.mgxs_lib.build_library() # Add tallies - self.mgxs_lib.add_to_tallies_file(self._model.tallies, merge=False) + self.mgxs_lib.add_to_tallies_file(self._model.tallies, merge=True) def _get_results(self, hash_output=True): """Digest info in the statepoint and return as a string.""" From 04806858cafa75b287a6fe32778286a41efb8e95 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Thu, 23 Mar 2023 14:59:37 -0400 Subject: [PATCH 110/136] update old tests to use new model.xml --- openmc/plots.py | 6 +- tests/regression_tests/cmfd_feed/geometry.xml | 43 -- .../regression_tests/cmfd_feed/materials.xml | 12 - tests/regression_tests/cmfd_feed/model.xml | 51 ++ tests/regression_tests/cmfd_feed/settings.xml | 26 - tests/regression_tests/cmfd_feed/tallies.xml | 21 - .../cmfd_feed_expanding_window/geometry.xml | 43 -- .../cmfd_feed_expanding_window/materials.xml | 12 - .../cmfd_feed_expanding_window/model.xml | 51 ++ .../cmfd_feed_expanding_window/settings.xml | 26 - .../cmfd_feed_expanding_window/tallies.xml | 21 - .../cmfd_feed_rectlin/geometry.xml | 43 -- .../cmfd_feed_rectlin/materials.xml | 12 - .../cmfd_feed_rectlin/model.xml | 51 ++ .../cmfd_feed_rectlin/settings.xml | 26 - .../cmfd_feed_rectlin/tallies.xml | 21 - .../cmfd_feed_ref_d/geometry.xml | 43 -- .../cmfd_feed_ref_d/materials.xml | 12 - .../cmfd_feed_ref_d/model.xml | 51 ++ .../cmfd_feed_ref_d/settings.xml | 26 - .../cmfd_feed_ref_d/tallies.xml | 21 - .../cmfd_feed_rolling_window/geometry.xml | 43 -- .../cmfd_feed_rolling_window/materials.xml | 12 - .../cmfd_feed_rolling_window/model.xml | 51 ++ .../cmfd_feed_rolling_window/settings.xml | 26 - .../cmfd_feed_rolling_window/tallies.xml | 21 - .../regression_tests/cmfd_nofeed/geometry.xml | 43 -- .../cmfd_nofeed/materials.xml | 12 - tests/regression_tests/cmfd_nofeed/model.xml | 51 ++ .../regression_tests/cmfd_nofeed/settings.xml | 26 - .../regression_tests/cmfd_nofeed/tallies.xml | 21 - .../cmfd_restart/geometry.xml | 43 -- .../cmfd_restart/materials.xml | 12 - tests/regression_tests/cmfd_restart/model.xml | 54 ++ .../cmfd_restart/settings.xml | 28 - .../regression_tests/cmfd_restart/tallies.xml | 21 - .../filter_distribcell/case-4/geometry.xml | 23 - .../filter_distribcell/case-4/materials.xml | 19 - .../filter_distribcell/case-4/model.xml | 61 ++ .../filter_distribcell/case-4/settings.xml | 12 - .../filter_distribcell/case-4/tallies.xml | 14 - .../infinite_cell/geometry.xml | 17 - .../infinite_cell/materials.xml | 14 - .../regression_tests/infinite_cell/model.xml | 39 ++ .../infinite_cell/settings.xml | 15 - .../mg_temperature/build_2g.py | 593 +++++++++--------- tests/regression_tests/plot/geometry.xml | 13 - tests/regression_tests/plot/materials.xml | 19 - tests/regression_tests/plot/model.xml | 76 +++ tests/regression_tests/plot/plots.xml | 33 - tests/regression_tests/plot/settings.xml | 13 - tests/regression_tests/plot/tallies.xml | 20 - .../plot_overlaps/geometry.xml | 14 - .../plot_overlaps/materials.xml | 19 - .../regression_tests/plot_overlaps/model.xml | 65 ++ .../regression_tests/plot_overlaps/plots.xml | 35 -- .../plot_overlaps/settings.xml | 13 - .../regression_tests/plot_voxel/geometry.xml | 13 - .../regression_tests/plot_voxel/materials.xml | 19 - tests/regression_tests/plot_voxel/model.xml | 42 ++ tests/regression_tests/plot_voxel/plots.xml | 10 - .../regression_tests/plot_voxel/settings.xml | 13 - .../track_output/geometry.xml | 305 --------- .../track_output/materials.xml | 95 --- tests/regression_tests/track_output/model.xml | 299 +++++++++ .../track_output/settings.xml | 23 - 66 files changed, 1241 insertions(+), 1787 deletions(-) delete mode 100644 tests/regression_tests/cmfd_feed/geometry.xml delete mode 100644 tests/regression_tests/cmfd_feed/materials.xml create mode 100644 tests/regression_tests/cmfd_feed/model.xml delete mode 100644 tests/regression_tests/cmfd_feed/settings.xml delete mode 100644 tests/regression_tests/cmfd_feed/tallies.xml delete mode 100644 tests/regression_tests/cmfd_feed_expanding_window/geometry.xml delete mode 100644 tests/regression_tests/cmfd_feed_expanding_window/materials.xml create mode 100644 tests/regression_tests/cmfd_feed_expanding_window/model.xml delete mode 100644 tests/regression_tests/cmfd_feed_expanding_window/settings.xml delete mode 100644 tests/regression_tests/cmfd_feed_expanding_window/tallies.xml delete mode 100644 tests/regression_tests/cmfd_feed_rectlin/geometry.xml delete mode 100644 tests/regression_tests/cmfd_feed_rectlin/materials.xml create mode 100644 tests/regression_tests/cmfd_feed_rectlin/model.xml delete mode 100644 tests/regression_tests/cmfd_feed_rectlin/settings.xml delete mode 100644 tests/regression_tests/cmfd_feed_rectlin/tallies.xml delete mode 100644 tests/regression_tests/cmfd_feed_ref_d/geometry.xml delete mode 100644 tests/regression_tests/cmfd_feed_ref_d/materials.xml create mode 100644 tests/regression_tests/cmfd_feed_ref_d/model.xml delete mode 100644 tests/regression_tests/cmfd_feed_ref_d/settings.xml delete mode 100644 tests/regression_tests/cmfd_feed_ref_d/tallies.xml delete mode 100644 tests/regression_tests/cmfd_feed_rolling_window/geometry.xml delete mode 100644 tests/regression_tests/cmfd_feed_rolling_window/materials.xml create mode 100644 tests/regression_tests/cmfd_feed_rolling_window/model.xml delete mode 100644 tests/regression_tests/cmfd_feed_rolling_window/settings.xml delete mode 100644 tests/regression_tests/cmfd_feed_rolling_window/tallies.xml delete mode 100644 tests/regression_tests/cmfd_nofeed/geometry.xml delete mode 100644 tests/regression_tests/cmfd_nofeed/materials.xml create mode 100644 tests/regression_tests/cmfd_nofeed/model.xml delete mode 100644 tests/regression_tests/cmfd_nofeed/settings.xml delete mode 100644 tests/regression_tests/cmfd_nofeed/tallies.xml delete mode 100644 tests/regression_tests/cmfd_restart/geometry.xml delete mode 100644 tests/regression_tests/cmfd_restart/materials.xml create mode 100644 tests/regression_tests/cmfd_restart/model.xml delete mode 100644 tests/regression_tests/cmfd_restart/settings.xml delete mode 100644 tests/regression_tests/cmfd_restart/tallies.xml delete mode 100644 tests/regression_tests/filter_distribcell/case-4/geometry.xml delete mode 100644 tests/regression_tests/filter_distribcell/case-4/materials.xml create mode 100644 tests/regression_tests/filter_distribcell/case-4/model.xml delete mode 100644 tests/regression_tests/filter_distribcell/case-4/settings.xml delete mode 100644 tests/regression_tests/filter_distribcell/case-4/tallies.xml delete mode 100644 tests/regression_tests/infinite_cell/geometry.xml delete mode 100644 tests/regression_tests/infinite_cell/materials.xml create mode 100644 tests/regression_tests/infinite_cell/model.xml delete mode 100644 tests/regression_tests/infinite_cell/settings.xml delete mode 100644 tests/regression_tests/plot/geometry.xml delete mode 100644 tests/regression_tests/plot/materials.xml create mode 100644 tests/regression_tests/plot/model.xml delete mode 100644 tests/regression_tests/plot/plots.xml delete mode 100644 tests/regression_tests/plot/settings.xml delete mode 100644 tests/regression_tests/plot/tallies.xml delete mode 100644 tests/regression_tests/plot_overlaps/geometry.xml delete mode 100644 tests/regression_tests/plot_overlaps/materials.xml create mode 100644 tests/regression_tests/plot_overlaps/model.xml delete mode 100644 tests/regression_tests/plot_overlaps/plots.xml delete mode 100644 tests/regression_tests/plot_overlaps/settings.xml delete mode 100644 tests/regression_tests/plot_voxel/geometry.xml delete mode 100644 tests/regression_tests/plot_voxel/materials.xml create mode 100644 tests/regression_tests/plot_voxel/model.xml delete mode 100644 tests/regression_tests/plot_voxel/plots.xml delete mode 100644 tests/regression_tests/plot_voxel/settings.xml delete mode 100644 tests/regression_tests/track_output/geometry.xml delete mode 100644 tests/regression_tests/track_output/materials.xml create mode 100644 tests/regression_tests/track_output/model.xml delete mode 100644 tests/regression_tests/track_output/settings.xml diff --git a/openmc/plots.py b/openmc/plots.py index 0a0451625..4b7d58e3b 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -683,11 +683,11 @@ class Plot(IDManagerMixin): if self._meshlines is not None: subelement = ET.SubElement(element, "meshlines") subelement.set("meshtype", self._meshlines['type']) - if self._meshlines['id'] is not None: + if 'id' in self._meshlines: subelement.set("id", str(self._meshlines['id'])) - if self._meshlines['linewidth'] is not None: + if 'linewidth' in self._meshlines: subelement.set("linewidth", str(self._meshlines['linewidth'])) - if self._meshlines['color'] is not None: + if 'color' in self._meshlines: subelement.set("color", ' '.join(map( str, self._meshlines['color']))) diff --git a/tests/regression_tests/cmfd_feed/geometry.xml b/tests/regression_tests/cmfd_feed/geometry.xml deleted file mode 100644 index 73ea679c4..000000000 --- a/tests/regression_tests/cmfd_feed/geometry.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 0 - -1 2 -3 4 -5 6 - 1 - - - - - x-plane - 10 - vacuum - - - x-plane - -10 - vacuum - - - y-plane - 1 - reflective - - - y-plane - -1 - reflective - - - z-plane - 1 - reflective - - - z-plane - -1 - reflective - - - diff --git a/tests/regression_tests/cmfd_feed/materials.xml b/tests/regression_tests/cmfd_feed/materials.xml deleted file mode 100644 index 70580e3a8..000000000 --- a/tests/regression_tests/cmfd_feed/materials.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/regression_tests/cmfd_feed/model.xml b/tests/regression_tests/cmfd_feed/model.xml new file mode 100644 index 000000000..b3fe853b2 --- /dev/null +++ b/tests/regression_tests/cmfd_feed/model.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 20 + 10 + + + -10.0 -1.0 -1.0 10.0 1.0 1.0 + + + 10 + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + 1 + + + 1 + flux + + + diff --git a/tests/regression_tests/cmfd_feed/settings.xml b/tests/regression_tests/cmfd_feed/settings.xml deleted file mode 100644 index 24b0b6ab5..000000000 --- a/tests/regression_tests/cmfd_feed/settings.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - eigenvalue - 20 - 10 - 1000 - - - - - box - -10 -1 -1 10 1 1 - - - - - - 10 1 1 - -10.0 -1.0 -1.0 - 10.0 1.0 1.0 - - 10 - - diff --git a/tests/regression_tests/cmfd_feed/tallies.xml b/tests/regression_tests/cmfd_feed/tallies.xml deleted file mode 100644 index c86971114..000000000 --- a/tests/regression_tests/cmfd_feed/tallies.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - regular - -10 -1 -1 - 10 1 1 - 10 1 1 - - - - mesh - 1 - - - - 1 - flux - - - diff --git a/tests/regression_tests/cmfd_feed_expanding_window/geometry.xml b/tests/regression_tests/cmfd_feed_expanding_window/geometry.xml deleted file mode 100644 index 73ea679c4..000000000 --- a/tests/regression_tests/cmfd_feed_expanding_window/geometry.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 0 - -1 2 -3 4 -5 6 - 1 - - - - - x-plane - 10 - vacuum - - - x-plane - -10 - vacuum - - - y-plane - 1 - reflective - - - y-plane - -1 - reflective - - - z-plane - 1 - reflective - - - z-plane - -1 - reflective - - - diff --git a/tests/regression_tests/cmfd_feed_expanding_window/materials.xml b/tests/regression_tests/cmfd_feed_expanding_window/materials.xml deleted file mode 100644 index 70580e3a8..000000000 --- a/tests/regression_tests/cmfd_feed_expanding_window/materials.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/regression_tests/cmfd_feed_expanding_window/model.xml b/tests/regression_tests/cmfd_feed_expanding_window/model.xml new file mode 100644 index 000000000..b3fe853b2 --- /dev/null +++ b/tests/regression_tests/cmfd_feed_expanding_window/model.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 20 + 10 + + + -10.0 -1.0 -1.0 10.0 1.0 1.0 + + + 10 + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + 1 + + + 1 + flux + + + diff --git a/tests/regression_tests/cmfd_feed_expanding_window/settings.xml b/tests/regression_tests/cmfd_feed_expanding_window/settings.xml deleted file mode 100644 index 24b0b6ab5..000000000 --- a/tests/regression_tests/cmfd_feed_expanding_window/settings.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - eigenvalue - 20 - 10 - 1000 - - - - - box - -10 -1 -1 10 1 1 - - - - - - 10 1 1 - -10.0 -1.0 -1.0 - 10.0 1.0 1.0 - - 10 - - diff --git a/tests/regression_tests/cmfd_feed_expanding_window/tallies.xml b/tests/regression_tests/cmfd_feed_expanding_window/tallies.xml deleted file mode 100644 index c86971114..000000000 --- a/tests/regression_tests/cmfd_feed_expanding_window/tallies.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - regular - -10 -1 -1 - 10 1 1 - 10 1 1 - - - - mesh - 1 - - - - 1 - flux - - - diff --git a/tests/regression_tests/cmfd_feed_rectlin/geometry.xml b/tests/regression_tests/cmfd_feed_rectlin/geometry.xml deleted file mode 100644 index 73ea679c4..000000000 --- a/tests/regression_tests/cmfd_feed_rectlin/geometry.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 0 - -1 2 -3 4 -5 6 - 1 - - - - - x-plane - 10 - vacuum - - - x-plane - -10 - vacuum - - - y-plane - 1 - reflective - - - y-plane - -1 - reflective - - - z-plane - 1 - reflective - - - z-plane - -1 - reflective - - - diff --git a/tests/regression_tests/cmfd_feed_rectlin/materials.xml b/tests/regression_tests/cmfd_feed_rectlin/materials.xml deleted file mode 100644 index 70580e3a8..000000000 --- a/tests/regression_tests/cmfd_feed_rectlin/materials.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/regression_tests/cmfd_feed_rectlin/model.xml b/tests/regression_tests/cmfd_feed_rectlin/model.xml new file mode 100644 index 000000000..b3fe853b2 --- /dev/null +++ b/tests/regression_tests/cmfd_feed_rectlin/model.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 20 + 10 + + + -10.0 -1.0 -1.0 10.0 1.0 1.0 + + + 10 + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + 1 + + + 1 + flux + + + diff --git a/tests/regression_tests/cmfd_feed_rectlin/settings.xml b/tests/regression_tests/cmfd_feed_rectlin/settings.xml deleted file mode 100644 index 24b0b6ab5..000000000 --- a/tests/regression_tests/cmfd_feed_rectlin/settings.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - eigenvalue - 20 - 10 - 1000 - - - - - box - -10 -1 -1 10 1 1 - - - - - - 10 1 1 - -10.0 -1.0 -1.0 - 10.0 1.0 1.0 - - 10 - - diff --git a/tests/regression_tests/cmfd_feed_rectlin/tallies.xml b/tests/regression_tests/cmfd_feed_rectlin/tallies.xml deleted file mode 100644 index c86971114..000000000 --- a/tests/regression_tests/cmfd_feed_rectlin/tallies.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - regular - -10 -1 -1 - 10 1 1 - 10 1 1 - - - - mesh - 1 - - - - 1 - flux - - - diff --git a/tests/regression_tests/cmfd_feed_ref_d/geometry.xml b/tests/regression_tests/cmfd_feed_ref_d/geometry.xml deleted file mode 100644 index 73ea679c4..000000000 --- a/tests/regression_tests/cmfd_feed_ref_d/geometry.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 0 - -1 2 -3 4 -5 6 - 1 - - - - - x-plane - 10 - vacuum - - - x-plane - -10 - vacuum - - - y-plane - 1 - reflective - - - y-plane - -1 - reflective - - - z-plane - 1 - reflective - - - z-plane - -1 - reflective - - - diff --git a/tests/regression_tests/cmfd_feed_ref_d/materials.xml b/tests/regression_tests/cmfd_feed_ref_d/materials.xml deleted file mode 100644 index 70580e3a8..000000000 --- a/tests/regression_tests/cmfd_feed_ref_d/materials.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/regression_tests/cmfd_feed_ref_d/model.xml b/tests/regression_tests/cmfd_feed_ref_d/model.xml new file mode 100644 index 000000000..b3fe853b2 --- /dev/null +++ b/tests/regression_tests/cmfd_feed_ref_d/model.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 20 + 10 + + + -10.0 -1.0 -1.0 10.0 1.0 1.0 + + + 10 + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + 1 + + + 1 + flux + + + diff --git a/tests/regression_tests/cmfd_feed_ref_d/settings.xml b/tests/regression_tests/cmfd_feed_ref_d/settings.xml deleted file mode 100644 index 24b0b6ab5..000000000 --- a/tests/regression_tests/cmfd_feed_ref_d/settings.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - eigenvalue - 20 - 10 - 1000 - - - - - box - -10 -1 -1 10 1 1 - - - - - - 10 1 1 - -10.0 -1.0 -1.0 - 10.0 1.0 1.0 - - 10 - - diff --git a/tests/regression_tests/cmfd_feed_ref_d/tallies.xml b/tests/regression_tests/cmfd_feed_ref_d/tallies.xml deleted file mode 100644 index c86971114..000000000 --- a/tests/regression_tests/cmfd_feed_ref_d/tallies.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - regular - -10 -1 -1 - 10 1 1 - 10 1 1 - - - - mesh - 1 - - - - 1 - flux - - - diff --git a/tests/regression_tests/cmfd_feed_rolling_window/geometry.xml b/tests/regression_tests/cmfd_feed_rolling_window/geometry.xml deleted file mode 100644 index 73ea679c4..000000000 --- a/tests/regression_tests/cmfd_feed_rolling_window/geometry.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 0 - -1 2 -3 4 -5 6 - 1 - - - - - x-plane - 10 - vacuum - - - x-plane - -10 - vacuum - - - y-plane - 1 - reflective - - - y-plane - -1 - reflective - - - z-plane - 1 - reflective - - - z-plane - -1 - reflective - - - diff --git a/tests/regression_tests/cmfd_feed_rolling_window/materials.xml b/tests/regression_tests/cmfd_feed_rolling_window/materials.xml deleted file mode 100644 index 70580e3a8..000000000 --- a/tests/regression_tests/cmfd_feed_rolling_window/materials.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/regression_tests/cmfd_feed_rolling_window/model.xml b/tests/regression_tests/cmfd_feed_rolling_window/model.xml new file mode 100644 index 000000000..b3fe853b2 --- /dev/null +++ b/tests/regression_tests/cmfd_feed_rolling_window/model.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 20 + 10 + + + -10.0 -1.0 -1.0 10.0 1.0 1.0 + + + 10 + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + 1 + + + 1 + flux + + + diff --git a/tests/regression_tests/cmfd_feed_rolling_window/settings.xml b/tests/regression_tests/cmfd_feed_rolling_window/settings.xml deleted file mode 100644 index 24b0b6ab5..000000000 --- a/tests/regression_tests/cmfd_feed_rolling_window/settings.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - eigenvalue - 20 - 10 - 1000 - - - - - box - -10 -1 -1 10 1 1 - - - - - - 10 1 1 - -10.0 -1.0 -1.0 - 10.0 1.0 1.0 - - 10 - - diff --git a/tests/regression_tests/cmfd_feed_rolling_window/tallies.xml b/tests/regression_tests/cmfd_feed_rolling_window/tallies.xml deleted file mode 100644 index c86971114..000000000 --- a/tests/regression_tests/cmfd_feed_rolling_window/tallies.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - regular - -10 -1 -1 - 10 1 1 - 10 1 1 - - - - mesh - 1 - - - - 1 - flux - - - diff --git a/tests/regression_tests/cmfd_nofeed/geometry.xml b/tests/regression_tests/cmfd_nofeed/geometry.xml deleted file mode 100644 index 73ea679c4..000000000 --- a/tests/regression_tests/cmfd_nofeed/geometry.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 0 - -1 2 -3 4 -5 6 - 1 - - - - - x-plane - 10 - vacuum - - - x-plane - -10 - vacuum - - - y-plane - 1 - reflective - - - y-plane - -1 - reflective - - - z-plane - 1 - reflective - - - z-plane - -1 - reflective - - - diff --git a/tests/regression_tests/cmfd_nofeed/materials.xml b/tests/regression_tests/cmfd_nofeed/materials.xml deleted file mode 100644 index 70580e3a8..000000000 --- a/tests/regression_tests/cmfd_nofeed/materials.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/regression_tests/cmfd_nofeed/model.xml b/tests/regression_tests/cmfd_nofeed/model.xml new file mode 100644 index 000000000..b3fe853b2 --- /dev/null +++ b/tests/regression_tests/cmfd_nofeed/model.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 20 + 10 + + + -10.0 -1.0 -1.0 10.0 1.0 1.0 + + + 10 + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + 1 + + + 1 + flux + + + diff --git a/tests/regression_tests/cmfd_nofeed/settings.xml b/tests/regression_tests/cmfd_nofeed/settings.xml deleted file mode 100644 index 24b0b6ab5..000000000 --- a/tests/regression_tests/cmfd_nofeed/settings.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - eigenvalue - 20 - 10 - 1000 - - - - - box - -10 -1 -1 10 1 1 - - - - - - 10 1 1 - -10.0 -1.0 -1.0 - 10.0 1.0 1.0 - - 10 - - diff --git a/tests/regression_tests/cmfd_nofeed/tallies.xml b/tests/regression_tests/cmfd_nofeed/tallies.xml deleted file mode 100644 index c86971114..000000000 --- a/tests/regression_tests/cmfd_nofeed/tallies.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - regular - -10 -1 -1 - 10 1 1 - 10 1 1 - - - - mesh - 1 - - - - 1 - flux - - - diff --git a/tests/regression_tests/cmfd_restart/geometry.xml b/tests/regression_tests/cmfd_restart/geometry.xml deleted file mode 100644 index 73ea679c4..000000000 --- a/tests/regression_tests/cmfd_restart/geometry.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 0 - -1 2 -3 4 -5 6 - 1 - - - - - x-plane - 10 - vacuum - - - x-plane - -10 - vacuum - - - y-plane - 1 - reflective - - - y-plane - -1 - reflective - - - z-plane - 1 - reflective - - - z-plane - -1 - reflective - - - diff --git a/tests/regression_tests/cmfd_restart/materials.xml b/tests/regression_tests/cmfd_restart/materials.xml deleted file mode 100644 index 70580e3a8..000000000 --- a/tests/regression_tests/cmfd_restart/materials.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/regression_tests/cmfd_restart/model.xml b/tests/regression_tests/cmfd_restart/model.xml new file mode 100644 index 000000000..487e9b66d --- /dev/null +++ b/tests/regression_tests/cmfd_restart/model.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + eigenvalue + 1000 + 20 + 10 + + + -10.0 -1.0 -1.0 10.0 1.0 1.0 + + + + 15 20 + + 10 + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + + + 10 1 1 + -10.0 -1.0 -1.0 + 10.0 1.0 1.0 + + + 1 + + + 1 + flux + + + diff --git a/tests/regression_tests/cmfd_restart/settings.xml b/tests/regression_tests/cmfd_restart/settings.xml deleted file mode 100644 index ba5495911..000000000 --- a/tests/regression_tests/cmfd_restart/settings.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - eigenvalue - 20 - 10 - 1000 - - - - - box - -10 -1 -1 10 1 1 - - - - - - 10 1 1 - -10.0 -1.0 -1.0 - 10.0 1.0 1.0 - - 10 - - - - diff --git a/tests/regression_tests/cmfd_restart/tallies.xml b/tests/regression_tests/cmfd_restart/tallies.xml deleted file mode 100644 index c86971114..000000000 --- a/tests/regression_tests/cmfd_restart/tallies.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - regular - -10 -1 -1 - 10 1 1 - 10 1 1 - - - - mesh - 1 - - - - 1 - flux - - - diff --git a/tests/regression_tests/filter_distribcell/case-4/geometry.xml b/tests/regression_tests/filter_distribcell/case-4/geometry.xml deleted file mode 100644 index c835218bc..000000000 --- a/tests/regression_tests/filter_distribcell/case-4/geometry.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - 1.0 - 3 -
0.0 0.0
- - 1 -1 1 - 1 -1 1 - 1 -
- - - - - -
diff --git a/tests/regression_tests/filter_distribcell/case-4/materials.xml b/tests/regression_tests/filter_distribcell/case-4/materials.xml deleted file mode 100644 index 2eb744fe6..000000000 --- a/tests/regression_tests/filter_distribcell/case-4/materials.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tests/regression_tests/filter_distribcell/case-4/model.xml b/tests/regression_tests/filter_distribcell/case-4/model.xml new file mode 100644 index 000000000..869421919 --- /dev/null +++ b/tests/regression_tests/filter_distribcell/case-4/model.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 1.0 + 3 +
0.0 0.0
+ + 1 +1 1 + 1 +1 1 + 1 +
+ + + + + +
+ + eigenvalue + 1000 + 1 + 0 + + + -1.0 -1.0 -1.0 1.0 1.0 1.0 + + + + + + 101 + + + 1 + total + + +
diff --git a/tests/regression_tests/filter_distribcell/case-4/settings.xml b/tests/regression_tests/filter_distribcell/case-4/settings.xml deleted file mode 100644 index f3f0779bc..000000000 --- a/tests/regression_tests/filter_distribcell/case-4/settings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - eigenvalue - 1000 - 1 - 0 - - - -1 -1 -1 1 1 1 - - - diff --git a/tests/regression_tests/filter_distribcell/case-4/tallies.xml b/tests/regression_tests/filter_distribcell/case-4/tallies.xml deleted file mode 100644 index b923c030b..000000000 --- a/tests/regression_tests/filter_distribcell/case-4/tallies.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - distribcell - 101 - - - - 1 - total - - - diff --git a/tests/regression_tests/infinite_cell/geometry.xml b/tests/regression_tests/infinite_cell/geometry.xml deleted file mode 100644 index 90bd2233b..000000000 --- a/tests/regression_tests/infinite_cell/geometry.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - 11 12 - 12 11 - - - - - - - diff --git a/tests/regression_tests/infinite_cell/materials.xml b/tests/regression_tests/infinite_cell/materials.xml deleted file mode 100644 index 6acd8df74..000000000 --- a/tests/regression_tests/infinite_cell/materials.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/tests/regression_tests/infinite_cell/model.xml b/tests/regression_tests/infinite_cell/model.xml new file mode 100644 index 000000000..0f741a86d --- /dev/null +++ b/tests/regression_tests/infinite_cell/model.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + 2.0 2.0 + 12 + 2 2 + -2.0 -2.0 + +11 12 +12 11 + + + + + eigenvalue + 1000 + 10 + 5 + + + -4.0 -4.0 -4.0 4.0 4.0 4.0 + + + + diff --git a/tests/regression_tests/infinite_cell/settings.xml b/tests/regression_tests/infinite_cell/settings.xml deleted file mode 100644 index 70b4e802f..000000000 --- a/tests/regression_tests/infinite_cell/settings.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - eigenvalue - 10 - 5 - 1000 - - - - -4 -4 -4 4 4 4 - - - - diff --git a/tests/regression_tests/mg_temperature/build_2g.py b/tests/regression_tests/mg_temperature/build_2g.py index 1256ca0f7..42f948be1 100644 --- a/tests/regression_tests/mg_temperature/build_2g.py +++ b/tests/regression_tests/mg_temperature/build_2g.py @@ -1,297 +1,296 @@ -import openmc -import numpy as np - -names = ['H', 'O', 'Zr', 'U235', 'U238'] - - -def build_openmc_xs_lib(name, groups, temperatures, xsdict, micro=True): - """Build an Openm XSdata based on dictionary values""" - xsdata = openmc.XSdata(name, groups, temperatures=temperatures) - xsdata.order = 0 - for tt in temperatures: - xsdata.set_absorption(xsdict[tt]['absorption'][name], temperature=tt) - xsdata.set_scatter_matrix(xsdict[tt]['scatter'][name], temperature=tt) - xsdata.set_total(xsdict[tt]['total'][name], temperature=tt) - if (name in xsdict[tt]['nu-fission'].keys()): - xsdata.set_nu_fission(xsdict[tt]['nu-fission'][name], - temperature=tt) - xsdata.set_chi(np.array([1., 0.]), temperature=tt) - return xsdata - - -def create_micro_xs_dict(): - """Returns micro xs library""" - xs_micro = {} - reactions = ['absorption', 'total', 'scatter', 'nu-fission'] - # chi is unnecessary when energy bound is in thermal region - # Temperature 300K - # absorption - xs_micro[300] = {r: {} for r in reactions} - xs_micro[300]['absorption']['H'] = np.array([1.0285E-4, 0.0057]) - xs_micro[300]['absorption']['O'] = np.array([7.1654E-5, 3.0283E-6]) - xs_micro[300]['absorption']['Zr'] = np.array([4.5918E-5, 3.6303E-5]) - xs_micro[300]['absorption']['U235'] = np.array([0.0035, 0.1040]) - xs_micro[300]['absorption']['U238'] = np.array([0.0056, 0.0094]) - # nu-scatter matrix - xs_micro[300]['scatter']['H'] = np.array([[[0.0910, 0.01469], - [0.0, 0.3316]]]) - xs_micro[300]['scatter']['O'] = np.array([[[0.0814, 3.3235E-4], - [0.0, 0.0960]]]) - xs_micro[300]['scatter']['Zr'] = np.array([[[0.0311, 2.6373E-5], - [0.0, 0.0315]]]) - xs_micro[300]['scatter']['U235'] = np.array([[[0.0311, 2.6373E-5], - [0.0, 0.0315]]]) - xs_micro[300]['scatter']['U238'] = np.array([[[0.0551, 2.2341E-5], - [0.0, 0.0526]]]) - # nu-fission - xs_micro[300]['nu-fission']['U235'] = np.array([0.0059, 0.2160]) - xs_micro[300]['nu-fission']['U238'] = np.array([0.0019, 1.4627E-7]) - # total - xs_micro[300]['total']['H'] = xs_micro[300]['absorption']['H'] + \ - np.sum(xs_micro[300]['scatter']['H'][0], 1) - xs_micro[300]['total']['O'] = xs_micro[300]['absorption']['O'] + \ - np.sum(xs_micro[300]['scatter']['O'][0], 1) - - xs_micro[300]['total']['Zr'] = xs_micro[300]['absorption']['Zr'] + \ - np.sum(xs_micro[300]['scatter']['Zr'][0], 1) - - xs_micro[300]['total']['U235'] = xs_micro[300]['absorption']['U235'] + \ - np.sum(xs_micro[300]['scatter']['U235'][0], 1) - - xs_micro[300]['total']['U238'] = xs_micro[300]['absorption']['U238'] + \ - np.sum(xs_micro[300]['scatter']['U238'][0], 1) - - # Temperature 600K - xs_micro[600] = {r: {} for r in reactions} - # absorption - xs_micro[600]['absorption']['H'] = np.array([1.0356E-4, 0.0046]) - xs_micro[600]['absorption']['O'] = np.array([7.2678E-5, 2.4963E-6]) - xs_micro[600]['absorption']['Zr'] = np.array([4.7256E-5, 2.9757E-5]) - xs_micro[600]['absorption']['U235'] = np.array([0.0035, 0.0853]) - xs_micro[600]['absorption']['U238'] = np.array([0.0058, 0.0079]) - # nu-scatter matrix - xs_micro[600]['scatter']['H'] = np.array([[[0.0910, 0.0138], - [0.0, 0.3316]]]) - xs_micro[600]['scatter']['O'] = np.array([[[0.0814, 3.5367E-4], - [0.0, 0.0959]]]) - xs_micro[600]['scatter']['Zr'] = np.array([[[0.0311, 3.2293E-5], - [0.0, 0.0314]]]) - xs_micro[600]['scatter']['U235'] = np.array([[[0.0022, 1.9763E-6], - [9.1634E-8, 0.0039]]]) - xs_micro[600]['scatter']['U238'] = np.array([[[0.0556, 2.8803E-5], - [0.0, 0.0536]]]) - # nu-fission - xs_micro[600]['nu-fission']['U235'] = np.array([0.0059, 0.1767]) - xs_micro[600]['nu-fission']['U238'] = np.array([0.0019, 1.2405E-7]) - # total - xs_micro[600]['total']['H'] = xs_micro[600]['absorption']['H'] + \ - np.sum(xs_micro[600]['scatter']['H'][0], 1) - xs_micro[600]['total']['O'] = xs_micro[600]['absorption']['O'] + \ - np.sum(xs_micro[600]['scatter']['O'][0], 1) - - xs_micro[600]['total']['Zr'] = xs_micro[600]['absorption']['Zr'] + \ - np.sum(xs_micro[600]['scatter']['Zr'][0], 1) - - xs_micro[600]['total']['U235'] = xs_micro[600]['absorption']['U235'] + \ - np.sum(xs_micro[600]['scatter']['U235'][0], 1) - - xs_micro[600]['total']['U238'] = xs_micro[600]['absorption']['U238'] + \ - np.sum(xs_micro[600]['scatter']['U238'][0], 1) - - # Temperature 900K - xs_micro[900] = {r: {} for r in reactions} - # absorption - xs_micro[900]['absorption']['H'] = np.array([1.0529E-4, 0.0040]) - xs_micro[900]['absorption']['O'] = np.array([7.3055E-5, 2.1850E-6]) - xs_micro[900]['absorption']['Zr'] = np.array([4.7141E-5, 2.5941E-5]) - xs_micro[900]['absorption']['U235'] = np.array([0.0035, 0.0749]) - xs_micro[900]['absorption']['U238'] = np.array([0.0060, 0.0071]) - # total - xs_micro[900]['total']['H'] = np.array([0.2982, 0.7332]) - xs_micro[900]['total']['O'] = np.array([0.0885, 0.1004]) - xs_micro[900]['total']['Zr'] = np.array([0.0370, 0.0317]) - xs_micro[900]['total']['U235'] = np.array([0.0061, 0.0789]) - xs_micro[900]['total']['U238'] = np.array([0.0707, 0.0613]) - # nu-scatter matrix - xs_micro[900]['scatter']['H'] = np.array([[[0.0913, 0.0147], - [0.0, 0.4020]]]) - xs_micro[900]['scatter']['O'] = np.array([[[0.0812, 4.0413E-4], - [0.0, 0.0965]]]) - xs_micro[900]['scatter']['Zr'] = np.array([[[0.0311, 3.6735E-5], - [0.0, 0.0314]]]) - xs_micro[900]['scatter']['U235'] = np.array([[[0.0022, 2.9034E-6], - [1.3117E-8, 0.0039]]]) - xs_micro[900]['scatter']['U238'] = np.array([[[0.0560, 3.7619E-5], - [0.0, 0.0538]]]) - # nu-fission - xs_micro[900]['nu-fission']['U235'] = np.array([0.0059, 0.1545]) - xs_micro[900]['nu-fission']['U238'] = np.array([0.0019, 1.1017E-7]) - # total - xs_micro[900]['total']['H'] = xs_micro[900]['absorption']['H'] + \ - np.sum(xs_micro[900]['scatter']['H'][0], 1) - xs_micro[900]['total']['O'] = xs_micro[900]['absorption']['O'] + \ - np.sum(xs_micro[900]['scatter']['O'][0], 1) - - xs_micro[900]['total']['Zr'] = xs_micro[900]['absorption']['Zr'] + \ - np.sum(xs_micro[900]['scatter']['Zr'][0], 1) - - xs_micro[900]['total']['U235'] = xs_micro[900]['absorption']['U235'] + \ - np.sum(xs_micro[900]['scatter']['U235'][0], 1) - - xs_micro[900]['total']['U238'] = xs_micro[900]['absorption']['U238'] + \ - np.sum(xs_micro[900]['scatter']['U238'][0], 1) - - # roll axis for scatter matrix - for t in xs_micro: - for n in xs_micro[t]['scatter']: - xs_micro[t]['scatter'][n] = np.rollaxis(xs_micro[t]['scatter'][n], - 0, 3) - return xs_micro - - -def create_macro_dict(xs_micro): - """Create a dictionary with two group cross-section""" - xs_macro = {} - for t, d1 in xs_micro.items(): - xs_macro[t] = {} - for r, d2 in d1.items(): - temp = [] - xs_macro[t][r] = {} - for n, v in d2.items(): - temp.append(d2[n]) - # The name 'macro' is needed to store data at the same level - # of a xs_macro dictionary as for xs_micro and use it in - # function build_openmc_xs_lib - xs_macro[t][r]['macro'] = sum(temp) - return xs_macro - - -def create_openmc_2mg_libs(names): - """Built a micro/macro two group openmc MGXS libraries""" - # Initialized library params - group_edges = [0.0, 0.625, 20.0e6] - groups = openmc.mgxs.EnergyGroups(group_edges=group_edges) - mg_cross_sections_file_micro = openmc.MGXSLibrary(groups) - mg_cross_sections_file_macro = openmc.MGXSLibrary(groups) - # Building a micro mg library - micro_cs = create_micro_xs_dict() - for name in names: - mg_cross_sections_file_micro.add_xsdata(build_openmc_xs_lib(name, - groups, - [t for t in - micro_cs], - micro_cs)) - # Building a macro mg library - macro_xs = create_macro_dict(micro_cs) - mg_cross_sections_file_macro.add_xsdata(build_openmc_xs_lib('macro', - groups, - [t for t in - macro_xs], - macro_xs)) - # Exporting library to hdf5 files - mg_cross_sections_file_micro.export_to_hdf5('micro_2g.h5') - mg_cross_sections_file_macro.export_to_hdf5('macro_2g.h5') - # Returning the macro_xs dict is needed for analytical solution - return macro_xs - - -def analytical_solution_2g_therm(xsmin, xsmax=None, wgt=1.0): - """ Calculate eigenvalue based on analytical solution for eq Lf = (1/k)Qf - in two group for infinity dilution media in assumption of group - boundary in thermal spectra < 1.e+3 Ev - Parameters: - ---------- - xsmin : dict - macro cross-sections dictionary with minimum range temperature - xsmax : dict - macro cross-sections dictionary with maximum range temperature - by default: None not used for standalone temperature - wgt : float - weight for interpolation by default 1.0 - Returns: - ------- - keff : np.float64 - analytical eigenvalue of critical eq matrix - """ - if xsmax is None: - sa = xsmin['absorption']['macro'] - ss12 = xsmin['scatter']['macro'][0][1][0] - nsf = xsmin['nu-fission']['macro'] - else: - sa = xsmin['absorption']['macro'] * wgt + \ - xsmax['absorption']['macro'] * (1 - wgt) - ss12 = xsmin['scatter']['macro'][0][1][0] * wgt + \ - xsmax['scatter']['macro'][0][1][0] * (1 - wgt) - nsf = xsmin['nu-fission']['macro'] * wgt + \ - xsmax['nu-fission']['macro'] * (1 - wgt) - L = np.array([sa[0] + ss12, 0.0, -ss12, sa[1]]).reshape(2, 2) - Q = np.array([nsf[0], nsf[1], 0.0, 0.0]).reshape(2, 2) - arr = np.linalg.inv(L).dot(Q) - return np.amax(np.linalg.eigvals(arr)) - - -def build_inf_model(xsnames, xslibname, temperature, tempmethod='nearest'): - """ Building an infinite medium for openmc multi-group testing - Parameters: - ---------- - xsnames : list of str() - list with xs names - xslibname: - name of hdf5 file with cross-section library - temperature : float - value of a current temperature in K - tempmethod : {'nearest', 'interpolation'} - by default 'nearest' - """ - inf_medium = openmc.Material(name='test material', material_id=1) - inf_medium.set_density("sum") - for xs in xsnames: - inf_medium.add_nuclide(xs, 1) - INF = 11.1 - # Instantiate a Materials collection and export to XML - materials_file = openmc.Materials([inf_medium]) - materials_file.cross_sections = xslibname - materials_file.export_to_xml() - - # Instantiate boundary Planes - min_x = openmc.XPlane(boundary_type='reflective', x0=-INF) - max_x = openmc.XPlane(boundary_type='reflective', x0=INF) - min_y = openmc.YPlane(boundary_type='reflective', y0=-INF) - max_y = openmc.YPlane(boundary_type='reflective', y0=INF) - - # Instantiate a Cell - cell = openmc.Cell(cell_id=1, name='cell') - cell.temperature = temperature - # Register bounding Surfaces with the Cell - cell.region = +min_x & -max_x & +min_y & -max_y - - # Fill the Cell with the Material - cell.fill = inf_medium - - # Create root universe - root_universe = openmc.Universe(name='root universe', cells=[cell]) - - # Create Geometry and set root Universe - openmc_geometry = openmc.Geometry(root_universe) - - # Export to "geometry.xml" - openmc_geometry.export_to_xml() - - # OpenMC simulation parameters - batches = 200 - inactive = 5 - particles = 5000 - - # Instantiate a Settings object - settings_file = openmc.Settings() - settings_file.batches = batches - settings_file.inactive = inactive - settings_file.particles = particles - settings_file.energy_mode = 'multi-group' - settings_file.output = {'summary': False} - # Create an initial uniform spatial source distribution over fissionable zones - bounds = [-INF, -INF, -INF, INF, INF, INF] - uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True) - settings_file.temperature = {'method': tempmethod} - settings_file.source = openmc.Source(space=uniform_dist) - settings_file.export_to_xml() +import openmc +import numpy as np + +names = ['H', 'O', 'Zr', 'U235', 'U238'] + + +def build_openmc_xs_lib(name, groups, temperatures, xsdict, micro=True): + """Build an Openm XSdata based on dictionary values""" + xsdata = openmc.XSdata(name, groups, temperatures=temperatures) + xsdata.order = 0 + for tt in temperatures: + xsdata.set_absorption(xsdict[tt]['absorption'][name], temperature=tt) + xsdata.set_scatter_matrix(xsdict[tt]['scatter'][name], temperature=tt) + xsdata.set_total(xsdict[tt]['total'][name], temperature=tt) + if (name in xsdict[tt]['nu-fission'].keys()): + xsdata.set_nu_fission(xsdict[tt]['nu-fission'][name], + temperature=tt) + xsdata.set_chi(np.array([1., 0.]), temperature=tt) + return xsdata + + +def create_micro_xs_dict(): + """Returns micro xs library""" + xs_micro = {} + reactions = ['absorption', 'total', 'scatter', 'nu-fission'] + # chi is unnecessary when energy bound is in thermal region + # Temperature 300K + # absorption + xs_micro[300] = {r: {} for r in reactions} + xs_micro[300]['absorption']['H'] = np.array([1.0285E-4, 0.0057]) + xs_micro[300]['absorption']['O'] = np.array([7.1654E-5, 3.0283E-6]) + xs_micro[300]['absorption']['Zr'] = np.array([4.5918E-5, 3.6303E-5]) + xs_micro[300]['absorption']['U235'] = np.array([0.0035, 0.1040]) + xs_micro[300]['absorption']['U238'] = np.array([0.0056, 0.0094]) + # nu-scatter matrix + xs_micro[300]['scatter']['H'] = np.array([[[0.0910, 0.01469], + [0.0, 0.3316]]]) + xs_micro[300]['scatter']['O'] = np.array([[[0.0814, 3.3235E-4], + [0.0, 0.0960]]]) + xs_micro[300]['scatter']['Zr'] = np.array([[[0.0311, 2.6373E-5], + [0.0, 0.0315]]]) + xs_micro[300]['scatter']['U235'] = np.array([[[0.0311, 2.6373E-5], + [0.0, 0.0315]]]) + xs_micro[300]['scatter']['U238'] = np.array([[[0.0551, 2.2341E-5], + [0.0, 0.0526]]]) + # nu-fission + xs_micro[300]['nu-fission']['U235'] = np.array([0.0059, 0.2160]) + xs_micro[300]['nu-fission']['U238'] = np.array([0.0019, 1.4627E-7]) + # total + xs_micro[300]['total']['H'] = xs_micro[300]['absorption']['H'] + \ + np.sum(xs_micro[300]['scatter']['H'][0], 1) + xs_micro[300]['total']['O'] = xs_micro[300]['absorption']['O'] + \ + np.sum(xs_micro[300]['scatter']['O'][0], 1) + + xs_micro[300]['total']['Zr'] = xs_micro[300]['absorption']['Zr'] + \ + np.sum(xs_micro[300]['scatter']['Zr'][0], 1) + + xs_micro[300]['total']['U235'] = xs_micro[300]['absorption']['U235'] + \ + np.sum(xs_micro[300]['scatter']['U235'][0], 1) + + xs_micro[300]['total']['U238'] = xs_micro[300]['absorption']['U238'] + \ + np.sum(xs_micro[300]['scatter']['U238'][0], 1) + + # Temperature 600K + xs_micro[600] = {r: {} for r in reactions} + # absorption + xs_micro[600]['absorption']['H'] = np.array([1.0356E-4, 0.0046]) + xs_micro[600]['absorption']['O'] = np.array([7.2678E-5, 2.4963E-6]) + xs_micro[600]['absorption']['Zr'] = np.array([4.7256E-5, 2.9757E-5]) + xs_micro[600]['absorption']['U235'] = np.array([0.0035, 0.0853]) + xs_micro[600]['absorption']['U238'] = np.array([0.0058, 0.0079]) + # nu-scatter matrix + xs_micro[600]['scatter']['H'] = np.array([[[0.0910, 0.0138], + [0.0, 0.3316]]]) + xs_micro[600]['scatter']['O'] = np.array([[[0.0814, 3.5367E-4], + [0.0, 0.0959]]]) + xs_micro[600]['scatter']['Zr'] = np.array([[[0.0311, 3.2293E-5], + [0.0, 0.0314]]]) + xs_micro[600]['scatter']['U235'] = np.array([[[0.0022, 1.9763E-6], + [9.1634E-8, 0.0039]]]) + xs_micro[600]['scatter']['U238'] = np.array([[[0.0556, 2.8803E-5], + [0.0, 0.0536]]]) + # nu-fission + xs_micro[600]['nu-fission']['U235'] = np.array([0.0059, 0.1767]) + xs_micro[600]['nu-fission']['U238'] = np.array([0.0019, 1.2405E-7]) + # total + xs_micro[600]['total']['H'] = xs_micro[600]['absorption']['H'] + \ + np.sum(xs_micro[600]['scatter']['H'][0], 1) + xs_micro[600]['total']['O'] = xs_micro[600]['absorption']['O'] + \ + np.sum(xs_micro[600]['scatter']['O'][0], 1) + + xs_micro[600]['total']['Zr'] = xs_micro[600]['absorption']['Zr'] + \ + np.sum(xs_micro[600]['scatter']['Zr'][0], 1) + + xs_micro[600]['total']['U235'] = xs_micro[600]['absorption']['U235'] + \ + np.sum(xs_micro[600]['scatter']['U235'][0], 1) + + xs_micro[600]['total']['U238'] = xs_micro[600]['absorption']['U238'] + \ + np.sum(xs_micro[600]['scatter']['U238'][0], 1) + + # Temperature 900K + xs_micro[900] = {r: {} for r in reactions} + # absorption + xs_micro[900]['absorption']['H'] = np.array([1.0529E-4, 0.0040]) + xs_micro[900]['absorption']['O'] = np.array([7.3055E-5, 2.1850E-6]) + xs_micro[900]['absorption']['Zr'] = np.array([4.7141E-5, 2.5941E-5]) + xs_micro[900]['absorption']['U235'] = np.array([0.0035, 0.0749]) + xs_micro[900]['absorption']['U238'] = np.array([0.0060, 0.0071]) + # total + xs_micro[900]['total']['H'] = np.array([0.2982, 0.7332]) + xs_micro[900]['total']['O'] = np.array([0.0885, 0.1004]) + xs_micro[900]['total']['Zr'] = np.array([0.0370, 0.0317]) + xs_micro[900]['total']['U235'] = np.array([0.0061, 0.0789]) + xs_micro[900]['total']['U238'] = np.array([0.0707, 0.0613]) + # nu-scatter matrix + xs_micro[900]['scatter']['H'] = np.array([[[0.0913, 0.0147], + [0.0, 0.4020]]]) + xs_micro[900]['scatter']['O'] = np.array([[[0.0812, 4.0413E-4], + [0.0, 0.0965]]]) + xs_micro[900]['scatter']['Zr'] = np.array([[[0.0311, 3.6735E-5], + [0.0, 0.0314]]]) + xs_micro[900]['scatter']['U235'] = np.array([[[0.0022, 2.9034E-6], + [1.3117E-8, 0.0039]]]) + xs_micro[900]['scatter']['U238'] = np.array([[[0.0560, 3.7619E-5], + [0.0, 0.0538]]]) + # nu-fission + xs_micro[900]['nu-fission']['U235'] = np.array([0.0059, 0.1545]) + xs_micro[900]['nu-fission']['U238'] = np.array([0.0019, 1.1017E-7]) + # total + xs_micro[900]['total']['H'] = xs_micro[900]['absorption']['H'] + \ + np.sum(xs_micro[900]['scatter']['H'][0], 1) + xs_micro[900]['total']['O'] = xs_micro[900]['absorption']['O'] + \ + np.sum(xs_micro[900]['scatter']['O'][0], 1) + + xs_micro[900]['total']['Zr'] = xs_micro[900]['absorption']['Zr'] + \ + np.sum(xs_micro[900]['scatter']['Zr'][0], 1) + + xs_micro[900]['total']['U235'] = xs_micro[900]['absorption']['U235'] + \ + np.sum(xs_micro[900]['scatter']['U235'][0], 1) + + xs_micro[900]['total']['U238'] = xs_micro[900]['absorption']['U238'] + \ + np.sum(xs_micro[900]['scatter']['U238'][0], 1) + + # roll axis for scatter matrix + for t in xs_micro: + for n in xs_micro[t]['scatter']: + xs_micro[t]['scatter'][n] = np.rollaxis(xs_micro[t]['scatter'][n], + 0, 3) + return xs_micro + + +def create_macro_dict(xs_micro): + """Create a dictionary with two group cross-section""" + xs_macro = {} + for t, d1 in xs_micro.items(): + xs_macro[t] = {} + for r, d2 in d1.items(): + temp = [] + xs_macro[t][r] = {} + for n, v in d2.items(): + temp.append(d2[n]) + # The name 'macro' is needed to store data at the same level + # of a xs_macro dictionary as for xs_micro and use it in + # function build_openmc_xs_lib + xs_macro[t][r]['macro'] = sum(temp) + return xs_macro + + +def create_openmc_2mg_libs(names): + """Built a micro/macro two group openmc MGXS libraries""" + # Initialized library params + group_edges = [0.0, 0.625, 20.0e6] + groups = openmc.mgxs.EnergyGroups(group_edges=group_edges) + mg_cross_sections_file_micro = openmc.MGXSLibrary(groups) + mg_cross_sections_file_macro = openmc.MGXSLibrary(groups) + # Building a micro mg library + micro_cs = create_micro_xs_dict() + for name in names: + mg_cross_sections_file_micro.add_xsdata(build_openmc_xs_lib(name, + groups, + [t for t in + micro_cs], + micro_cs)) + # Building a macro mg library + macro_xs = create_macro_dict(micro_cs) + mg_cross_sections_file_macro.add_xsdata(build_openmc_xs_lib('macro', + groups, + [t for t in + macro_xs], + macro_xs)) + # Exporting library to hdf5 files + mg_cross_sections_file_micro.export_to_hdf5('micro_2g.h5') + mg_cross_sections_file_macro.export_to_hdf5('macro_2g.h5') + # Returning the macro_xs dict is needed for analytical solution + return macro_xs + + +def analytical_solution_2g_therm(xsmin, xsmax=None, wgt=1.0): + """ Calculate eigenvalue based on analytical solution for eq Lf = (1/k)Qf + in two group for infinity dilution media in assumption of group + boundary in thermal spectra < 1.e+3 Ev + Parameters: + ---------- + xsmin : dict + macro cross-sections dictionary with minimum range temperature + xsmax : dict + macro cross-sections dictionary with maximum range temperature + by default: None not used for standalone temperature + wgt : float + weight for interpolation by default 1.0 + Returns: + ------- + keff : np.float64 + analytical eigenvalue of critical eq matrix + """ + if xsmax is None: + sa = xsmin['absorption']['macro'] + ss12 = xsmin['scatter']['macro'][0][1][0] + nsf = xsmin['nu-fission']['macro'] + else: + sa = xsmin['absorption']['macro'] * wgt + \ + xsmax['absorption']['macro'] * (1 - wgt) + ss12 = xsmin['scatter']['macro'][0][1][0] * wgt + \ + xsmax['scatter']['macro'][0][1][0] * (1 - wgt) + nsf = xsmin['nu-fission']['macro'] * wgt + \ + xsmax['nu-fission']['macro'] * (1 - wgt) + L = np.array([sa[0] + ss12, 0.0, -ss12, sa[1]]).reshape(2, 2) + Q = np.array([nsf[0], nsf[1], 0.0, 0.0]).reshape(2, 2) + arr = np.linalg.inv(L).dot(Q) + return np.amax(np.linalg.eigvals(arr)) + + +def build_inf_model(xsnames, xslibname, temperature, tempmethod='nearest'): + """ Building an infinite medium for openmc multi-group testing + Parameters: + ---------- + xsnames : list of str() + list with xs names + xslibname: + name of hdf5 file with cross-section library + temperature : float + value of a current temperature in K + tempmethod : {'nearest', 'interpolation'} + by default 'nearest' + """ + model = openmc.Model() + inf_medium = openmc.Material(name='test material', material_id=1) + inf_medium.set_density("sum") + for xs in xsnames: + inf_medium.add_nuclide(xs, 1) + INF = 11.1 + # Instantiate a Materials collection and export to XML + materials_file = openmc.Materials([inf_medium]) + materials_file.cross_sections = xslibname + model.materials = materials_file + + # Instantiate boundary Planes + min_x = openmc.XPlane(boundary_type='reflective', x0=-INF) + max_x = openmc.XPlane(boundary_type='reflective', x0=INF) + min_y = openmc.YPlane(boundary_type='reflective', y0=-INF) + max_y = openmc.YPlane(boundary_type='reflective', y0=INF) + + # Instantiate a Cell + cell = openmc.Cell(cell_id=1, name='cell') + cell.temperature = temperature + # Register bounding Surfaces with the Cell + cell.region = +min_x & -max_x & +min_y & -max_y + + # Fill the Cell with the Material + cell.fill = inf_medium + + # Create root universe + root_universe = openmc.Universe(name='root universe', cells=[cell]) + + # Create Geometry and set root Universe + model.geometry = openmc.Geometry(root_universe) + + # OpenMC simulation parameters + batches = 200 + inactive = 5 + particles = 5000 + + # Instantiate a Settings object + settings_file = openmc.Settings() + settings_file.batches = batches + settings_file.inactive = inactive + settings_file.particles = particles + settings_file.energy_mode = 'multi-group' + settings_file.output = {'summary': False} + # Create an initial uniform spatial source distribution over fissionable zones + bounds = [-INF, -INF, -INF, INF, INF, INF] + uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True) + settings_file.temperature = {'method': tempmethod} + settings_file.source = openmc.Source(space=uniform_dist) + model.settings = settings_file + model.export_to_model_xml() diff --git a/tests/regression_tests/plot/geometry.xml b/tests/regression_tests/plot/geometry.xml deleted file mode 100644 index 83619d9f7..000000000 --- a/tests/regression_tests/plot/geometry.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/tests/regression_tests/plot/materials.xml b/tests/regression_tests/plot/materials.xml deleted file mode 100644 index 90b354267..000000000 --- a/tests/regression_tests/plot/materials.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tests/regression_tests/plot/model.xml b/tests/regression_tests/plot/model.xml new file mode 100644 index 000000000..a63ff95da --- /dev/null +++ b/tests/regression_tests/plot/model.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + plot + 1 + + 5 4 3 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + + + -10.0 10.0 + -10.0 10.0 + -10.0 0.0 5.0 7.5 8.75 10.0 + + + 2 + + + 1 + total + + + + + 0.0 0.0 0.0 + 25.0 25.0 + 200 200 + + + + + 0.0 0.0 0.0 + 25.0 25.0 + 200 200 + + + + + 0.0 0.0 0.0 + 25.0 25.0 + 200 200 + 0 0 0 + + + 0.0 0.0 0.0 + 20.0 20.0 10.0 + 100 100 10 + + + diff --git a/tests/regression_tests/plot/plots.xml b/tests/regression_tests/plot/plots.xml deleted file mode 100644 index ce63da144..000000000 --- a/tests/regression_tests/plot/plots.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - 0. 0. 0. - 25 25 - 200 200 - - - - - - 0. 0. 0. - 25 25 - 200 200 - - - - - - 0. 0. 0. - 25 25 - 200 200 - 0 0 0 - - - - 100 100 10 - 0. 0. 0. - 20 20 10 - - - diff --git a/tests/regression_tests/plot/settings.xml b/tests/regression_tests/plot/settings.xml deleted file mode 100644 index adf256d2d..000000000 --- a/tests/regression_tests/plot/settings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - plot - - - 5 4 3 - -10 -10 -10 - 10 10 10 - - 1 - - diff --git a/tests/regression_tests/plot/tallies.xml b/tests/regression_tests/plot/tallies.xml deleted file mode 100644 index b7e678ca0..000000000 --- a/tests/regression_tests/plot/tallies.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -10 10 - -10 10 - -10 0 5 7.5 8.75 10 - - - - mesh - 2 - - - - 1 - total - - - diff --git a/tests/regression_tests/plot_overlaps/geometry.xml b/tests/regression_tests/plot_overlaps/geometry.xml deleted file mode 100644 index 7a9f1fb41..000000000 --- a/tests/regression_tests/plot_overlaps/geometry.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/tests/regression_tests/plot_overlaps/materials.xml b/tests/regression_tests/plot_overlaps/materials.xml deleted file mode 100644 index 90b354267..000000000 --- a/tests/regression_tests/plot_overlaps/materials.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tests/regression_tests/plot_overlaps/model.xml b/tests/regression_tests/plot_overlaps/model.xml new file mode 100644 index 000000000..e3b65d45d --- /dev/null +++ b/tests/regression_tests/plot_overlaps/model.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + plot + 1 + + 5 4 3 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + + + 0.0 0.0 0.0 + 25.0 25.0 + 200 200 + + true + + + + 0.0 0.0 0.0 + 25.0 25.0 + 200 200 + + true + 255 211 0 + + + 0.0 0.0 0.0 + 25.0 25.0 + 200 200 + 0 0 0 + + + 0.0 0.0 0.0 + 20.0 20.0 10.0 + 100 100 10 + + + diff --git a/tests/regression_tests/plot_overlaps/plots.xml b/tests/regression_tests/plot_overlaps/plots.xml deleted file mode 100644 index 28064f58f..000000000 --- a/tests/regression_tests/plot_overlaps/plots.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - 0. 0. 0. - 25 25 - 200 200 - - - true - - - - 0. 0. 0. - 25 25 - 200 200 - - true - 255 211 0 - - - - 0. 0. 0. - 25 25 - 200 200 - 0 0 0 - - - - 100 100 10 - 0. 0. 0. - 20 20 10 - - - diff --git a/tests/regression_tests/plot_overlaps/settings.xml b/tests/regression_tests/plot_overlaps/settings.xml deleted file mode 100644 index adf256d2d..000000000 --- a/tests/regression_tests/plot_overlaps/settings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - plot - - - 5 4 3 - -10 -10 -10 - 10 10 10 - - 1 - - diff --git a/tests/regression_tests/plot_voxel/geometry.xml b/tests/regression_tests/plot_voxel/geometry.xml deleted file mode 100644 index 83619d9f7..000000000 --- a/tests/regression_tests/plot_voxel/geometry.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/tests/regression_tests/plot_voxel/materials.xml b/tests/regression_tests/plot_voxel/materials.xml deleted file mode 100644 index 90b354267..000000000 --- a/tests/regression_tests/plot_voxel/materials.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tests/regression_tests/plot_voxel/model.xml b/tests/regression_tests/plot_voxel/model.xml new file mode 100644 index 000000000..7b0e854c5 --- /dev/null +++ b/tests/regression_tests/plot_voxel/model.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + plot + 1 + + 5 4 3 + -10.0 -10.0 -10.0 + 10.0 10.0 10.0 + + + + + 0.0 0.0 0.0 + 20.0 20.0 10.0 + 50 50 10 + + + diff --git a/tests/regression_tests/plot_voxel/plots.xml b/tests/regression_tests/plot_voxel/plots.xml deleted file mode 100644 index 833329b42..000000000 --- a/tests/regression_tests/plot_voxel/plots.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - 50 50 10 - 0. 0. 0. - 20 20 10 - - - diff --git a/tests/regression_tests/plot_voxel/settings.xml b/tests/regression_tests/plot_voxel/settings.xml deleted file mode 100644 index adf256d2d..000000000 --- a/tests/regression_tests/plot_voxel/settings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - plot - - - 5 4 3 - -10 -10 -10 - 10 10 10 - - 1 - - diff --git a/tests/regression_tests/track_output/geometry.xml b/tests/regression_tests/track_output/geometry.xml deleted file mode 100644 index 5b16fe26c..000000000 --- a/tests/regression_tests/track_output/geometry.xml +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 - 2 2 2 3 2 2 2 2 2 2 2 3 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 3 2 2 2 2 2 2 2 3 2 2 2 - 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 - 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 3 2 2 2 2 2 2 2 3 2 2 2 - 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - - - - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 - 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 3 2 2 2 2 2 2 2 1 2 2 2 - 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - - - - - - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - - - - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 - 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 - 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 - - - - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 - 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - - - - - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - - - - - - - - - - -12.2682 -12.2682 - 1.63576 1.63576 - - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - - - - - - - - - - - - - - - - - - - -85.8774 -85.8774 - 24.5364 24.5364 - - 999 999 130 140 150 999 999 - 999 220 230 240 250 260 999 - 130 320 777 222 333 360 150 - 410 240 444 111 666 240 470 - 510 520 888 555 998 560 570 - 999 620 630 240 650 660 999 - 999 999 510 740 570 999 999 - - - - - - - - diff --git a/tests/regression_tests/track_output/materials.xml b/tests/regression_tests/track_output/materials.xml deleted file mode 100644 index 5dc9a6475..000000000 --- a/tests/regression_tests/track_output/materials.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/regression_tests/track_output/model.xml b/tests/regression_tests/track_output/model.xml new file mode 100644 index 000000000..36ccb2b46 --- /dev/null +++ b/tests/regression_tests/track_output/model.xml @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 +2 2 2 3 2 2 2 2 2 2 2 3 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 3 2 2 2 2 2 2 2 3 2 2 2 +2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 +2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 +2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 +2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 3 2 2 2 2 2 2 2 3 2 2 2 +2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 +2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 +2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 1 2 2 1 2 2 2 1 2 2 1 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 3 2 2 2 2 2 2 2 1 2 2 2 +2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + + + 1.63576 1.63576 + 15 15 + -12.2682 -12.2682 + +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 + + + 24.5364 24.5364 + 7 7 + -85.8774 -85.8774 + +999 999 130 140 150 999 999 +999 220 230 240 250 260 999 +130 320 777 222 333 360 150 +410 240 444 111 666 240 470 +510 520 888 555 998 560 570 +999 620 630 240 650 660 999 +999 999 510 740 570 999 999 + + + + + + + + + + + + eigenvalue + 100 + 2 + 0 + + + -1.0 -1.0 -1.0 1.0 1.0 1.0 + + + 1 1 1 1 1 30 2 1 60 + + diff --git a/tests/regression_tests/track_output/settings.xml b/tests/regression_tests/track_output/settings.xml deleted file mode 100644 index dcfa118c8..000000000 --- a/tests/regression_tests/track_output/settings.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - eigenvalue - 2 - 0 - 100 - - - - - -1 -1 -1 1 1 1 - - - - - 1 1 1 - 1 1 30 - 2 1 60 - - - From 2d6938553a6a987d0b766ed5f42e4fe16669480e Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Sat, 25 Mar 2023 09:13:58 -0500 Subject: [PATCH 111/136] Update tests/unit_tests/test_deplete_activation.py Co-authored-by: Paul Romano --- tests/unit_tests/test_deplete_activation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_deplete_activation.py b/tests/unit_tests/test_deplete_activation.py index cef614f82..4c3d1de09 100644 --- a/tests/unit_tests/test_deplete_activation.py +++ b/tests/unit_tests/test_deplete_activation.py @@ -47,7 +47,7 @@ ENERGIES = np.logspace(log10(1e-5), log10(2e7), 100) ("direct", {}, 1e-5), ("flux", {'energies': ENERGIES}, 0.01), ("flux", {'energies': ENERGIES, 'reactions': ['(n,gamma)']}, 1e-5), - ("flux", {'energies': ENERGIES, 'reactions': ['(n,gamma)'], 'nuclides': ['W186', 'H3']}, 1e-5), + ("flux", {'energies': ENERGIES, 'reactions': ['(n,gamma)'], 'nuclides': ['W186', 'H3']}, 1e-2), ]) def test_activation(run_in_tmpdir, model, reaction_rate_mode, reaction_rate_opts, tolerance): # Determine (n.gamma) reaction rate using initial run From 2aef18c02ac82c7c90d59466b199a58883018bd1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 25 Mar 2023 11:55:53 -0500 Subject: [PATCH 112/136] Loosen tolerance on coincidence check for cyl/sph meshes and parametrize tests --- src/mesh.cpp | 7 ++++--- tests/unit_tests/test_filter_mesh.py | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 306e56070..3ee489a68 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -500,7 +500,8 @@ void StructuredMesh::raytrace_mesh( } // translate start and end positions, - // this needs to come after the get_indices call because it does its own translation + // this needs to come after the get_indices call because it does its own + // translation local_coords(r0); local_coords(r1); @@ -1084,7 +1085,7 @@ double CylindricalMesh::find_r_crossing( D = std::sqrt(D); // the solution -p - D is always smaller as -p + D : Check this one first - if (-p - D > l && std::abs(c) > FP_COINCIDENT) + if (-p - D > l && std::abs(c) > 1e-10) return -p - D; if (-p + D > l) return -p + D; @@ -1310,7 +1311,7 @@ double SphericalMesh::find_r_crossing( if (D >= 0.0) { D = std::sqrt(D); // the solution -p - D is always smaller as -p + D : Check this one first - if (-p - D > l && std::abs(c) > FP_COINCIDENT) + if (-p - D > l && std::abs(c) > 1e-10) return -p - D; if (-p + D > l) return -p + D; diff --git a/tests/unit_tests/test_filter_mesh.py b/tests/unit_tests/test_filter_mesh.py index 5e5a84f7b..e3fae15be 100644 --- a/tests/unit_tests/test_filter_mesh.py +++ b/tests/unit_tests/test_filter_mesh.py @@ -114,15 +114,16 @@ def test_cylindrical_mesh_estimators(run_in_tmpdir): assert np.all(diff < 3*std_dev) -def test_cylindrical_mesh_coincident(run_in_tmpdir): +@pytest.mark.parametrize("scale", [1.0, 1e2, 1e4, 1e5]) +def test_cylindrical_mesh_coincident(scale, run_in_tmpdir): """Test for cylindrical mesh boundary being coincident with a cell boundary""" fuel = openmc.Material() fuel.add_nuclide('U235', 1.) fuel.set_density('g/cm3', 4.5) - zcyl = openmc.ZCylinder(r=1.25) - box = openmc.rectangular_prism(4.0, 4.0, boundary_type='reflective') + zcyl = openmc.ZCylinder(r=1.25*scale) + box = openmc.rectangular_prism(4*scale, 4*scale, boundary_type='reflective') cell1 = openmc.Cell(fill=fuel, region=-zcyl) cell2 = openmc.Cell(fill=None, region=+zcyl & box) model = openmc.Model() @@ -133,7 +134,7 @@ def test_cylindrical_mesh_coincident(run_in_tmpdir): model.settings.inactive = 0 cyl_mesh = openmc.CylindricalMesh() - cyl_mesh.r_grid = [0., 1.25] + cyl_mesh.r_grid = [0., 1.25*scale] cyl_mesh.phi_grid = [0., 2*math.pi] cyl_mesh.z_grid = [-1e10, 1e10] cyl_mesh_filter = openmc.MeshFilter(cyl_mesh) @@ -161,16 +162,18 @@ def test_cylindrical_mesh_coincident(run_in_tmpdir): assert mean1 == pytest.approx(mean2) -def test_spherical_mesh_coincident(run_in_tmpdir): +@pytest.mark.parametrize("scale", [1.0, 1e2, 1e4, 1e5]) +def test_spherical_mesh_coincident(scale, run_in_tmpdir): """Test for spherical mesh boundary being coincident with a cell boundary""" fuel = openmc.Material() fuel.add_nuclide('U235', 1.) fuel.set_density('g/cm3', 4.5) - sph = openmc.Sphere(r=1.25) + sph = openmc.Sphere(r=1.25*scale) rcc = openmc.model.RectangularParallelepiped( - -2.0, 2.0, -2.0, 2.0, -2.0, 2.0, boundary_type='reflective') + -2*scale, 2*scale, -2*scale, 2*scale, -2*scale, 2*scale, + boundary_type='reflective') cell1 = openmc.Cell(fill=fuel, region=-sph) cell2 = openmc.Cell(fill=None, region=+sph & -rcc) model = openmc.Model() @@ -181,7 +184,7 @@ def test_spherical_mesh_coincident(run_in_tmpdir): model.settings.inactive = 0 sph_mesh = openmc.SphericalMesh() - sph_mesh.r_grid = [0., 1.25] + sph_mesh.r_grid = [0., 1.25*scale] sph_mesh.phi_grid = [0., 2*math.pi] sph_mesh.theta_grid = [0., math.pi] sph_mesh_filter = openmc.MeshFilter(sph_mesh) From 5b7fb427d3cb4c5ba9fa2a5555004c10e2e53db1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 25 Mar 2023 15:36:11 -0500 Subject: [PATCH 113/136] Apply @pshriwise suggestion adding 0.1 to scale Co-authored-by: Patrick Shriwise --- tests/unit_tests/test_filter_mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_filter_mesh.py b/tests/unit_tests/test_filter_mesh.py index e3fae15be..c93bfa037 100644 --- a/tests/unit_tests/test_filter_mesh.py +++ b/tests/unit_tests/test_filter_mesh.py @@ -114,7 +114,7 @@ def test_cylindrical_mesh_estimators(run_in_tmpdir): assert np.all(diff < 3*std_dev) -@pytest.mark.parametrize("scale", [1.0, 1e2, 1e4, 1e5]) +@pytest.mark.parametrize("scale", [0.1, 1.0, 1e2, 1e4, 1e5]) def test_cylindrical_mesh_coincident(scale, run_in_tmpdir): """Test for cylindrical mesh boundary being coincident with a cell boundary""" @@ -162,7 +162,7 @@ def test_cylindrical_mesh_coincident(scale, run_in_tmpdir): assert mean1 == pytest.approx(mean2) -@pytest.mark.parametrize("scale", [1.0, 1e2, 1e4, 1e5]) +@pytest.mark.parametrize("scale", [0.1, 1.0, 1e2, 1e4, 1e5]) def test_spherical_mesh_coincident(scale, run_in_tmpdir): """Test for spherical mesh boundary being coincident with a cell boundary""" From b7250db6e130c37fe5e5dc54da9b57f7a1cbad38 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 26 Mar 2023 16:03:55 -0500 Subject: [PATCH 114/136] Update reference inputs for mgxs_library_specific_nuclides test --- .../inputs_true.dat | 433 +++++++++--------- 1 file changed, 216 insertions(+), 217 deletions(-) diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat index 061aa1b95..938b1c19d 100644 --- a/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat @@ -1,218 +1,217 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eigenvalue - 100 - 10 - 5 - - - -0.63 -0.63 -1 0.63 0.63 1 - - - - - - - 1 2 3 - - - 0.0 0.625 20000000.0 - - - 1 - - - 0.0 0.625 20000000.0 - - - 1 - - - 3 - - - 0.0 20000000.0 - - - 2 - - - 3 - - - 383 2 - total - flux - tracklength - - - 1 2 - U235 total - total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) - tracklength - - - 383 2 - total - flux - analog - - - 1 5 6 - U235 total - scatter nu-scatter - analog - - - 1 2 - U235 total - nu-scatter - analog - - - 1 2 5 30 - U235 total - scatter nu-scatter - analog - - - 1 2 5 - U235 total - nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) - analog - - - 1 54 - U235 total - nu-fission prompt-nu-fission - analog - - - 1 5 - U235 total - nu-fission prompt-nu-fission - analog - - - 106 2 - Zr90 total - total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) - tracklength - - - 106 5 6 - Zr90 total - scatter nu-scatter - analog - - - 106 2 - Zr90 total - nu-scatter - analog - - - 106 2 5 30 - Zr90 total - scatter nu-scatter - analog - - - 106 2 5 - Zr90 total - nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) - analog - - - 106 54 - Zr90 total - nu-fission prompt-nu-fission - analog - - - 106 5 - Zr90 total - nu-fission prompt-nu-fission - analog - - - 251 2 - H1 total - total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) - tracklength - - - 251 5 6 - H1 total - scatter nu-scatter - analog - - - 251 2 - H1 total - nu-scatter - analog - - - 251 2 5 30 - H1 total - scatter nu-scatter - analog - - - 251 2 5 - H1 total - nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) - analog - - - 251 54 - H1 total - nu-fission prompt-nu-fission - analog - - - 251 5 - H1 total - nu-fission prompt-nu-fission - analog - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + 1 2 3 + + + 0.0 0.625 20000000.0 + + + 1 + + + 0.0 0.625 20000000.0 + + + 1 + + + 3 + + + 0.0 20000000.0 + + + 2 + + + 3 + + + 383 2 + total + flux + tracklength + + + 1 2 + U235 total + total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) + tracklength + + + 383 2 + total + flux + analog + + + 1 5 6 + U235 total + scatter nu-scatter + analog + + + 1 2 + U235 total + nu-scatter + analog + + + 1 2 5 30 + U235 total + scatter nu-scatter + analog + + + 1 2 5 + U235 total + nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) + analog + + + 1 54 + U235 total + nu-fission prompt-nu-fission + analog + + + 1 5 + U235 total + nu-fission prompt-nu-fission + analog + + + 106 2 + Zr90 total + total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) + tracklength + + + 106 5 6 + Zr90 total + scatter nu-scatter + analog + + + 106 2 + Zr90 total + nu-scatter + analog + + + 106 2 5 30 + Zr90 total + scatter nu-scatter + analog + + + 106 2 5 + Zr90 total + nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) + analog + + + 106 54 + Zr90 total + nu-fission prompt-nu-fission + analog + + + 106 5 + Zr90 total + nu-fission prompt-nu-fission + analog + + + 251 2 + H1 total + total absorption (n,2n) (n,3n) (n,4n) fission nu-fission kappa-fission scatter inverse-velocity prompt-nu-fission (n,elastic) (n,level) (n,na) (n,nc) (n,gamma) (n,a) (n,Xa) heating damage-energy (n,n1) (n,a0) + tracklength + + + 251 5 6 + H1 total + scatter nu-scatter + analog + + + 251 2 + H1 total + nu-scatter + analog + + + 251 2 5 30 + H1 total + scatter nu-scatter + analog + + + 251 2 5 + H1 total + nu-scatter scatter nu-fission prompt-nu-fission (n,nc) (n,n1) (n,2n) + analog + + + 251 54 + H1 total + nu-fission prompt-nu-fission + analog + + + 251 5 + H1 total + nu-fission prompt-nu-fission + analog + + + From 6910e3657257ca1dcd6a00370614655afe6b3201 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sun, 26 Mar 2023 23:22:25 -0500 Subject: [PATCH 115/136] Adjustment to coincidence checking and case for r_grid[0] == 0 --- src/mesh.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 3ee489a68..5eb400a4b 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1066,6 +1066,9 @@ double CylindricalMesh::find_r_crossing( // s^2 * (u^2 + v^2) + 2*s*(u*x+v*y) + x^2+y^2-r0^2 = 0 const double r0 = grid_[0][shell]; + if (r0 == 0.0) + return INFTY; + const double denominator = u.x * u.x + u.y * u.y; // Direction of flight is in z-direction. Will never intersect r. @@ -1085,6 +1088,9 @@ double CylindricalMesh::find_r_crossing( D = std::sqrt(D); // the solution -p - D is always smaller as -p + D : Check this one first + if (std::abs(c) <= 1e-10) + return INFTY; + if (-p - D > l && std::abs(c) > 1e-10) return -p - D; if (-p + D > l) @@ -1304,14 +1310,19 @@ double SphericalMesh::find_r_crossing( // solve |r+s*u| = r0 // |r+s*u| = |r| + 2*s*r*u + s^2 (|u|==1 !) const double r0 = grid_[0][shell]; + if (r0 == 0.0) + return INFTY; const double p = r.dot(u); double c = r.dot(r) - r0 * r0; double D = p * p - c; + if (std::abs(c) <= 1e-10) + return INFTY; + if (D >= 0.0) { D = std::sqrt(D); // the solution -p - D is always smaller as -p + D : Check this one first - if (-p - D > l && std::abs(c) > 1e-10) + if (-p - D > l) return -p - D; if (-p + D > l) return -p + D; From 160360a2a6d2cf1f9bdbbdefa921c2bbca8f394e Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 27 Mar 2023 15:09:15 -0500 Subject: [PATCH 116/136] Remove old condition for cylindrical mesh --- src/mesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 5eb400a4b..3d94d21a0 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1091,7 +1091,7 @@ double CylindricalMesh::find_r_crossing( if (std::abs(c) <= 1e-10) return INFTY; - if (-p - D > l && std::abs(c) > 1e-10) + if (-p - D > l) return -p - D; if (-p + D > l) return -p + D; From 13a9e8fae4567f2a19156f087f6e4f038f032b20 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 27 Mar 2023 15:17:15 -0500 Subject: [PATCH 117/136] Adding tests with void geometry for cylindrical and spherical mesh --- tests/unit_tests/test_cylindrical_mesh.py | 89 +++++++++++++++++++ tests/unit_tests/test_spherical_mesh.py | 100 ++++++++++++++++++++++ 2 files changed, 189 insertions(+) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index 83ba09cc5..c8346bb4a 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -103,3 +103,92 @@ def test_offset_mesh(model, estimator, origin): mean[i, j, k] == 0.0 else: mean[i, j, k] != 0.0 + +@pytest.fixture() +def void_coincident_geom_model(): + """A model with many geometric boundaries coincident with mesh boundaries + across many scales + """ + openmc.reset_auto_ids() + model = openmc.model.Model() + + model.materials = openmc.Materials() + radii = [0.1,1, 5, 50, 100, 150, 250] + spheres = [openmc.Sphere(r=ri) for ri in radii] + spheres[-1].boundary_type = 'vacuum' + + regions = openmc.model.subdivide(spheres)[:-1] + cells = [openmc.Cell(region=r, fill=None) for r in regions] + geom = openmc.Geometry(cells) + + model.geometry = geom + + settings = openmc.Settings(run_mode='fixed source') + settings.batches = 2 + settings.particles = 1000 + model.settings = settings + + mesh = openmc.CylindricalMesh() + mesh.r_grid = np.linspace(0, 250, 501) + mesh.z_grid = [-250, 250] + mesh.phi_grid = np.linspace(0, 2*np.pi, 2) + mesh_filter = openmc.MeshFilter(mesh) + + tally = openmc.Tally() + tally.scores = ['flux'] + tally.filters = [mesh_filter] + + model.tallies = openmc.Tallies([tally]) + + return model + + +# convenience function for checking tally results +# in the following tests +def _check_void_cylindrical_tally(statepoint_filename): + with openmc.StatePoint(statepoint_filename) as sp: + flux_tally = sp.tallies[1] + mesh = flux_tally.find_filter(openmc.MeshFilter).mesh + neutron_flux = flux_tally.get_reshaped_data().squeeze() / mesh.volumes.flatten() + flux_diff = np.diff(neutron_flux) + # ensure flux values are monotonically decreasing due to + # geometric attenuation + assert (flux_diff < 0.0).all() + + +def test_void_geom_pnt_src(run_in_tmpdir, void_coincident_geom_model): + src = openmc.Source() + src.space = openmc.stats.Point() + src.angle = openmc.stats.PolarAzimuthal(mu=openmc.stats.Discrete([0.0], [1.0])) + src.energy = openmc.stats.Discrete([14.06e6], [1]) + void_coincident_geom_model.settings.source = src + + sp_filename = void_coincident_geom_model.run() + _check_void_cylindrical_tally(sp_filename) + + +def test_void_geom_boundary_src(run_in_tmpdir, void_coincident_geom_model): + bbox = void_coincident_geom_model.geometry.bounding_box + + outer_r = bbox[1][0] - 0.0001 + + radial_vals = np.linspace(0.0, 2.0*np.pi, 100) + + sources = [] + + energy = openmc.stats.Discrete([14.06e6], [1]) + for val in radial_vals: + src = openmc.Source() + src.energy = energy + + pnt = np.array([np.cos(val), np.sin(val), 0.0]) + u = -pnt + src.space = openmc.stats.Point(outer_r*pnt) + src.angle = openmc.stats.Monodirectional(u) + + sources.append(src) + + void_coincident_geom_model.settings.source = sources + sp_filename = void_coincident_geom_model.run() + + _check_void_cylindrical_tally(sp_filename) \ No newline at end of file diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index 73153f5cc..860156671 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -107,3 +107,103 @@ def test_offset_mesh(model, estimator, origin): mean[i, j, k] == 0.0 else: mean[i, j, k] != 0.0 + +# Some void geometry tests to check our radial intersection methods on +# spherical and cylindrical meshes + +@pytest.fixture() +def void_coincident_geom_model(): + """A model with many geometric boundaries coincident with mesh boundaries + across many scales + """ + openmc.reset_auto_ids() + + model = openmc.Model() + + model.materials = openmc.Materials() + radii = [0.1, 1, 5, 50, 100, 150, 250] + spheres = [openmc.Sphere(r=ri) for ri in radii] + spheres[-1].boundary_type = 'vacuum' + + regions = openmc.model.subdivide(spheres)[:-1] + cells = [openmc.Cell(region=r, fill=None) for r in regions] + geom = openmc.Geometry(cells) + + model.geometry = geom + + settings = openmc.Settings(run_mode='fixed source') + settings.batches = 2 + settings.particles = 5000 + model.settings = settings + + mesh = openmc.SphericalMesh() + mesh.r_grid = np.linspace(0, 250, 501) + mesh_filter = openmc.MeshFilter(mesh) + + tally = openmc.Tally() + tally.scores = ['flux'] + tally.filters = [mesh_filter] + + model.tallies = openmc.Tallies([tally]) + + return model + + +# convenience function for checking tally results +# in the following tests +def _check_void_spherical_tally(statepoint_filename): + with openmc.StatePoint(statepoint_filename) as sp: + flux_tally = sp.tallies[1] + mesh = flux_tally.find_filter(openmc.MeshFilter).mesh + neutron_flux = flux_tally.get_reshaped_data().squeeze() / mesh.volumes.flatten() + flux_diff = np.diff(neutron_flux) + # ensure flux values are monotonically decreasing due to + # geometric attenuation + assert (flux_diff < 0.0).all() + + +def test_void_geom_pnt_src(run_in_tmpdir, void_coincident_geom_model): + # add isotropic point source + src = openmc.Source() + src.space = openmc.stats.Point() + src.energy = openmc.stats.Discrete([14.06e6], [1]) + void_coincident_geom_model.settings.source = src + + sp_filename = void_coincident_geom_model.run() + + _check_void_spherical_tally(sp_filename) + + +def test_void_geom_boundary_src(run_in_tmpdir, void_coincident_geom_model): + # update source to a number of points on the outside of the sphere + # with directions pointing toward the origin + + # sources + phi_vals = np.linspace(0, np.pi, 20) + theta_vals = np.linspace(0, 2.0*np.pi, 20) + + bbox = void_coincident_geom_model.geometry.bounding_box + # can't source particles directly on the geometry boundary + outer_r = bbox[1][0] - 0.00001 + + sources = [] + + energy = openmc.stats.Discrete([14.06e6], [1]) + + for phi, theta in zip(phi_vals, theta_vals): + + src = openmc.Source() + src.energy = energy + + pnt = np.array([np.sin(phi)*np.cos(theta), np.sin(phi)*np.sin(theta), np.cos(phi)]) + u = -pnt + src.space = openmc.stats.Point(outer_r*pnt) + src.angle = openmc.stats.Monodirectional(u) + + sources.append(src) + + void_coincident_geom_model.settings.source = sources + + sp_filename = void_coincident_geom_model.run() + + _check_void_spherical_tally(sp_filename) From ab403b2fc8cf0aed15065c7caeafdfa79f4c07af Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 27 Mar 2023 16:15:38 -0500 Subject: [PATCH 118/136] Improvements to tests --- tests/unit_tests/test_cylindrical_mesh.py | 22 ++++++++++++-------- tests/unit_tests/test_spherical_mesh.py | 25 ++++++++++++----------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index c8346bb4a..27c4d5a1f 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -149,12 +149,12 @@ def _check_void_cylindrical_tally(statepoint_filename): with openmc.StatePoint(statepoint_filename) as sp: flux_tally = sp.tallies[1] mesh = flux_tally.find_filter(openmc.MeshFilter).mesh - neutron_flux = flux_tally.get_reshaped_data().squeeze() / mesh.volumes.flatten() - flux_diff = np.diff(neutron_flux) - # ensure flux values are monotonically decreasing due to - # geometric attenuation - assert (flux_diff < 0.0).all() - + neutron_flux = flux_tally.get_reshaped_data().squeeze() + # we expect the tally results to be the same as the mesh grid width + # for these cases + print(neutron_flux) + d_r = mesh.r_grid[1] - mesh.r_grid[0] + assert neutron_flux == pytest.approx(d_r) def test_void_geom_pnt_src(run_in_tmpdir, void_coincident_geom_model): src = openmc.Source() @@ -168,11 +168,15 @@ def test_void_geom_pnt_src(run_in_tmpdir, void_coincident_geom_model): def test_void_geom_boundary_src(run_in_tmpdir, void_coincident_geom_model): + # update source to a number of points on the outside of the cylinder + # with directions pointing toward the origin bbox = void_coincident_geom_model.geometry.bounding_box - outer_r = bbox[1][0] - 0.0001 + # can't source particle directly on the geometry boundary + outer_r = bbox[1][0] - 1e-08 - radial_vals = np.linspace(0.0, 2.0*np.pi, 100) + n_sources = 100 + radial_vals = np.linspace(0.0, 2.0*np.pi, n_sources) sources = [] @@ -185,7 +189,7 @@ def test_void_geom_boundary_src(run_in_tmpdir, void_coincident_geom_model): u = -pnt src.space = openmc.stats.Point(outer_r*pnt) src.angle = openmc.stats.Monodirectional(u) - + src.strength = 0.5/n_sources sources.append(src) void_coincident_geom_model.settings.source = sources diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index 860156671..0f02e9699 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -155,11 +155,11 @@ def _check_void_spherical_tally(statepoint_filename): with openmc.StatePoint(statepoint_filename) as sp: flux_tally = sp.tallies[1] mesh = flux_tally.find_filter(openmc.MeshFilter).mesh - neutron_flux = flux_tally.get_reshaped_data().squeeze() / mesh.volumes.flatten() - flux_diff = np.diff(neutron_flux) - # ensure flux values are monotonically decreasing due to - # geometric attenuation - assert (flux_diff < 0.0).all() + neutron_flux = flux_tally.get_reshaped_data().squeeze() + # the flux values for each bin should equal the width + # width of the mesh bins + d_r = mesh.r_grid[1] - mesh.r_grid[0] + assert neutron_flux == pytest.approx(d_r) def test_void_geom_pnt_src(run_in_tmpdir, void_coincident_geom_model): @@ -169,22 +169,21 @@ def test_void_geom_pnt_src(run_in_tmpdir, void_coincident_geom_model): src.energy = openmc.stats.Discrete([14.06e6], [1]) void_coincident_geom_model.settings.source = src + # run model and check tally results sp_filename = void_coincident_geom_model.run() - _check_void_spherical_tally(sp_filename) def test_void_geom_boundary_src(run_in_tmpdir, void_coincident_geom_model): # update source to a number of points on the outside of the sphere # with directions pointing toward the origin - - # sources - phi_vals = np.linspace(0, np.pi, 20) - theta_vals = np.linspace(0, 2.0*np.pi, 20) + n_sources = 20 + phi_vals = np.linspace(0, np.pi, n_sources) + theta_vals = np.linspace(0, 2.0*np.pi, n_sources) bbox = void_coincident_geom_model.geometry.bounding_box # can't source particles directly on the geometry boundary - outer_r = bbox[1][0] - 0.00001 + outer_r = bbox[1][0] - 1e-08 sources = [] @@ -199,11 +198,13 @@ def test_void_geom_boundary_src(run_in_tmpdir, void_coincident_geom_model): u = -pnt src.space = openmc.stats.Point(outer_r*pnt) src.angle = openmc.stats.Monodirectional(u) + # set source strengths so that we can still expect + # a tally value of 0.5 + src.strength = 0.5/n_sources sources.append(src) void_coincident_geom_model.settings.source = sources sp_filename = void_coincident_geom_model.run() - _check_void_spherical_tally(sp_filename) From 63fa42843b04966d75bb4eb0c3a91e12e531d2b9 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 27 Mar 2023 16:50:18 -0500 Subject: [PATCH 119/136] Removing unused print statements --- tests/unit_tests/test_cylindrical_mesh.py | 2 -- tests/unit_tests/test_spherical_mesh.py | 1 - 2 files changed, 3 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index 27c4d5a1f..cbdb1d315 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -98,7 +98,6 @@ def test_offset_mesh(model, estimator, origin): centroids = mesh.centroids for ijk in mesh.indices: i, j, k = np.array(ijk) - 1 - print(centroids[:, i, j, k]) if model.geometry.find(centroids[:, i, j, k]): mean[i, j, k] == 0.0 else: @@ -152,7 +151,6 @@ def _check_void_cylindrical_tally(statepoint_filename): neutron_flux = flux_tally.get_reshaped_data().squeeze() # we expect the tally results to be the same as the mesh grid width # for these cases - print(neutron_flux) d_r = mesh.r_grid[1] - mesh.r_grid[0] assert neutron_flux == pytest.approx(d_r) diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index 0f02e9699..ba3167d6f 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -102,7 +102,6 @@ def test_offset_mesh(model, estimator, origin): centroids = mesh.centroids for ijk in mesh.indices: i, j, k = np.array(ijk) - 1 - print(centroids[:, i, j, k]) if model.geometry.find(centroids[:, i, j, k]): mean[i, j, k] == 0.0 else: From 26c031a041e110b1ac944044c5d011e4b874b20d Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 27 Mar 2023 16:54:42 -0500 Subject: [PATCH 120/136] Run tests in tmpdir to keep repo clean --- tests/unit_tests/test_cylindrical_mesh.py | 2 +- tests/unit_tests/test_spherical_mesh.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index cbdb1d315..2be0f4962 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -75,7 +75,7 @@ def label(p): return f'estimator:{p}' @pytest.mark.parametrize('estimator,origin', test_cases, ids=label) -def test_offset_mesh(model, estimator, origin): +def test_offset_mesh(run_in_tmpdir, model, estimator, origin): """Tests that the mesh has been moved based on tally results """ mesh = model.tallies[0].filters[0].mesh diff --git a/tests/unit_tests/test_spherical_mesh.py b/tests/unit_tests/test_spherical_mesh.py index ba3167d6f..ac2781378 100644 --- a/tests/unit_tests/test_spherical_mesh.py +++ b/tests/unit_tests/test_spherical_mesh.py @@ -79,7 +79,7 @@ def label(p): return f'estimator:{p}' @pytest.mark.parametrize('estimator,origin', test_cases, ids=label) -def test_offset_mesh(model, estimator, origin): +def test_offset_mesh(run_in_tmpdir, model, estimator, origin): """Tests that the mesh has been moved based on tally results """ mesh = model.tallies[0].filters[0].mesh From e41ae3604ea6a7448219be7ae764337ac0043edc Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Mon, 27 Mar 2023 18:36:49 -0500 Subject: [PATCH 121/136] Clone material. Refs #2442 --- include/openmc/material.h | 3 +++ src/material.cpp | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/include/openmc/material.h b/include/openmc/material.h index 8db9bb628..36a6acf93 100644 --- a/include/openmc/material.h +++ b/include/openmc/material.h @@ -90,6 +90,9 @@ public: void set_densities( const vector& name, const vector& density); + //! Clone the material by deep-copying all members + void clone(); + //---------------------------------------------------------------------------- // Accessors diff --git a/src/material.cpp b/src/material.cpp index 74a8d7e35..ec82a7eea 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -353,6 +353,37 @@ Material::~Material() model::material_map.erase(id_); } +void Material::clone() +{ + std::unique_ptr mat = std::make_unique(); + mat->index_ = model::materials.size(); + mat->set_id(C_NONE); + + // set all other parameters to whatever the calling Material has + mat->name_ = name_; + mat->nuclide_ = nuclide_; + mat->element_ = element_; + mat->ncrystal_mat_ = ncrystal_mat_; + mat->atom_density_ = atom_density_; + mat->density_ = density_; + mat->density_gpcc_ = density_gpcc_; + mat->volume_ = volume_; + mat->fissionable_ = fissionable_; + mat->depletable_ = depletable_; + mat->p0_ = p0_; + mat->mat_nuclide_index_ = mat_nuclide_index_; + mat->thermal_tables_ = thermal_tables_; + mat->temperature_ = temperature_; + + if (ttb_) + { + std::unique_ptr ptr2{new Bremsstrahlung{*ttb_}}; + mat->ttb_ = std::move(ptr2); + } + + model::materials.push_back(std::move(mat)); +} + void Material::finalize() { // Set fissionable if any nuclide is fissionable From a44c1f89de907292863b47ecdc62b10cb6685d40 Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Mon, 27 Mar 2023 19:21:30 -0500 Subject: [PATCH 122/136] Address review comments. Refs #2442 --- src/material.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/material.cpp b/src/material.cpp index ec82a7eea..165a5c2e7 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -353,7 +353,7 @@ Material::~Material() model::material_map.erase(id_); } -void Material::clone() +Material & Material::clone() { std::unique_ptr mat = std::make_unique(); mat->index_ = model::materials.size(); @@ -376,12 +376,10 @@ void Material::clone() mat->temperature_ = temperature_; if (ttb_) - { - std::unique_ptr ptr2{new Bremsstrahlung{*ttb_}}; - mat->ttb_ = std::move(ptr2); - } + mat->ttb_ = std::make_unique(*ttb_); model::materials.push_back(std::move(mat)); + return *mat; } void Material::finalize() From fa222a4b314dac399d471fd2016e839a9c98549a Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Mon, 27 Mar 2023 19:23:04 -0500 Subject: [PATCH 123/136] Address review comments. --- include/openmc/material.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openmc/material.h b/include/openmc/material.h index 36a6acf93..36d7c34c6 100644 --- a/include/openmc/material.h +++ b/include/openmc/material.h @@ -91,7 +91,7 @@ public: const vector& name, const vector& density); //! Clone the material by deep-copying all members - void clone(); + Material & clone(); //---------------------------------------------------------------------------- // Accessors From e5863eec1b80a24ffb471eb8287125c1e18d00db Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 28 Mar 2023 07:35:22 -0500 Subject: [PATCH 124/136] Correcting variable name --- tests/unit_tests/test_cylindrical_mesh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index 2be0f4962..caf933360 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -113,10 +113,10 @@ def void_coincident_geom_model(): model.materials = openmc.Materials() radii = [0.1,1, 5, 50, 100, 150, 250] - spheres = [openmc.Sphere(r=ri) for ri in radii] - spheres[-1].boundary_type = 'vacuum' + cylinders = [openmc.Sphere(r=ri) for ri in radii] + cylinders[-1].boundary_type = 'vacuum' - regions = openmc.model.subdivide(spheres)[:-1] + regions = openmc.model.subdivide(cylinders)[:-1] cells = [openmc.Cell(region=r, fill=None) for r in regions] geom = openmc.Geometry(cells) From 86e9a4bd4b1c619e3f39b761a3a81658665ded19 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 28 Mar 2023 08:47:42 -0500 Subject: [PATCH 125/136] Adding constants for coincidence checking --- include/openmc/constants.h | 4 ++++ src/mesh.cpp | 4 ++-- src/surface.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index 2a867c0ca..b0031fae3 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -51,6 +51,10 @@ constexpr double FP_PRECISION {1e-14}; constexpr double FP_REL_PRECISION {1e-5}; constexpr double FP_COINCIDENT {1e-12}; +// Coincidence tolerances +constexpr double TORUS_TOL {1e-10}; +constexpr double RADIAL_MESH_TOL {1e-10}; + // Maximum number of random samples per history constexpr int MAX_SAMPLE {100000}; diff --git a/src/mesh.cpp b/src/mesh.cpp index 3d94d21a0..e72a5cf7d 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1088,7 +1088,7 @@ double CylindricalMesh::find_r_crossing( D = std::sqrt(D); // the solution -p - D is always smaller as -p + D : Check this one first - if (std::abs(c) <= 1e-10) + if (std::abs(c) <= RADIAL_MESH_TOL) return INFTY; if (-p - D > l) @@ -1316,7 +1316,7 @@ double SphericalMesh::find_r_crossing( double c = r.dot(r) - r0 * r0; double D = p * p - c; - if (std::abs(c) <= 1e-10) + if (std::abs(c) <= RADIAL_MESH_TOL) return INFTY; if (D >= 0.0) { diff --git a/src/surface.cpp b/src/surface.cpp index c0b3f0a59..2403d0c6a 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -1044,7 +1044,7 @@ double torus_distance(double x1, double x2, double x3, double u1, double u2, // zero but possibly small and positive. A tolerance is set to discard that // zero. double distance = INFTY; - double cutoff = coincident ? 1e-10 : 0.0; + double cutoff = coincident ? TORUS_TOL : 0.0; for (int i = 0; i < 4; ++i) { if (roots[i].imag() == 0) { double root = roots[i].real(); From 6cb4401230e9189169a4754180ec3d6a2b3e20b1 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 28 Mar 2023 10:11:14 -0500 Subject: [PATCH 126/136] Correcting surface type in cylinder tests --- tests/unit_tests/test_cylindrical_mesh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_cylindrical_mesh.py b/tests/unit_tests/test_cylindrical_mesh.py index caf933360..4382b49ba 100644 --- a/tests/unit_tests/test_cylindrical_mesh.py +++ b/tests/unit_tests/test_cylindrical_mesh.py @@ -113,7 +113,7 @@ def void_coincident_geom_model(): model.materials = openmc.Materials() radii = [0.1,1, 5, 50, 100, 150, 250] - cylinders = [openmc.Sphere(r=ri) for ri in radii] + cylinders = [openmc.ZCylinder(r=ri) for ri in radii] cylinders[-1].boundary_type = 'vacuum' regions = openmc.model.subdivide(cylinders)[:-1] From 7bbf5466e6aec1c7610e69e8c7a6f144e8951f1d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 26 Mar 2023 11:15:36 -0500 Subject: [PATCH 127/136] Add missing versionadded directives --- openmc/deplete/results.py | 2 ++ openmc/filter.py | 2 ++ openmc/geometry.py | 2 ++ openmc/model/model.py | 2 ++ openmc/model/surface_composite.py | 4 +++- openmc/tallies.py | 2 ++ 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 3602d6918..c9dc19816 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -398,6 +398,8 @@ class Results(list): path : PathLike Path to materials XML file to read. Defaults to 'materials.xml'. + .. versionadded:: 0.13.3 + Returns ------- mat_file : Materials diff --git a/openmc/filter.py b/openmc/filter.py index 3240c9e25..cc7bdd931 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1349,6 +1349,8 @@ class EnergyFilter(RealFilter): (e.g., a source spectrum) based on tally results that were obtained from using an :class:`~openmc.EnergyFilter`. + .. versionadded:: 0.13.3 + Parameters ---------- values : iterable of float diff --git a/openmc/geometry.py b/openmc/geometry.py index d01826a4d..ad86cc56b 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -537,6 +537,8 @@ class Geometry: def get_surfaces_by_name(self, name, case_sensitive=False, matching=False): """Return a list of surfaces with matching names. + .. versionadded:: 0.13.3 + Parameters ---------- name : str diff --git a/openmc/model/model.py b/openmc/model/model.py index 78f02242f..4202cf60b 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -644,6 +644,8 @@ class Model: Exports a single model.xml file rather than separate files. Defaults to True. + .. versionadded:: 0.13.3 + Returns ------- Path diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 354a62883..25826723c 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -632,6 +632,8 @@ class ZConeOneSided(CompositeSurface): class Polygon(CompositeSurface): """Create a polygon composite surface from a path of closed points. + .. versionadded:: 0.13.3 + Parameters ---------- points : np.ndarray @@ -927,7 +929,7 @@ class Polygon(CompositeSurface): if group is None: sidx = next(iter(neighbor_map)) return self._group_simplices(neighbor_map, group=[sidx]) - # Otherwise use the last simplex in the group + # Otherwise use the last simplex in the group else: sidx = group[-1] # Remove current simplex from dictionary since it is in a group diff --git a/openmc/tallies.py b/openmc/tallies.py index 688369de0..1a27e1bd4 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1436,6 +1436,8 @@ class Tally(IDManagerMixin): dimensions. This will result in more than one dimension per filter for the returned data array. + .. versionadded:: 0.13.3 + Returns ------- numpy.ndarray From 75dcf5b9a77f27eeb6e971e9b606360b0dc1bbf9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 26 Mar 2023 11:16:23 -0500 Subject: [PATCH 128/136] Add release notes for 0.13.3 --- docs/source/releasenotes/0.13.2.rst | 2 +- docs/source/releasenotes/0.13.3.rst | 134 ++++++++++++++++++++++++++++ docs/source/releasenotes/index.rst | 1 + 3 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 docs/source/releasenotes/0.13.3.rst diff --git a/docs/source/releasenotes/0.13.2.rst b/docs/source/releasenotes/0.13.2.rst index e9175358b..b0c9b0691 100644 --- a/docs/source/releasenotes/0.13.2.rst +++ b/docs/source/releasenotes/0.13.2.rst @@ -14,7 +14,7 @@ Notably, a capability has been added to compute the photon spectra from decay of unstable nuclides. Alongside that, a new :data:`openmc.config` configuration variable has been introduced that allows easier configuration of data sources. Additionally, users can now perform cell or material rejection when sampling -external source distributions. Finally, +external source distributions. ------------------------------------ Compatibility Notes and Deprecations diff --git a/docs/source/releasenotes/0.13.3.rst b/docs/source/releasenotes/0.13.3.rst new file mode 100644 index 000000000..c2debbcb3 --- /dev/null +++ b/docs/source/releasenotes/0.13.3.rst @@ -0,0 +1,134 @@ +==================== +What's New in 0.13.3 +==================== + +.. currentmodule:: openmc + +------- +Summary +------- + +This release of OpenMC includes many bug fixes, performance improvements, and +several notable new features. Some of the highlights include support for MCPL +source files, NCrystal thermal scattering materials, and a new +:class:`openmc.stats.MeshSpatial` class that allows a source distribution to be +specified over a mesh. Additionally, OpenMC now allows you to export your model +as a single XML file rather than separate XML files for geometry, materials, +settings, and tallies. + +------------------------------------ +Compatibility Notes and Deprecations +------------------------------------ + +- Atomic mass data used in :func:`openmc.data.atomic_mass` has been updated to + AME 2020, which results in slightly different masses. + +------------ +New Features +------------ + +- Support was added for `MCPL `_ files to be + used as external sources. Additionally, source points and surfaces sources can + be written as MCPL files instead of HDF5 files. (`#2116 + `_) +- Support was added for `NCrystal `_ + thermal scattering materials. (`#2222 + `_) +- The :class:`~openmc.CylindricalMesh` and :class:`~openmc.SphericalMesh` + classes now have an ``origin`` attribute that changes the center of the mesh. + (`#2256 `_) +- A new :class:`openmc.model.Polygon` class allows defining generalized 2D + polygons. (`#2266 `_) +- A new :func:`openmc.data.decay_energy` function and + :meth:`openmc.Material.get_decay_heat` method enable determination of decay + heat from a single nuclide or material. (`#2287 + `_) +- Full models can now be written as a single XML file rather than separate + geometry, materials, settings, and tallies XML files. (`#2291 + `_) +- Discrete distributions are now sampled using alias sampling, which is O(1) in + time. (`#2329 `_) +- The new :class:`openmc.stats.MeshSpatial` allows a spatial source distribution + to be specified with source strengths for each mesh element. (`#2334 + `_) +- The new :meth:`openmc.Geometry.get_surfaces_by_name` method returns a list of + matching surfaces in a geometry. (`#2347 + `_) +- A new :attr:`openmc.Settings.create_delayed_neutrons` attribute controls + whether delayed neutrons are created during a simulation. (`#2348 + `_) +- The :meth:`openmc.deplete.Results.export_to_materials` method now takes a + ``path`` argument. (`#2364 `_) +- A new :meth:`openmc.EnergyFilter.get_tabular` method allows one to create a + tabular distribution based on tally results using an energy filter. (`#2371 + `_) +- Several methods in the :class:`openmc.Material` class that require a volume to + be set (e.g., :meth:`~openmc.Material.get_mass`) now accept a ``volume`` + argument. (`#2412 `_) + +--------- +Bug Fixes +--------- + +- Fix for finding redundant surfaces (`#2263 `_) +- Adds tolerance for temperatures slightly out of bounds (`#2265 `_) +- Fix getter/setter for weight window bounds (`#2275 `_) +- Make sure Chain.reduce preserves decay source (`#2283 `_) +- Fix array shape for weight window bounds (`#2284 `_) +- Fix for non-zero CDF start points in TSL data (`#2290 `_) +- Fix a case where inelastic scattering yield is zero (`#2295 `_) +- Prevent Compton profile out-of-bounds memory access (`#2297 `_) +- Produce light particles from decay (`#2301 `_) +- Fix zero runtime attributes in depletion statepoints (`#2302 `_) +- Fix bug in openmc.Universe.get_nuclide_densities (`#2310 `_) +- Only show print output from depletion on rank 0 (`#2311 `_) +- Fix photon transport with no atomic relaxation data (`#2312 `_) +- Fix for precedence in region expressions (`#2318 `_) +- Allow source particles with energy below cutoff (`#2319 `_) +- Fix IncidentNeutron.from_njoy for high temperatures (`#2320 `_) +- Add capability to unset cell temperatures (`#2323 `_) +- Fix in plot_xs when S(a,b) tables are present (`#2335 `_) +- Various fixes for tally triggers (`#2344 `_) +- Raise error when mesh is flat (`#2363 `_) +- Don't call normalize inside Tabular.mean (`#2375 `_) +- Avoid out-of-bounds access in inelastic scatter sampling (`#2378 `_) +- Use correct direction for anisotropic fission (`#2381 `_) +- Fix several thermal scattering nuclide assignments (`#2382 `_) +- Fix _materials_by_id attribute in Model (`#2385 `_) +- Updates to batch checks for simulation restarts (`#2390 `_) +- write_data_to_vtk volume normalization correction (`#2397 `_) +- Enable generation of JEFF 3.3 depletion chain (`#2410 `_) +- Fix spherical to Cartesian coordinate conversion (`#2417 `_) +- Handle zero photon cross sections in IncidentPhoton.from_ace (`#2433 `_) +- Fix hybrid depletion when nuclides are not present (`#2436 `_) +- Fix bug in cylindrical and spherical meshes (`#2439 `_) +- Improvements to mesh radial boundary coincidence (`#2443 `_) + +------------ +Contributors +------------ + +- `Hunter Belanger `_ +- `Rémi Delaporte-Mathurin `_ +- `Christopher Fichtlscherer `_ +- `Valerio Giusti `_ +- `Chris Keckler `_ +- `Kalin Kiesling `_ +- `Thomas Kittelmann `_ +- `Erik Knudsen `_ +- `Colin Larmier `_ +- `Amanda Lund `_ +- `Jose Ignacio Marquez Damien `_ +- `Josh May `_ +- `Patrick Myers `_ +- `Baptiste Mouginot `_ +- `April Novak `_ +- `Matthew Nyberg `_ +- `Ethan Peterson `_ +- `Gavin Ridley `_ +- `Paul Romano `_ +- `Patrick Shriwise `_ +- `Jonathan Shimwell `_ +- `Paul Wilson `_ +- `Olek Yardas `_ +- `Jiankai Yu `_ diff --git a/docs/source/releasenotes/index.rst b/docs/source/releasenotes/index.rst index 910737a41..30b6d51de 100644 --- a/docs/source/releasenotes/index.rst +++ b/docs/source/releasenotes/index.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 1 + 0.13.3 0.13.2 0.13.1 0.13.0 From 2f50599d4f347d5a247f0ca8c3f5419d2b8b6301 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 26 Mar 2023 16:15:23 -0500 Subject: [PATCH 129/136] Update install instructions --- docs/source/usersguide/install.rst | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 899e16506..af6a93f9d 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -277,7 +277,7 @@ Prerequisites Lists) files instead of .h5 files for sources (external source distribution, k-eigenvalue source distribution, and surface sources). To turn this option on in the CMake configuration step, add the following - option: + option:: cmake -DOPENMC_USE_MCPL=on .. @@ -288,7 +288,7 @@ Prerequisites on-the-fly approach. To use it `install `_ and `initialize `_ - NCrystal and turn on the option in the CMake configuration step: + NCrystal and turn on the option in the CMake configuration step:: cmake -DOPENMC_USE_NCRYSTAL=on .. @@ -299,7 +299,7 @@ Prerequisites be used, but the implementation is currently restricted to collision estimators. In addition to turning this option on, the path to the libMesh installation should be specified as part of the ``CMAKE_PREFIX_PATH`` - variable.:: + variable:: cmake -DOPENMC_USE_LIBMESH=on -DOPENMC_USE_MPI=on -DCMAKE_PREFIX_PATH=/path/to/libmesh/installation .. @@ -371,6 +371,10 @@ CMakeLists.txt Options The following options are available in the CMakeLists.txt file: +OPENMC_ENABLE_COVERAGE + Compile and link code instrumented for coverage analysis. This is typically + used in conjunction with gcov_. (Default: off) + OPENMC_ENABLE_PROFILE Enables profiling using the GNU profiler, gprof. (Default: off) @@ -385,22 +389,23 @@ OPENMC_USE_DAGMC should also be defined as `DAGMC_ROOT` in the CMake configuration command. (Default: off) +OPENMC_USE_MCPL + Turns on support for reading MCPL_ source files and writing MCPL source points + and surface sources. (Default: off) + OPENMC_USE_NCRYSTAL - Turns on support for NCrystal materials. NCrystal must be - `installed `_ and - `initialized `_. + Turns on support for NCrystal materials. NCrystal must be `installed + `_ and `initialized + `_. (Default: off) OPENMC_USE_LIBMESH Enables the use of unstructured mesh tallies with libMesh_. (Default: off) -OPENMC_ENABLE_COVERAGE - Compile and link code instrumented for coverage analysis. This is typically - used in conjunction with gcov_. (Default: off) - OPENMC_USE_MPI - Turns on compiling with MPI (default: off). For further information on MPI options, - please see the `FindMPI.cmake documentation `_. + Turns on compiling with MPI (Default: off). For further information on MPI + options, please see the `FindMPI.cmake documentation + `_. To set any of these options (e.g., turning on profiling), the following form should be used: From 8a5fb8a8b067e5a333176e51f19a7b581863b339 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 26 Mar 2023 16:15:43 -0500 Subject: [PATCH 130/136] Update version number to 0.13.3 --- include/openmc/version.h.in | 2 +- openmc/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/openmc/version.h.in b/include/openmc/version.h.in index e1c2b0541..a518e0d63 100644 --- a/include/openmc/version.h.in +++ b/include/openmc/version.h.in @@ -10,7 +10,7 @@ namespace openmc { constexpr int VERSION_MAJOR {@OPENMC_VERSION_MAJOR@}; constexpr int VERSION_MINOR {@OPENMC_VERSION_MINOR@}; constexpr int VERSION_RELEASE {@OPENMC_VERSION_RELEASE@}; -constexpr bool VERSION_DEV {true}; +constexpr bool VERSION_DEV {false}; constexpr std::array VERSION {VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE}; // clang-format on diff --git a/openmc/__init__.py b/openmc/__init__.py index cbf4d9ae2..f94cd038f 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -38,4 +38,4 @@ from .config import * from openmc.model import rectangular_prism, hexagonal_prism, Model -__version__ = '0.13.3-dev' +__version__ = '0.13.3' From e7a688a867f84bc764117b1b492d172978a7fa33 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 28 Mar 2023 10:27:46 -0500 Subject: [PATCH 131/136] Update Spack installation instructions --- docs/source/usersguide/install.rst | 31 +++++++++++++----------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index af6a93f9d..ed02c5d9f 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -105,9 +105,9 @@ other information use: .. note:: - It should be noted that by default OpenMC builds with ``-O2 -g`` flags which - are equivalent to a CMake build type of `RelwithDebInfo`. In addition, MPI - is OFF while OpenMP is ON. + It should be noted that by default OpenMC is built with + `-DCMAKE_BUILD_TYPE=RelwithDebInfo`. In addition, MPI is OFF while OpenMP is + ON. It is recommended to install OpenMC with the Python API. Information about this Spack recipe can be found with the following command: @@ -133,17 +133,18 @@ following command: configured defaults unless otherwise specfied in the specification on the command line. In the above example, assuming the default options weren't changed in Spack's package configuration, py-openmc will link against a - non-optimized non-MPI openmc. Even if an optimized openmc was built - separately, it will rebuild openmc with optimization OFF. Thus, if you are - trying to link against dependencies that were configured different than - defaults, ``^openmc[variants]`` will have to be present in the command. + non-MPI non-release build of openmc. Even if a release build of openmc was + built separately, it will rebuild openmc with the default build type. Thus, + if you are trying to link against dependencies that were configured + different than defaults, ``^openmc[variants]`` will have to be present in + the command. -For a more performant build of OpenMC with optimization turned ON and MPI -provided by OpenMPI, the following command can be used: +For a release build of OpenMC with MPI support on (provided by OpenMPI), the +following command can be used: .. code-block:: sh - spack install py-openmc+mpi ^openmc+optimize ^openmpi + spack install py-openmc +mpi ^openmpi ^openmc build_type=Release .. note:: @@ -163,7 +164,7 @@ This can be observed using Spack's ``spec`` tool: .. code-block:: - spack spec py-openmc+mpi ^openmc+optimize + spack spec py-openmc +mpi ^openmc build_type=Release Once installed, environment/lmod modules can be generated or Spack's ``load`` feature can be used to access the installed packages. @@ -526,13 +527,7 @@ distribution/repository, run: pip will first check that all :ref:`required third-party packages ` have been installed, and if they are not present, they will be installed by downloading the appropriate packages from the Python -Package Index (`PyPI `_). However, do note that since pip -runs the ``setup.py`` script which requires NumPy, you will have to first -install NumPy: - -.. code-block:: sh - - pip install numpy +Package Index (`PyPI `_). Installing in "Development" Mode -------------------------------- From b84a021c58623e8198cf315c6993e64e3b051613 Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Tue, 28 Mar 2023 13:50:02 -0500 Subject: [PATCH 132/136] Improve documentation. Refs #2442 --- include/openmc/material.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/openmc/material.h b/include/openmc/material.h index 36d7c34c6..deaee2469 100644 --- a/include/openmc/material.h +++ b/include/openmc/material.h @@ -90,7 +90,10 @@ public: void set_densities( const vector& name, const vector& density); - //! Clone the material by deep-copying all members + //! Clone the material by deep-copying all members, except for the ID, + // which will get auto-assigned to the next available ID. After creating + // the new material, it is added to openmc::model::materials. + //! \return reference to the cloned material Material & clone(); //---------------------------------------------------------------------------- From ca061bc7e5ecad80ca074070438ebeab9b791b0b Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Tue, 28 Mar 2023 19:20:49 -0500 Subject: [PATCH 133/136] Return non-null. --- src/material.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/material.cpp b/src/material.cpp index 165a5c2e7..092055aa1 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -379,7 +379,7 @@ Material & Material::clone() mat->ttb_ = std::make_unique(*ttb_); model::materials.push_back(std::move(mat)); - return *mat; + return *model::materials.back(); } void Material::finalize() From e2373c833b719a05c1c7e4b3cec261e750af1cbe Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 29 Mar 2023 06:51:01 -0500 Subject: [PATCH 134/136] Show MCPL and NCrystal in openmc --version --- src/output.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/output.cpp b/src/output.cpp index ae0907d02..04e15b82d 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -360,6 +360,8 @@ void print_build_info() std::string png(n); std::string profiling(n); std::string coverage(n); + std::string mcpl(n); + std::string ncrystal(n); #ifdef PHDF5 phdf5 = y; @@ -373,6 +375,12 @@ void print_build_info() #ifdef LIBMESH libmesh = y; #endif +#ifdef OPENMC_MCPL + mcpl = y; +#endif +#ifdef NCRYSTAL + ncrystal = y; +#endif #ifdef USE_LIBPNG png = y; #endif @@ -396,6 +404,8 @@ void print_build_info() fmt::print("PNG support: {}\n", png); fmt::print("DAGMC support: {}\n", dagmc); fmt::print("libMesh support: {}\n", libmesh); + fmt::print("MCPL support: {}\n", mcpl); + fmt::print("NCrystal support: {}\n", ncrystal); fmt::print("Coverage testing: {}\n", coverage); fmt::print("Profiling flags: {}\n", profiling); } From c3fdf4edd2ee6dc7d9ea2a9e5c48c3d0efb670f4 Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Wed, 29 Mar 2023 14:40:37 -0500 Subject: [PATCH 135/136] Group openmc::model lines together. Refs #2442 --- src/material.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/material.cpp b/src/material.cpp index 092055aa1..82dd0d4d9 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -356,8 +356,6 @@ Material::~Material() Material & Material::clone() { std::unique_ptr mat = std::make_unique(); - mat->index_ = model::materials.size(); - mat->set_id(C_NONE); // set all other parameters to whatever the calling Material has mat->name_ = name_; @@ -378,6 +376,8 @@ Material & Material::clone() if (ttb_) mat->ttb_ = std::make_unique(*ttb_); + mat->index_ = model::materials.size(); + mat->set_id(C_NONE); model::materials.push_back(std::move(mat)); return *model::materials.back(); } From 5fcb7208dfe9316407a9598e7aff5c498f218cd6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 29 Mar 2023 14:41:03 -0500 Subject: [PATCH 136/136] Change version number to 0.13.4-dev --- CMakeLists.txt | 2 +- docs/source/conf.py | 2 +- include/openmc/version.h.in | 2 +- openmc/__init__.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dcaa6fb3..866050a98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(openmc C CXX) # Set version numbers set(OPENMC_VERSION_MAJOR 0) set(OPENMC_VERSION_MINOR 13) -set(OPENMC_VERSION_RELEASE 3) +set(OPENMC_VERSION_RELEASE 4) set(OPENMC_VERSION ${OPENMC_VERSION_MAJOR}.${OPENMC_VERSION_MINOR}.${OPENMC_VERSION_RELEASE}) configure_file(include/openmc/version.h.in "${CMAKE_BINARY_DIR}/include/openmc/version.h" @ONLY) diff --git a/docs/source/conf.py b/docs/source/conf.py index 988e626cf..8dbbfc6d4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -71,7 +71,7 @@ copyright = '2011-2023, Massachusetts Institute of Technology, UChicago Argonne # The short X.Y version. version = "0.13" # The full version, including alpha/beta/rc tags. -release = "0.13.3" +release = "0.13.4" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/include/openmc/version.h.in b/include/openmc/version.h.in index a518e0d63..e1c2b0541 100644 --- a/include/openmc/version.h.in +++ b/include/openmc/version.h.in @@ -10,7 +10,7 @@ namespace openmc { constexpr int VERSION_MAJOR {@OPENMC_VERSION_MAJOR@}; constexpr int VERSION_MINOR {@OPENMC_VERSION_MINOR@}; constexpr int VERSION_RELEASE {@OPENMC_VERSION_RELEASE@}; -constexpr bool VERSION_DEV {false}; +constexpr bool VERSION_DEV {true}; constexpr std::array VERSION {VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE}; // clang-format on diff --git a/openmc/__init__.py b/openmc/__init__.py index f94cd038f..ac9e02e16 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -38,4 +38,4 @@ from .config import * from openmc.model import rectangular_prism, hexagonal_prism, Model -__version__ = '0.13.3' +__version__ = '0.13.4-dev'