diff --git a/tests/regression_tests/filter_mesh/inputs_true.dat b/tests/regression_tests/filter_mesh/inputs_true.dat index 919347d69c..37716c02e4 100644 --- a/tests/regression_tests/filter_mesh/inputs_true.dat +++ b/tests/regression_tests/filter_mesh/inputs_true.dat @@ -34,24 +34,24 @@ - 17 - -10.0 - 10.0 + 5 + -7.5 + 7.5 - 17 17 - -10.0 -10.0 - 10.0 10.0 + 5 5 + -7.5 -7.5 + 7.5 7.5 - 17 17 17 - -10.0 -10.0 -183.0 - 10.0 10.0 183.0 + 5 5 5 + -7.5 -7.5 -7.5 + 7.5 7.5 7.5 - -10.0 -8.823529411764707 -7.647058823529411 -6.470588235294118 -5.294117647058823 -4.117647058823529 -2.9411764705882355 -1.7647058823529402 -0.5882352941176467 0.5882352941176467 1.764705882352942 2.9411764705882355 4.117647058823529 5.294117647058824 6.4705882352941195 7.647058823529413 8.823529411764707 10.0 - -10.0 -8.823529411764707 -7.647058823529411 -6.470588235294118 -5.294117647058823 -4.117647058823529 -2.9411764705882355 -1.7647058823529402 -0.5882352941176467 0.5882352941176467 1.764705882352942 2.9411764705882355 4.117647058823529 5.294117647058824 6.4705882352941195 7.647058823529413 8.823529411764707 10.0 - 1.0 1.683624003879018 2.8345897864376153 4.772383405596668 8.034899257376447 13.52774925846868 22.77564337001445 38.34561988154435 64.55960607618856 108.69410247084474 182.99999999999991 + -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 1 @@ -77,35 +77,35 @@ 4 - + 1 total - + 5 current - + 2 total - + 6 current - + 3 total - + 7 current - + 4 total - + 8 current diff --git a/tests/regression_tests/filter_mesh/results_true.dat b/tests/regression_tests/filter_mesh/results_true.dat index 55653d1a57..10ea99f646 100644 --- a/tests/regression_tests/filter_mesh/results_true.dat +++ b/tests/regression_tests/filter_mesh/results_true.dat @@ -1 +1 @@ -2bc8fce4a61bc431e90c44400ac626e7043144b575eeb5ca66b8c4fefb9bed076b20663d096801dca63085f090a96e662f12b6281c85c3ba8ce73efbc55356ba \ No newline at end of file +c3560155c2f713e5e2ad84451ddcd40484942faf94e2829db77df9b648ea880b3fba35c2a80dd1502e1ba62843e19e746638b2fe4961bde4ded3ce98624a2447 \ No newline at end of file diff --git a/tests/regression_tests/filter_mesh/test.py b/tests/regression_tests/filter_mesh/test.py index e68c5f0e16..c8aa871a83 100644 --- a/tests/regression_tests/filter_mesh/test.py +++ b/tests/regression_tests/filter_mesh/test.py @@ -30,77 +30,51 @@ def model(): model.settings.inactive = 0 model.settings.particles = 1000 - # Initialize Meshes + # Create meshes mesh_1d = openmc.RegularMesh() - mesh_1d.dimension = [17] - mesh_1d.lower_left = [-10.0] - mesh_1d.upper_right = [10.0] + mesh_1d.dimension = [5] + mesh_1d.lower_left = [-7.5] + mesh_1d.upper_right = [7.5] mesh_2d = openmc.RegularMesh() - mesh_2d.dimension = [17, 17] - mesh_2d.lower_left = [-10.0, -10.0] - mesh_2d.upper_right = [10.0, 10.0] + mesh_2d.dimension = [5, 5] + mesh_2d.lower_left = [-7.5, -7.5] + mesh_2d.upper_right = [7.5, 7.5] mesh_3d = openmc.RegularMesh() - mesh_3d.dimension = [17, 17, 17] - mesh_3d.lower_left = [-10.0, -10.0, -183.00] - mesh_3d.upper_right = [10.0, 10.0, 183.00] + mesh_3d.dimension = [5, 5, 5] + mesh_3d.lower_left = [-7.5, -7.5, -7.5] + mesh_3d.upper_right = [7.5, 7.5, 7.5] recti_mesh = openmc.RectilinearMesh() - recti_mesh.x_grid = np.linspace(-10.0, 10.0, 18) - recti_mesh.y_grid = np.linspace(-10.0, 10.0, 18) - recti_mesh.z_grid = np.logspace(0, np.log10(183), 11) + recti_mesh.x_grid = np.linspace(-7.5, 7.5, 18) + recti_mesh.y_grid = np.linspace(-7.5, 7.5, 18) + recti_mesh.z_grid = np.logspace(0, np.log10(7.5), 11) - # Initialize the filters - mesh_1d_filter = openmc.MeshFilter(mesh_1d) - mesh_2d_filter = openmc.MeshFilter(mesh_2d) - mesh_3d_filter = openmc.MeshFilter(mesh_3d) - recti_mesh_filter = openmc.MeshFilter(recti_mesh) - meshsurf_1d_filter = openmc.MeshSurfaceFilter(mesh_1d) - meshsurf_2d_filter = openmc.MeshSurfaceFilter(mesh_2d) - meshsurf_3d_filter = openmc.MeshSurfaceFilter(mesh_3d) - recti_meshsurf_filter = openmc.MeshSurfaceFilter(recti_mesh) + # Create filters + reg_filters = [ + openmc.MeshFilter(mesh_1d), + openmc.MeshFilter(mesh_2d), + openmc.MeshFilter(mesh_3d), + openmc.MeshFilter(recti_mesh) + ] + surf_filters = [ + openmc.MeshSurfaceFilter(mesh_1d), + openmc.MeshSurfaceFilter(mesh_2d), + openmc.MeshSurfaceFilter(mesh_3d), + openmc.MeshSurfaceFilter(recti_mesh) + ] - # Initialized the tallies - tally = openmc.Tally(name='tally 1') - tally.filters = [mesh_1d_filter] - tally.scores = ['total'] - model.tallies.append(tally) - - tally = openmc.Tally(name='tally 2') - tally.filters = [meshsurf_1d_filter] - tally.scores = ['current'] - model.tallies.append(tally) - - tally = openmc.Tally(name='tally 3') - tally.filters = [mesh_2d_filter] - tally.scores = ['total'] - model.tallies.append(tally) - - tally = openmc.Tally(name='tally 4') - tally.filters = [meshsurf_2d_filter] - tally.scores = ['current'] - model.tallies.append(tally) - - tally = openmc.Tally(name='tally 5') - tally.filters = [mesh_3d_filter] - tally.scores = ['total'] - model.tallies.append(tally) - - tally = openmc.Tally(name='tally 6') - tally.filters = [meshsurf_3d_filter] - tally.scores = ['current'] - model.tallies.append(tally) - - tally = openmc.Tally(name='tally 7') - tally.filters = [recti_mesh_filter] - tally.scores = ['total'] - model.tallies.append(tally) - - tally = openmc.Tally(name='tally 8') - tally.filters = [recti_meshsurf_filter] - tally.scores = ['current'] - model.tallies.append(tally) + # Create tallies + for f1, f2 in zip(reg_filters, surf_filters): + tally = openmc.Tally() + tally.filters = [f1] + tally.scores = ['total'] + model.tallies.append(tally) + tally = openmc.Tally() + tally.filters = [f2] + tally.scores = ['current'] + model.tallies.append(tally) return model