From 1fb29a5148e1fb2f9420c91396b57421d1dead00 Mon Sep 17 00:00:00 2001 From: John Tramm Date: Wed, 21 Oct 2026 14:35:30 +0000 Subject: [PATCH 1/2] Test random ray VTK output against gold files Add VTKTestHarness, a TolerantPyAPITestHarness that keeps one voxel plot and appends the flux and source arrays of the VTK files it writes to the results, and a random_ray_vtk regression test that uses it for eigenvalue and fixed source problems with flat and linear sources. This replaces test_random_ray_vtk_normalization from #4192, which compared the mean of 8 voxels to a source region tally within 15%. Its voxels sit at the centers of the source regions, where the linear term is close to zero, so it still passes with that term removed, and it always runs serially, so it never covers the domain decomposed writer. Co-Authored-By: Claude Opus 5.5 --- .../random_ray_vtk/__init__.py | 0 .../random_ray_vtk/eigen_flat/inputs_true.dat | 119 +++++++ .../eigen_flat/results_true.dat | 307 ++++++++++++++++++ .../eigen_linear/inputs_true.dat | 119 +++++++ .../eigen_linear/results_true.dat | 307 ++++++++++++++++++ .../random_ray_vtk/fs_flat/inputs_true.dat | 254 +++++++++++++++ .../random_ray_vtk/fs_flat/results_true.dat | 65 ++++ .../random_ray_vtk/fs_linear/inputs_true.dat | 254 +++++++++++++++ .../random_ray_vtk/fs_linear/results_true.dat | 65 ++++ tests/regression_tests/random_ray_vtk/test.py | 38 +++ tests/testing_harness.py | 48 +++ .../test_random_ray_vtk_normalization.py | 44 --- 12 files changed, 1576 insertions(+), 44 deletions(-) create mode 100644 tests/regression_tests/random_ray_vtk/__init__.py create mode 100644 tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat create mode 100644 tests/regression_tests/random_ray_vtk/test.py delete mode 100644 tests/unit_tests/test_random_ray_vtk_normalization.py diff --git a/tests/regression_tests/random_ray_vtk/__init__.py b/tests/regression_tests/random_ray_vtk/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat b/tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat new file mode 100644 index 00000000000..2239023714a --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat @@ -0,0 +1,119 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.126 0.126 + 10 10 + -0.63 -0.63 + +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 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 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 + + + 1.26 1.26 + 2 2 + -1.26 -1.26 + +2 2 +2 5 + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + multi-group + + 100.0 + 20.0 + + + + -1.26 -1.26 -1 1.26 1.26 1 + + + + true + flat + + + + + 2 2 + -1.26 -1.26 + 1.26 1.26 + + + 1 + + + 1e-05 0.0635 10.0 100.0 1000.0 500000.0 1000000.0 20000000.0 + + + 1 2 + flux fission nu-fission + analog + + + + + 4 4 1 + 0.0 0.0 0.0 + 2.52 2.2 1.0 + + + diff --git a/tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat b/tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat new file mode 100644 index 00000000000..da4436cdc2c --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat @@ -0,0 +1,307 @@ +k-combined: +8.400321E-01 8.023358E-03 +tally 1: +1.075769E+00 +2.317354E-01 +3.986991E-01 +3.182682E-02 +9.703538E-01 +1.885224E-01 +6.049423E-01 +7.331941E-02 +8.978161E-02 +1.614997E-03 +2.185105E-01 +9.566247E-03 +3.579852E-01 +2.591721E-02 +1.151770E-02 +2.682363E-05 +2.803176E-02 +1.588866E-04 +5.017326E-01 +5.130808E-02 +1.651428E-02 +5.557274E-05 +4.019245E-02 +3.291786E-04 +1.509054E+00 +4.629325E-01 +1.749679E-02 +6.226588E-05 +4.258421E-02 +3.688336E-04 +4.322054E+00 +3.753085E+00 +6.555113E-03 +8.636537E-06 +1.622017E-02 +5.287982E-05 +2.777351E+00 +1.542942E+00 +3.731363E-02 +2.784662E-04 +1.037860E-01 +2.154343E-03 +1.600522E+00 +5.123477E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +7.155116E-01 +1.024445E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.848568E-01 +3.008769E-02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.697160E-01 +6.624996E-02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.576480E+00 +5.046890E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.856827E+00 +2.989000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +2.405807E+00 +1.157889E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.732717E-01 +1.897670E-01 +3.637108E-01 +2.649544E-02 +8.851992E-01 +1.569426E-01 +5.774286E-01 +6.683395E-02 +8.688408E-02 +1.513473E-03 +2.114585E-01 +8.964883E-03 +3.512640E-01 +2.491729E-02 +1.148149E-02 +2.660532E-05 +2.794365E-02 +1.575935E-04 +4.877362E-01 +4.844138E-02 +1.627932E-02 +5.395212E-05 +3.962062E-02 +3.195790E-04 +1.496416E+00 +4.551920E-01 +1.760130E-02 +6.300084E-05 +4.283856E-02 +3.731872E-04 +4.430519E+00 +3.943947E+00 +6.841363E-03 +9.402132E-06 +1.692847E-02 +5.756741E-05 +2.870816E+00 +1.648662E+00 +3.937267E-02 +3.101707E-04 +1.095131E-01 +2.399624E-03 +1.072714E+00 +2.304093E-01 +4.053505E-01 +3.291277E-02 +9.865421E-01 +1.949549E-01 +6.047420E-01 +7.327008E-02 +9.163611E-02 +1.683034E-03 +2.230240E-01 +9.969255E-03 +3.580639E-01 +2.592902E-02 +1.176143E-02 +2.794541E-05 +2.862497E-02 +1.655313E-04 +5.010143E-01 +5.114429E-02 +1.681803E-02 +5.755790E-05 +4.093173E-02 +3.409375E-04 +1.505803E+00 +4.607828E-01 +1.782566E-02 +6.454911E-05 +4.338462E-02 +3.823584E-04 +4.328879E+00 +3.766055E+00 +6.729800E-03 +9.102372E-06 +1.665242E-02 +5.573204E-05 +2.804070E+00 +1.572690E+00 +3.876396E-02 +3.006259E-04 +1.078200E-01 +2.325780E-03 +plot_1.vtk flux_group_0: +5.802574E-01 +5.620922E-01 +5.084293E-01 +4.542389E-01 +5.728958E-01 +5.608438E-01 +4.966197E-01 +4.700310E-01 +5.817339E-01 +5.662200E-01 +5.586776E-01 +5.338203E-01 +5.890010E-01 +6.000881E-01 +5.947546E-01 +5.882424E-01 +plot_1.vtk flux_group_1: +8.891584E-01 +8.642705E-01 +7.814829E-01 +7.448305E-01 +8.839747E-01 +8.714774E-01 +7.918636E-01 +7.651913E-01 +8.922008E-01 +8.804476E-01 +8.579155E-01 +8.382113E-01 +9.027876E-01 +9.078407E-01 +8.971425E-01 +8.908479E-01 +plot_1.vtk flux_group_2: +2.962145E-01 +2.994507E-01 +3.146198E-01 +3.168830E-01 +2.987806E-01 +3.001544E-01 +3.139068E-01 +3.154508E-01 +2.976035E-01 +2.991217E-01 +3.016928E-01 +3.040786E-01 +2.950058E-01 +2.932558E-01 +2.950450E-01 +2.953907E-01 +plot_1.vtk flux_group_3: +9.621146E-02 +1.000295E-01 +1.131394E-01 +1.170321E-01 +9.744872E-02 +9.905551E-02 +1.113888E-01 +1.144262E-01 +9.659316E-02 +9.793349E-02 +1.014585E-01 +1.038290E-01 +9.448402E-02 +9.433462E-02 +9.556211E-02 +9.619231E-02 +plot_1.vtk flux_group_4: +7.057627E-02 +7.189878E-02 +7.673066E-02 +7.862697E-02 +7.051816E-02 +7.113779E-02 +7.562405E-02 +7.718541E-02 +6.993068E-02 +7.032181E-02 +7.199904E-02 +7.318302E-02 +6.958459E-02 +6.976382E-02 +7.024083E-02 +7.044220E-02 +plot_1.vtk flux_group_5: +1.171203E-01 +1.219491E-01 +1.423613E-01 +1.505772E-01 +1.172172E-01 +1.190323E-01 +1.370802E-01 +1.435578E-01 +1.144576E-01 +1.159867E-01 +1.227146E-01 +1.256068E-01 +1.127830E-01 +1.124812E-01 +1.160465E-01 +1.169664E-01 +plot_1.vtk flux_group_6: +1.961498E-01 +2.147346E-01 +3.190501E-01 +3.523289E-01 +1.995774E-01 +2.057829E-01 +2.957683E-01 +3.219029E-01 +1.890466E-01 +1.942874E-01 +2.200056E-01 +2.286240E-01 +1.809729E-01 +1.797306E-01 +1.931987E-01 +1.954639E-01 +plot_1.vtk total_fission_source: +6.196207E-02 +6.634134E-02 +0.000000E+00 +0.000000E+00 +6.269164E-02 +6.413536E-02 +0.000000E+00 +0.000000E+00 +6.022435E-02 +6.140348E-02 +6.755640E-02 +6.954324E-02 +5.834034E-02 +5.812017E-02 +6.132097E-02 +6.185206E-02 diff --git a/tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat b/tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat new file mode 100644 index 00000000000..c292315f452 --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat @@ -0,0 +1,119 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.126 0.126 + 10 10 + -0.63 -0.63 + +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 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 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 + + + 1.26 1.26 + 2 2 + -1.26 -1.26 + +2 2 +2 5 + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + multi-group + + 100.0 + 20.0 + + + + -1.26 -1.26 -1 1.26 1.26 1 + + + + true + linear + + + + + 2 2 + -1.26 -1.26 + 1.26 1.26 + + + 1 + + + 1e-05 0.0635 10.0 100.0 1000.0 500000.0 1000000.0 20000000.0 + + + 1 2 + flux fission nu-fission + analog + + + + + 4 4 1 + 0.0 0.0 0.0 + 2.52 2.2 1.0 + + + diff --git a/tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat b/tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat new file mode 100644 index 00000000000..aace926047e --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat @@ -0,0 +1,307 @@ +k-combined: +8.400320E-01 8.023349E-03 +tally 1: +1.075769E+00 +2.317354E-01 +3.986990E-01 +3.182680E-02 +9.703535E-01 +1.885223E-01 +6.049423E-01 +7.331940E-02 +8.978159E-02 +1.614997E-03 +2.185104E-01 +9.566243E-03 +3.579852E-01 +2.591721E-02 +1.151769E-02 +2.682362E-05 +2.803176E-02 +1.588865E-04 +5.017324E-01 +5.130805E-02 +1.651427E-02 +5.557269E-05 +4.019243E-02 +3.291783E-04 +1.509053E+00 +4.629322E-01 +1.749678E-02 +6.226583E-05 +4.258419E-02 +3.688333E-04 +4.322055E+00 +3.753087E+00 +6.555116E-03 +8.636545E-06 +1.622017E-02 +5.287987E-05 +2.777352E+00 +1.542944E+00 +3.731368E-02 +2.784670E-04 +1.037861E-01 +2.154349E-03 +1.600522E+00 +5.123478E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +7.155116E-01 +1.024445E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.848567E-01 +3.008768E-02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.697159E-01 +6.624994E-02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.576479E+00 +5.046889E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.856827E+00 +2.988999E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +2.405806E+00 +1.157888E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.732717E-01 +1.897671E-01 +3.637107E-01 +2.649543E-02 +8.851990E-01 +1.569425E-01 +5.774286E-01 +6.683395E-02 +8.688407E-02 +1.513473E-03 +2.114584E-01 +8.964879E-03 +3.512639E-01 +2.491728E-02 +1.148149E-02 +2.660531E-05 +2.794365E-02 +1.575934E-04 +4.877361E-01 +4.844135E-02 +1.627932E-02 +5.395207E-05 +3.962060E-02 +3.195787E-04 +1.496416E+00 +4.551917E-01 +1.760129E-02 +6.300079E-05 +4.283854E-02 +3.731869E-04 +4.430520E+00 +3.943948E+00 +6.841366E-03 +9.402140E-06 +1.692848E-02 +5.756746E-05 +2.870817E+00 +1.648663E+00 +3.937272E-02 +3.101715E-04 +1.095132E-01 +2.399630E-03 +1.072714E+00 +2.304093E-01 +4.053504E-01 +3.291275E-02 +9.865418E-01 +1.949548E-01 +6.047420E-01 +7.327007E-02 +9.163609E-02 +1.683033E-03 +2.230239E-01 +9.969251E-03 +3.580639E-01 +2.592902E-02 +1.176143E-02 +2.794540E-05 +2.862497E-02 +1.655312E-04 +5.010141E-01 +5.114426E-02 +1.681802E-02 +5.755785E-05 +4.093171E-02 +3.409371E-04 +1.505803E+00 +4.607826E-01 +1.782565E-02 +6.454906E-05 +4.338461E-02 +3.823581E-04 +4.328880E+00 +3.766057E+00 +6.729803E-03 +9.102380E-06 +1.665243E-02 +5.573209E-05 +2.804071E+00 +1.572692E+00 +3.876401E-02 +3.006267E-04 +1.078201E-01 +2.325787E-03 +plot_1.vtk flux_group_0: +5.913968E-01 +5.655076E-01 +5.054761E-01 +4.547202E-01 +5.560177E-01 +5.253906E-01 +5.039180E-01 +4.599082E-01 +5.650086E-01 +5.454949E-01 +5.938777E-01 +4.950333E-01 +5.767801E-01 +5.895635E-01 +5.976521E-01 +5.790217E-01 +plot_1.vtk flux_group_1: +9.049953E-01 +8.690675E-01 +7.764124E-01 +7.457448E-01 +8.537971E-01 +8.168949E-01 +8.008285E-01 +7.449510E-01 +8.582825E-01 +8.449662E-01 +9.009476E-01 +7.759950E-01 +8.857030E-01 +8.908483E-01 +9.036063E-01 +8.784709E-01 +plot_1.vtk flux_group_2: +3.015214E-01 +2.985554E-01 +3.126871E-01 +3.173026E-01 +2.865493E-01 +2.804492E-01 +3.146558E-01 +3.040486E-01 +2.822656E-01 +2.853286E-01 +3.063065E-01 +2.785592E-01 +2.883418E-01 +2.865253E-01 +2.968893E-01 +2.908738E-01 +plot_1.vtk flux_group_3: +9.789382E-02 +9.922253E-02 +1.124658E-01 +1.171890E-01 +9.319568E-02 +9.259259E-02 +1.112438E-01 +1.096737E-01 +9.091120E-02 +9.333029E-02 +1.013252E-01 +9.447083E-02 +9.217139E-02 +9.193920E-02 +9.604286E-02 +9.450553E-02 +plot_1.vtk flux_group_4: +7.172417E-02 +7.155283E-02 +7.625679E-02 +7.872836E-02 +6.790056E-02 +6.663927E-02 +7.574182E-02 +7.402778E-02 +6.630673E-02 +6.719442E-02 +7.302820E-02 +6.698837E-02 +6.803419E-02 +6.820158E-02 +7.070771E-02 +6.929316E-02 +plot_1.vtk flux_group_5: +1.187884E-01 +1.209036E-01 +1.415119E-01 +1.509417E-01 +1.129955E-01 +1.121474E-01 +1.371764E-01 +1.373640E-01 +1.074332E-01 +1.108014E-01 +1.231136E-01 +1.142680E-01 +1.096633E-01 +1.097596E-01 +1.165954E-01 +1.147864E-01 +plot_1.vtk flux_group_6: +1.990916E-01 +2.110707E-01 +3.172397E-01 +3.532411E-01 +1.920712E-01 +1.944036E-01 +2.946426E-01 +3.066421E-01 +1.765754E-01 +1.855224E-01 +2.147589E-01 +2.047948E-01 +1.750501E-01 +1.745509E-01 +1.936321E-01 +1.915593E-01 +plot_1.vtk total_fission_source: +6.291527E-02 +6.546475E-02 +0.000000E+00 +0.000000E+00 +6.036877E-02 +6.047803E-02 +0.000000E+00 +0.000000E+00 +5.652983E-02 +5.867095E-02 +6.679097E-02 +6.267510E-02 +5.658627E-02 +5.656980E-02 +6.151551E-02 +6.067005E-02 diff --git a/tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat b/tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat new file mode 100644 index 00000000000..ef538d0d4b7 --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat @@ -0,0 +1,254 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + 2.5 2.5 2.5 + 12 12 12 + 0.0 0.0 0.0 + +3 3 3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +1 1 2 2 2 2 2 2 2 2 3 3 +1 1 2 2 2 2 2 2 2 2 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 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2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 +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 3 3 3 3 3 3 3 3 3 + + + + + + + + + + fixed source + 90 + 10 + 5 + + + 100.0 1.0 + + + universe + 1 + + + multi-group + + 500.0 + 100.0 + + + + 0.0 0.0 0.0 30.0 30.0 30.0 + + + + true + flat + + + + + 1 + + + 2 + + + 3 + + + 3 + flux + tracklength + + + 2 + flux + tracklength + + + 1 + flux + tracklength + + + + + 3 3 3 + 12.75 12.75 12.75 + 24.9 24.9 24.9 + + + diff --git a/tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat b/tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat new file mode 100644 index 00000000000..2c0d5be7225 --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat @@ -0,0 +1,65 @@ +tally 1: +5.934433E-01 +7.058828E-02 +tally 2: +3.205919E-02 +2.062653E-04 +tally 3: +2.096403E-03 +8.804872E-07 +plot_1.vtk flux_group_0: +7.729167E-02 +1.298820E-02 +7.877887E-03 +4.527351E-03 +7.431023E-03 +1.062695E-03 +1.271663E-03 +5.745279E-03 +3.190734E-04 +4.788767E-03 +8.744352E-03 +6.967466E-03 +6.957604E-03 +8.617753E-03 +2.008850E-03 +1.447357E-04 +5.397863E-03 +2.951601E-04 +9.207320E-03 +9.325794E-04 +1.661248E-03 +1.968164E-03 +8.922952E-03 +1.356149E-02 +6.308875E-03 +7.355642E-04 +3.572953E-03 +plot_1.vtk external_source: +3.140000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 diff --git a/tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat b/tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat new file mode 100644 index 00000000000..ac4ad1ad964 --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat @@ -0,0 +1,254 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + 2.5 2.5 2.5 + 12 12 12 + 0.0 0.0 0.0 + +3 3 3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +1 1 2 2 2 2 2 2 2 2 3 3 +1 1 2 2 2 2 2 2 2 2 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 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +1 1 2 2 2 2 2 2 2 2 3 3 +1 1 2 2 2 2 2 2 2 2 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 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 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 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 3 3 +2 2 2 2 2 2 2 2 2 2 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 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 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 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 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 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 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 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 3 3 + + + + + + + + + + fixed source + 90 + 10 + 5 + + + 100.0 1.0 + + + universe + 1 + + + multi-group + + 500.0 + 100.0 + + + + 0.0 0.0 0.0 30.0 30.0 30.0 + + + + true + linear + + + + + 1 + + + 2 + + + 3 + + + 3 + flux + tracklength + + + 2 + flux + tracklength + + + 1 + flux + tracklength + + + + + 3 3 3 + 12.75 12.75 12.75 + 24.9 24.9 24.9 + + + diff --git a/tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat b/tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat new file mode 100644 index 00000000000..c1cc0fac88d --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat @@ -0,0 +1,65 @@ +tally 1: +5.993658E-01 +7.200175E-02 +tally 2: +3.205919E-02 +2.062652E-04 +tally 3: +2.096403E-03 +8.804872E-07 +plot_1.vtk flux_group_0: +5.489871E-02 +2.379240E-02 +7.877886E-03 +2.677029E-03 +1.789258E-02 +3.797880E-04 +8.056443E-05 +4.037824E-03 +8.067211E-05 +6.229131E-03 +4.903862E-03 +6.967458E-03 +1.197564E-03 +5.637538E-03 +9.136149E-04 +1.454110E-04 +5.397870E-03 +4.470478E-04 +1.091852E-02 +1.560840E-03 +1.661248E-03 +5.901166E-03 +3.684082E-03 +1.203939E-02 +6.173793E-03 +1.314195E-04 +4.132313E-03 +plot_1.vtk external_source: +3.140000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 diff --git a/tests/regression_tests/random_ray_vtk/test.py b/tests/regression_tests/random_ray_vtk/test.py new file mode 100644 index 00000000000..7024efe0b3a --- /dev/null +++ b/tests/regression_tests/random_ray_vtk/test.py @@ -0,0 +1,38 @@ +import os + +import openmc +from openmc.examples import random_ray_lattice, random_ray_three_region_cube +from openmc.utility_funcs import change_directory +import pytest + +from tests.testing_harness import VTKTestHarness + + +class MGXSTestHarness(VTKTestHarness): + def _cleanup(self): + super()._cleanup() + f = 'mgxs.h5' + if os.path.exists(f): + os.remove(f) + + +@pytest.mark.parametrize("shape", ["flat", "linear"]) +@pytest.mark.parametrize("run_mode", ["eigen", "fs"]) +def test_random_ray_vtk(run_mode, shape): + with change_directory(f'{run_mode}_{shape}'): + openmc.reset_auto_ids() + plot = openmc.VoxelPlot() + if run_mode == 'eigen': + model = random_ray_lattice() + # Voxel centers off the azimuthal planes and rings of the pins + plot.width = (2.52, 2.2, 1.0) + plot.pixels = (4, 4, 1) + else: + model = random_ray_three_region_cube() + # Voxel centers off the 2.5 cm lattice planes + plot.origin = (12.75, 12.75, 12.75) + plot.width = (24.9, 24.9, 24.9) + plot.pixels = (3, 3, 3) + model.settings.random_ray['source_shape'] = shape + harness = MGXSTestHarness('statepoint.10.h5', model, plot) + harness.main() diff --git a/tests/testing_harness.py b/tests/testing_harness.py index 40c436b55a5..ece3e68b5f3 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -30,6 +30,21 @@ def colorize(diff): yield line +def read_vtk_arrays(path): + """Read the point data arrays from a legacy binary VTK file.""" + arrays = {} + with open(path, 'rb') as fh: + while line := fh.readline(): + if line.startswith(b'POINT_DATA'): + n = int(line.split()[1]) + elif line.startswith(b'SCALARS'): + _, name, dtype = line.decode().split() + fh.readline() # LOOKUP_TABLE default + dtype = {'float': '>f4', 'int': '>i4'}[dtype] + arrays[name] = np.frombuffer(fh.read(4*n), dtype) + return arrays + + class TestHarness: """General class for running OpenMC regression tests.""" @@ -455,6 +470,39 @@ def _compare_results(self): assert compare, 'Results do not agree' +class VTKTestHarness(TolerantPyAPITestHarness): + """Specialized harness for random ray tests that also check the flux and + source written to VTK files for a voxel plot. + + """ + + def __init__(self, statepoint_name, model, plot): + super().__init__(statepoint_name, model) + # The base class removes all plots, so add back the one being tested + self._model.plots = [plot] + + def _get_results(self): + """Digest the statepoint and VTK files and return as a string.""" + outstr = super()._get_results() + # Adjoint runs also write the forward solve, to a .forward.vtk file + for vtk_file in sorted(glob.glob('*.vtk')): + for name, values in read_vtk_arrays(vtk_file).items(): + # Compare the flux and source fields; the other arrays (FSR + # and rank colors, materials, loads, weight windows) are + # visualization aids + if name.startswith('flux_group_') or name in ( + 'total_fission_source', 'external_source'): + outstr += f'{vtk_file} {name}:\n' + outstr += ''.join(f'{x:12.6E}\n' for x in values) + return outstr + + def _cleanup(self): + """Delete the VTK files.""" + super()._cleanup() + for f in glob.glob('*.vtk'): + os.remove(f) + + class WeightWindowPyAPITestHarness(PyAPITestHarness): def _get_results(self): """Digest info in the weight window file and return as a string.""" diff --git a/tests/unit_tests/test_random_ray_vtk_normalization.py b/tests/unit_tests/test_random_ray_vtk_normalization.py deleted file mode 100644 index b6fa527bdc3..00000000000 --- a/tests/unit_tests/test_random_ray_vtk_normalization.py +++ /dev/null @@ -1,44 +0,0 @@ -import math -import struct - -import openmc -from openmc.examples import random_ray_three_region_cube -from tests.regression_tests import config - - -def _read_vtk_flux(path, group, count): - with open(path, 'rb') as fh: - data = fh.read() - - marker = (f'SCALARS flux_group_{group} float\n' - 'LOOKUP_TABLE default\n').encode() - start = data.index(marker) + len(marker) - end = start + count * struct.calcsize('>f') - return struct.unpack(f'>{count}f', data[start:end]) - - -def test_random_ray_vtk_normalization(run_in_tmpdir): - openmc.reset_auto_ids() - model = random_ray_three_region_cube() - model.settings.random_ray['source_shape'] = 'linear' - model.settings.inactive = 5 - model.settings.batches = 10 - - plot = openmc.VoxelPlot() - plot.filename = 'random_ray_vtk_normalization.h5' - plot.origin = (2.5, 2.5, 2.5) - plot.width = (5.0, 5.0, 5.0) - plot.pixels = (2, 2, 2) - model.plots = [plot] - - model.run(openmc_exec=config['exe']) - - with openmc.StatePoint('statepoint.10.h5') as statepoint: - source_tally = statepoint.get_tally(name='Source Tally') - tally_flux = source_tally.mean.ravel()[0] - - vtk_flux = _read_vtk_flux( - 'random_ray_vtk_normalization.vtk', group=0, count=8) - plot_flux = sum(vtk_flux) / len(vtk_flux) - - assert math.isclose(plot_flux, tally_flux, rel_tol=0.15) From 0f159cab4a55b66dcafd27c41c3fccda3a6c08fe Mon Sep 17 00:00:00 2001 From: John Tramm Date: Wed, 21 Oct 2026 15:46:55 +0000 Subject: [PATCH 2/2] Run the random_ray_vtk cases with active source gradients The linear source keeps its gradients at zero for the first ten batches, so with the examples' 5 inactive + 5 active batches the linear cases compared the moments of a flat source solve. Run 10 inactive + 5 active batches instead, so that every active batch uses the gradients, and regenerate the reference results. Also say why the other VTK arrays are not compared, and list the harness in AGENTS.md. Co-Authored-By: Claude Fable 5.1 --- AGENTS.md | 1 + .../random_ray_vtk/eigen_flat/inputs_true.dat | 4 +- .../eigen_flat/results_true.dat | 586 +++++++++--------- .../eigen_linear/inputs_true.dat | 4 +- .../eigen_linear/results_true.dat | 586 +++++++++--------- .../random_ray_vtk/fs_flat/inputs_true.dat | 4 +- .../random_ray_vtk/fs_flat/results_true.dat | 66 +- .../random_ray_vtk/fs_linear/inputs_true.dat | 4 +- .../random_ray_vtk/fs_linear/results_true.dat | 66 +- tests/regression_tests/random_ray_vtk/test.py | 6 +- tests/testing_harness.py | 7 +- 11 files changed, 670 insertions(+), 664 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6ffb24a85f8..d663c09e579 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -213,6 +213,7 @@ Regression tests compare OpenMC output against reference data. **Prefer using ex - **PyAPITestHarness**: Standard harness for Python API tests. Compares `inputs_true.dat` (XML hash) and `results_true.dat` (statepoint k-eff and tally values). Requires `model.xml` generation. - **HashedPyAPITestHarness**: Like PyAPITestHarness but hashes the results for compact comparison - **TolerantPyAPITestHarness**: For tests with floating-point non-associativity (e.g., random ray solver with single precision). Uses relative tolerance comparisons. +- **VTKTestHarness**: Like TolerantPyAPITestHarness but keeps one voxel plot and also compares the flux and source arrays of the random ray VTK files - **WeightWindowPyAPITestHarness**: Compares weight window bounds from `weight_windows.h5` - **CollisionTrackTestHarness**: Compares collision track data from `collision_track.h5` against `collision_track_true.h5` - **TestHarness**: Base harness for XML-based tests (no Python model building) diff --git a/tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat b/tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat index 2239023714a..aa0a03f11e3 100644 --- a/tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat +++ b/tests/regression_tests/random_ray_vtk/eigen_flat/inputs_true.dat @@ -74,8 +74,8 @@ eigenvalue 100 - 10 - 5 + 15 + 10 multi-group 100.0 diff --git a/tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat b/tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat index da4436cdc2c..806a63f8f24 100644 --- a/tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat +++ b/tests/regression_tests/random_ray_vtk/eigen_flat/results_true.dat @@ -1,307 +1,307 @@ k-combined: -8.400321E-01 8.023358E-03 +8.385858E-01 7.961547E-03 tally 1: -1.075769E+00 -2.317354E-01 -3.986991E-01 -3.182682E-02 -9.703538E-01 -1.885224E-01 -6.049423E-01 -7.331941E-02 -8.978161E-02 -1.614997E-03 -2.185105E-01 -9.566247E-03 -3.579852E-01 -2.591721E-02 -1.151770E-02 -2.682363E-05 -2.803176E-02 -1.588866E-04 -5.017326E-01 -5.130808E-02 -1.651428E-02 -5.557274E-05 -4.019245E-02 -3.291786E-04 -1.509054E+00 -4.629325E-01 -1.749679E-02 -6.226588E-05 -4.258421E-02 -3.688336E-04 -4.322054E+00 -3.753085E+00 -6.555113E-03 -8.636537E-06 -1.622017E-02 -5.287982E-05 -2.777351E+00 -1.542942E+00 -3.731363E-02 -2.784662E-04 -1.037860E-01 -2.154343E-03 -1.600522E+00 -5.123477E-01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -7.155116E-01 -1.024445E-01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.848568E-01 -3.008769E-02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.697160E-01 -6.624996E-02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.576480E+00 -5.046890E-01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.856827E+00 -2.989000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -2.405807E+00 -1.157889E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.732717E-01 -1.897670E-01 -3.637108E-01 -2.649544E-02 -8.851992E-01 -1.569426E-01 -5.774286E-01 -6.683395E-02 -8.688408E-02 -1.513473E-03 -2.114585E-01 -8.964883E-03 -3.512640E-01 -2.491729E-02 -1.148149E-02 -2.660532E-05 -2.794365E-02 -1.575935E-04 -4.877362E-01 -4.844138E-02 -1.627932E-02 -5.395212E-05 -3.962062E-02 -3.195790E-04 -1.496416E+00 -4.551920E-01 -1.760130E-02 -6.300084E-05 -4.283856E-02 -3.731872E-04 -4.430519E+00 -3.943947E+00 -6.841363E-03 -9.402132E-06 -1.692847E-02 -5.756741E-05 -2.870816E+00 -1.648662E+00 -3.937267E-02 -3.101707E-04 -1.095131E-01 -2.399624E-03 -1.072714E+00 -2.304093E-01 -4.053505E-01 -3.291277E-02 -9.865421E-01 -1.949549E-01 -6.047420E-01 -7.327008E-02 -9.163611E-02 -1.683034E-03 -2.230240E-01 -9.969255E-03 -3.580639E-01 -2.592902E-02 -1.176143E-02 -2.794541E-05 -2.862497E-02 -1.655313E-04 -5.010143E-01 -5.114429E-02 -1.681803E-02 -5.755790E-05 -4.093173E-02 -3.409375E-04 -1.505803E+00 -4.607828E-01 -1.782566E-02 -6.454911E-05 -4.338462E-02 -3.823584E-04 -4.328879E+00 -3.766055E+00 -6.729800E-03 -9.102372E-06 -1.665242E-02 -5.573204E-05 -2.804070E+00 -1.572690E+00 -3.876396E-02 -3.006259E-04 -1.078200E-01 -2.325780E-03 +9.997473E-01 +1.999080E-01 +3.647422E-01 +2.660938E-02 +8.877096E-01 +1.576175E-01 +6.596313E-01 +8.733599E-02 +9.645251E-02 +1.866649E-03 +2.347461E-01 +1.105687E-02 +5.265210E-01 +5.588004E-02 +1.678151E-02 +5.674313E-05 +4.084283E-02 +3.361112E-04 +7.255342E-01 +1.058319E-01 +2.372143E-02 +1.130924E-04 +5.773322E-02 +6.698897E-04 +2.034631E+00 +8.302433E-01 +2.353203E-02 +1.110302E-04 +5.727296E-02 +6.576904E-04 +5.001687E+00 +5.005258E+00 +7.579105E-03 +1.149177E-05 +1.875397E-02 +7.036183E-05 +2.834778E+00 +1.607414E+00 +3.834521E-02 +2.941615E-04 +1.066553E-01 +2.275769E-03 +1.611723E+00 +5.196217E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +8.194565E-01 +1.347809E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.714128E-01 +6.575095E-02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +8.153101E-01 +1.335408E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +2.091192E+00 +8.767382E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.453434E+00 +3.968333E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +2.431845E+00 +1.183113E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +8.905758E-01 +1.586353E-01 +3.331207E-01 +2.220078E-02 +8.107490E-01 +1.315037E-01 +6.268509E-01 +7.885079E-02 +9.396812E-02 +1.771993E-03 +2.286996E-01 +1.049619E-02 +5.173457E-01 +5.394832E-02 +1.688778E-02 +5.749804E-05 +4.110147E-02 +3.405828E-04 +7.124040E-01 +1.020387E-01 +2.388444E-02 +1.147159E-04 +5.812995E-02 +6.795059E-04 +2.032381E+00 +8.284515E-01 +2.403817E-02 +1.159107E-04 +5.850482E-02 +6.866001E-04 +5.067094E+00 +5.137271E+00 +7.796326E-03 +1.216304E-05 +1.929146E-02 +7.447189E-05 +2.841004E+00 +1.614651E+00 +3.867346E-02 +2.993412E-04 +1.075683E-01 +2.315842E-03 +1.015547E+00 +2.062759E-01 +3.838848E-01 +2.947687E-02 +9.342987E-01 +1.746028E-01 +6.672749E-01 +8.936443E-02 +1.006583E-01 +2.034231E-03 +2.449822E-01 +1.204953E-02 +5.291946E-01 +5.643268E-02 +1.734659E-02 +6.066244E-05 +4.221813E-02 +3.593267E-04 +7.290085E-01 +1.068312E-01 +2.454848E-02 +1.212049E-04 +5.974609E-02 +7.179431E-04 +2.036377E+00 +8.317006E-01 +2.418100E-02 +1.173001E-04 +5.885242E-02 +6.948306E-04 +4.962731E+00 +4.927955E+00 +7.669319E-03 +1.176788E-05 +1.897719E-02 +7.205244E-05 +2.786561E+00 +1.553086E+00 +3.814412E-02 +2.910337E-04 +1.060959E-01 +2.251570E-03 plot_1.vtk flux_group_0: -5.802574E-01 -5.620922E-01 -5.084293E-01 -4.542389E-01 -5.728958E-01 -5.608438E-01 -4.966197E-01 -4.700310E-01 -5.817339E-01 -5.662200E-01 -5.586776E-01 -5.338203E-01 -5.890010E-01 -6.000881E-01 -5.947546E-01 -5.882424E-01 +6.047841E-01 +5.711319E-01 +4.951928E-01 +4.590153E-01 +5.740759E-01 +5.561564E-01 +4.807656E-01 +4.824558E-01 +5.537308E-01 +5.480924E-01 +5.269392E-01 +5.310346E-01 +5.827065E-01 +5.973359E-01 +5.721900E-01 +5.726148E-01 plot_1.vtk flux_group_1: -8.891584E-01 -8.642705E-01 -7.814829E-01 -7.448305E-01 -8.839747E-01 -8.714774E-01 -7.918636E-01 -7.651913E-01 -8.922008E-01 -8.804476E-01 -8.579155E-01 -8.382113E-01 -9.027876E-01 -9.078407E-01 -8.971425E-01 -8.908479E-01 +1.038274E+00 +1.001371E+00 +8.932310E-01 +8.592597E-01 +1.014427E+00 +9.978791E-01 +8.974706E-01 +8.882848E-01 +1.005788E+00 +9.980367E-01 +9.658100E-01 +9.644631E-01 +1.033631E+00 +1.037318E+00 +1.016194E+00 +1.013432E+00 plot_1.vtk flux_group_2: -2.962145E-01 -2.994507E-01 -3.146198E-01 -3.168830E-01 -2.987806E-01 -3.001544E-01 -3.139068E-01 -3.154508E-01 -2.976035E-01 -2.991217E-01 -3.016928E-01 -3.040786E-01 -2.950058E-01 -2.932558E-01 -2.950450E-01 -2.953907E-01 +4.011087E-01 +4.046554E-01 +4.185627E-01 +4.192794E-01 +4.057611E-01 +4.070032E-01 +4.190576E-01 +4.184709E-01 +4.070420E-01 +4.075695E-01 +4.095736E-01 +4.090147E-01 +4.023955E-01 +4.013609E-01 +4.036887E-01 +4.033708E-01 plot_1.vtk flux_group_3: -9.621146E-02 -1.000295E-01 -1.131394E-01 -1.170321E-01 -9.744872E-02 -9.905551E-02 -1.113888E-01 -1.144262E-01 -9.659316E-02 -9.793349E-02 -1.014585E-01 -1.038290E-01 -9.448402E-02 -9.433462E-02 -9.556211E-02 -9.619231E-02 +1.387600E-01 +1.443710E-01 +1.629735E-01 +1.672593E-01 +1.424673E-01 +1.447999E-01 +1.620244E-01 +1.634913E-01 +1.430857E-01 +1.444860E-01 +1.497037E-01 +1.500004E-01 +1.381710E-01 +1.383021E-01 +1.410722E-01 +1.416524E-01 plot_1.vtk flux_group_4: -7.057627E-02 -7.189878E-02 -7.673066E-02 -7.862697E-02 -7.051816E-02 -7.113779E-02 -7.562405E-02 -7.718541E-02 -6.993068E-02 -7.032181E-02 -7.199904E-02 -7.318302E-02 -6.958459E-02 -6.976382E-02 -7.024083E-02 -7.044220E-02 +1.030079E-01 +1.056793E-01 +1.141604E-01 +1.170721E-01 +1.040339E-01 +1.052448E-01 +1.130806E-01 +1.144893E-01 +1.038706E-01 +1.045272E-01 +1.077177E-01 +1.080884E-01 +1.021949E-01 +1.021573E-01 +1.042055E-01 +1.046197E-01 plot_1.vtk flux_group_5: -1.171203E-01 -1.219491E-01 -1.423613E-01 -1.505772E-01 -1.172172E-01 -1.190323E-01 -1.370802E-01 -1.435578E-01 -1.144576E-01 -1.159867E-01 -1.227146E-01 -1.256068E-01 -1.127830E-01 -1.124812E-01 -1.160465E-01 -1.169664E-01 +1.253927E-01 +1.329089E-01 +1.632254E-01 +1.749505E-01 +1.277737E-01 +1.309657E-01 +1.572222E-01 +1.647295E-01 +1.257295E-01 +1.277221E-01 +1.384313E-01 +1.400886E-01 +1.214211E-01 +1.218412E-01 +1.281489E-01 +1.294892E-01 plot_1.vtk flux_group_6: -1.961498E-01 -2.147346E-01 -3.190501E-01 -3.523289E-01 -1.995774E-01 -2.057829E-01 -2.957683E-01 -3.219029E-01 -1.890466E-01 -1.942874E-01 -2.200056E-01 -2.286240E-01 -1.809729E-01 -1.797306E-01 -1.931987E-01 -1.954639E-01 +1.785199E-01 +2.003826E-01 +3.198731E-01 +3.642592E-01 +1.850330E-01 +1.936853E-01 +2.944633E-01 +3.248951E-01 +1.762112E-01 +1.817605E-01 +2.155434E-01 +2.207258E-01 +1.637172E-01 +1.660025E-01 +1.839652E-01 +1.880769E-01 plot_1.vtk total_fission_source: -6.196207E-02 -6.634134E-02 +6.118426E-02 +6.643250E-02 0.000000E+00 0.000000E+00 -6.269164E-02 -6.413536E-02 +6.266493E-02 +6.472900E-02 0.000000E+00 0.000000E+00 -6.022435E-02 -6.140348E-02 -6.755640E-02 -6.954324E-02 -5.834034E-02 -5.812017E-02 -6.132097E-02 -6.185206E-02 +6.045268E-02 +6.181088E-02 +6.998502E-02 +7.127898E-02 +5.747691E-02 +5.810902E-02 +6.241708E-02 +6.343340E-02 diff --git a/tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat b/tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat index c292315f452..608ff1bc6cf 100644 --- a/tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat +++ b/tests/regression_tests/random_ray_vtk/eigen_linear/inputs_true.dat @@ -74,8 +74,8 @@ eigenvalue 100 - 10 - 5 + 15 + 10 multi-group 100.0 diff --git a/tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat b/tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat index aace926047e..1a20c887823 100644 --- a/tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat +++ b/tests/regression_tests/random_ray_vtk/eigen_linear/results_true.dat @@ -1,307 +1,307 @@ k-combined: -8.400320E-01 8.023349E-03 +8.362993E-01 7.089862E-03 tally 1: -1.075769E+00 -2.317354E-01 -3.986990E-01 -3.182680E-02 -9.703535E-01 -1.885223E-01 -6.049423E-01 -7.331940E-02 -8.978159E-02 -1.614997E-03 -2.185104E-01 -9.566243E-03 -3.579852E-01 -2.591721E-02 -1.151769E-02 -2.682362E-05 -2.803176E-02 -1.588865E-04 -5.017324E-01 -5.130805E-02 -1.651427E-02 -5.557269E-05 -4.019243E-02 -3.291783E-04 -1.509053E+00 -4.629322E-01 -1.749678E-02 -6.226583E-05 -4.258419E-02 -3.688333E-04 -4.322055E+00 -3.753087E+00 -6.555116E-03 -8.636545E-06 -1.622017E-02 -5.287987E-05 -2.777352E+00 -1.542944E+00 -3.731368E-02 -2.784670E-04 -1.037861E-01 -2.154349E-03 -1.600522E+00 -5.123478E-01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -7.155116E-01 -1.024445E-01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.848567E-01 -3.008768E-02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.697159E-01 -6.624994E-02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.576479E+00 -5.046889E-01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.856827E+00 -2.988999E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -2.405806E+00 -1.157888E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.732717E-01 -1.897671E-01 -3.637107E-01 -2.649543E-02 -8.851990E-01 -1.569425E-01 -5.774286E-01 -6.683395E-02 -8.688407E-02 -1.513473E-03 -2.114584E-01 -8.964879E-03 -3.512639E-01 -2.491728E-02 -1.148149E-02 -2.660531E-05 -2.794365E-02 -1.575934E-04 -4.877361E-01 -4.844135E-02 -1.627932E-02 -5.395207E-05 -3.962060E-02 -3.195787E-04 -1.496416E+00 -4.551917E-01 -1.760129E-02 -6.300079E-05 -4.283854E-02 -3.731869E-04 -4.430520E+00 -3.943948E+00 -6.841366E-03 -9.402140E-06 -1.692848E-02 -5.756746E-05 -2.870817E+00 -1.648663E+00 -3.937272E-02 -3.101715E-04 -1.095132E-01 -2.399630E-03 -1.072714E+00 -2.304093E-01 -4.053504E-01 -3.291275E-02 -9.865418E-01 -1.949548E-01 -6.047420E-01 -7.327007E-02 -9.163609E-02 -1.683033E-03 -2.230239E-01 -9.969251E-03 -3.580639E-01 -2.592902E-02 -1.176143E-02 -2.794540E-05 -2.862497E-02 -1.655312E-04 -5.010141E-01 -5.114426E-02 -1.681802E-02 -5.755785E-05 -4.093171E-02 -3.409371E-04 -1.505803E+00 -4.607826E-01 -1.782565E-02 -6.454906E-05 -4.338461E-02 -3.823581E-04 -4.328880E+00 -3.766057E+00 -6.729803E-03 -9.102380E-06 -1.665243E-02 -5.573209E-05 -2.804071E+00 -1.572692E+00 -3.876401E-02 -3.006267E-04 -1.078201E-01 -2.325787E-03 +9.982469E-01 +1.993123E-01 +3.629452E-01 +2.634853E-02 +8.833361E-01 +1.560724E-01 +6.610630E-01 +8.773367E-02 +9.648461E-02 +1.868159E-03 +2.348243E-01 +1.106582E-02 +5.286568E-01 +5.635827E-02 +1.683119E-02 +5.710288E-05 +4.096374E-02 +3.382421E-04 +7.281968E-01 +1.066429E-01 +2.376548E-02 +1.135417E-04 +5.784044E-02 +6.725512E-04 +2.042363E+00 +8.367791E-01 +2.359067E-02 +1.116125E-04 +5.741567E-02 +6.611399E-04 +5.024800E+00 +5.052234E+00 +7.615466E-03 +1.160383E-05 +1.884394E-02 +7.104796E-05 +2.849940E+00 +1.624483E+00 +3.866901E-02 +2.990759E-04 +1.075559E-01 +2.313789E-03 +1.615789E+00 +5.222584E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +8.199362E-01 +1.349369E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.710679E-01 +6.566403E-02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +8.146887E-01 +1.333216E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +2.088724E+00 +8.745693E-01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.445622E+00 +3.954188E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +2.424612E+00 +1.176092E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +8.840636E-01 +1.563342E-01 +3.302232E-01 +2.181821E-02 +8.036972E-01 +1.292376E-01 +6.234645E-01 +7.797306E-02 +9.348579E-02 +1.752971E-03 +2.275257E-01 +1.038352E-02 +5.151708E-01 +5.348019E-02 +1.683613E-02 +5.712506E-05 +4.097576E-02 +3.383735E-04 +7.094735E-01 +1.011788E-01 +2.381337E-02 +1.139961E-04 +5.795699E-02 +6.752424E-04 +2.025112E+00 +8.224179E-01 +2.398002E-02 +1.153308E-04 +5.836330E-02 +6.831651E-04 +5.054745E+00 +5.112307E+00 +7.788949E-03 +1.214049E-05 +1.927321E-02 +7.433384E-05 +2.837465E+00 +1.610789E+00 +3.870822E-02 +2.999072E-04 +1.076649E-01 +2.320221E-03 +1.013940E+00 +2.056244E-01 +3.835611E-01 +2.942756E-02 +9.335110E-01 +1.743106E-01 +6.671972E-01 +8.933817E-02 +1.007569E-01 +2.037810E-03 +2.452222E-01 +1.207073E-02 +5.291824E-01 +5.642729E-02 +1.736757E-02 +6.079292E-05 +4.226920E-02 +3.600996E-04 +7.288726E-01 +1.067939E-01 +2.457229E-02 +1.214184E-04 +5.980403E-02 +7.192073E-04 +2.036124E+00 +8.314782E-01 +2.421030E-02 +1.175686E-04 +5.892374E-02 +6.964209E-04 +4.963612E+00 +4.929709E+00 +7.685178E-03 +1.181662E-05 +1.901644E-02 +7.235086E-05 +2.788017E+00 +1.554738E+00 +3.829404E-02 +2.933400E-04 +1.065129E-01 +2.269413E-03 plot_1.vtk flux_group_0: -5.913968E-01 -5.655076E-01 -5.054761E-01 -4.547202E-01 -5.560177E-01 -5.253906E-01 -5.039180E-01 -4.599082E-01 -5.650086E-01 -5.454949E-01 -5.938777E-01 -4.950333E-01 -5.767801E-01 -5.895635E-01 -5.976521E-01 -5.790217E-01 +6.135822E-01 +5.766969E-01 +4.929469E-01 +4.575468E-01 +5.427457E-01 +5.450961E-01 +5.014247E-01 +4.775152E-01 +5.878641E-01 +5.531545E-01 +5.303654E-01 +5.529401E-01 +5.777719E-01 +5.962534E-01 +5.582408E-01 +5.788047E-01 plot_1.vtk flux_group_1: -9.049953E-01 -8.690675E-01 -7.764124E-01 -7.457448E-01 -8.537971E-01 -8.168949E-01 -8.008285E-01 -7.449510E-01 -8.582825E-01 -8.449662E-01 -9.009476E-01 -7.759950E-01 -8.857030E-01 -8.908483E-01 -9.036063E-01 -8.784709E-01 +1.049409E+00 +1.005407E+00 +8.861887E-01 +8.591006E-01 +9.513801E-01 +9.655758E-01 +9.444703E-01 +8.752556E-01 +1.070694E+00 +9.998374E-01 +9.542866E-01 +9.990454E-01 +1.023398E+00 +1.034621E+00 +9.883011E-01 +1.020755E+00 plot_1.vtk flux_group_2: -3.015214E-01 -2.985554E-01 -3.126871E-01 -3.173026E-01 -2.865493E-01 -2.804492E-01 -3.146558E-01 -3.040486E-01 -2.822656E-01 -2.853286E-01 -3.063065E-01 -2.785592E-01 -2.883418E-01 -2.865253E-01 -2.968893E-01 -2.908738E-01 +4.030177E-01 +4.034727E-01 +4.147695E-01 +4.193796E-01 +3.776413E-01 +3.936524E-01 +4.413809E-01 +4.112300E-01 +4.299764E-01 +4.052762E-01 +3.923634E-01 +4.152441E-01 +3.975131E-01 +3.985133E-01 +3.911380E-01 +4.041501E-01 plot_1.vtk flux_group_3: -9.789382E-02 -9.922253E-02 -1.124658E-01 -1.171890E-01 -9.319568E-02 -9.259259E-02 -1.112438E-01 -1.096737E-01 -9.091120E-02 -9.333029E-02 -1.013252E-01 -9.447083E-02 -9.217139E-02 -9.193920E-02 -9.604286E-02 -9.450553E-02 +1.391168E-01 +1.434767E-01 +1.614137E-01 +1.673567E-01 +1.319589E-01 +1.406866E-01 +1.706807E-01 +1.604016E-01 +1.502971E-01 +1.432738E-01 +1.405941E-01 +1.505952E-01 +1.363537E-01 +1.368419E-01 +1.363995E-01 +1.413892E-01 plot_1.vtk flux_group_4: -7.172417E-02 -7.155283E-02 -7.625679E-02 -7.872836E-02 -6.790056E-02 -6.663927E-02 -7.574182E-02 -7.402778E-02 -6.630673E-02 -6.719442E-02 -7.302820E-02 -6.698837E-02 -6.803419E-02 -6.820158E-02 -7.070771E-02 -6.929316E-02 +1.033682E-01 +1.051923E-01 +1.131509E-01 +1.171359E-01 +9.677517E-02 +1.025245E-01 +1.192859E-01 +1.123403E-01 +1.095666E-01 +1.040069E-01 +1.024106E-01 +1.093792E-01 +1.007961E-01 +1.011474E-01 +1.010806E-01 +1.046827E-01 plot_1.vtk flux_group_5: -1.187884E-01 -1.209036E-01 -1.415119E-01 -1.509417E-01 -1.129955E-01 -1.121474E-01 -1.371764E-01 -1.373640E-01 -1.074332E-01 -1.108014E-01 -1.231136E-01 -1.142680E-01 -1.096633E-01 -1.097596E-01 -1.165954E-01 -1.147864E-01 +1.255157E-01 +1.316047E-01 +1.620948E-01 +1.752836E-01 +1.188916E-01 +1.285926E-01 +1.655152E-01 +1.616158E-01 +1.310923E-01 +1.269314E-01 +1.283831E-01 +1.399191E-01 +1.194216E-01 +1.202196E-01 +1.242112E-01 +1.293034E-01 plot_1.vtk flux_group_6: -1.990916E-01 -2.110707E-01 -3.172397E-01 -3.532411E-01 -1.920712E-01 -1.944036E-01 -2.946426E-01 -3.066421E-01 -1.765754E-01 -1.855224E-01 -2.147589E-01 -2.047948E-01 -1.750501E-01 -1.745509E-01 -1.936321E-01 -1.915593E-01 +1.781728E-01 +1.966901E-01 +3.191125E-01 +3.668745E-01 +1.736182E-01 +1.926829E-01 +3.083634E-01 +3.181821E-01 +1.800892E-01 +1.803169E-01 +1.909680E-01 +2.149939E-01 +1.604806E-01 +1.631400E-01 +1.777440E-01 +1.866138E-01 plot_1.vtk total_fission_source: -6.291527E-02 -6.546475E-02 +6.121743E-02 +6.553713E-02 0.000000E+00 0.000000E+00 -6.036877E-02 -6.047803E-02 +5.867833E-02 +6.399824E-02 0.000000E+00 0.000000E+00 -5.652983E-02 -5.867095E-02 -6.679097E-02 -6.267510E-02 -5.658627E-02 -5.656980E-02 -6.151551E-02 -6.067005E-02 +6.241830E-02 +6.142482E-02 +6.348286E-02 +7.028735E-02 +5.647763E-02 +5.728260E-02 +6.039946E-02 +6.315384E-02 diff --git a/tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat b/tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat index ef538d0d4b7..7789abc0e6d 100644 --- a/tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat +++ b/tests/regression_tests/random_ray_vtk/fs_flat/inputs_true.dat @@ -192,8 +192,8 @@ fixed source 90 - 10 - 5 + 15 + 10 100.0 1.0 diff --git a/tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat b/tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat index 2c0d5be7225..ea29082605b 100644 --- a/tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat +++ b/tests/regression_tests/random_ray_vtk/fs_flat/results_true.dat @@ -1,40 +1,40 @@ tally 1: -5.934433E-01 -7.058828E-02 +5.364815E-01 +5.764087E-02 tally 2: -3.205919E-02 -2.062653E-04 +2.635573E-02 +1.416744E-04 tally 3: -2.096403E-03 -8.804872E-07 +1.885527E-03 +7.311352E-07 plot_1.vtk flux_group_0: -7.729167E-02 -1.298820E-02 -7.877887E-03 -4.527351E-03 -7.431023E-03 -1.062695E-03 -1.271663E-03 -5.745279E-03 -3.190734E-04 -4.788767E-03 -8.744352E-03 -6.967466E-03 -6.957604E-03 -8.617753E-03 -2.008850E-03 -1.447357E-04 -5.397863E-03 -2.951601E-04 -9.207320E-03 -9.325794E-04 -1.661248E-03 -1.968164E-03 -8.922952E-03 -1.356149E-02 -6.308875E-03 -7.355642E-04 -3.572953E-03 +6.418241E-02 +1.419061E-02 +9.031969E-03 +1.839697E-02 +1.202567E-02 +1.742808E-04 +3.554224E-03 +8.094981E-03 +8.074061E-03 +5.722762E-03 +4.668543E-03 +4.913739E-03 +4.790228E-04 +2.782001E-03 +1.315225E-02 +5.422677E-03 +5.534124E-03 +1.325063E-04 +3.570325E-03 +4.067021E-03 +2.472544E-04 +1.422230E-02 +4.703243E-03 +4.056020E-04 +2.093527E-03 +1.636336E-04 +1.685014E-03 plot_1.vtk external_source: 3.140000E+00 0.000000E+00 diff --git a/tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat b/tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat index ac4ad1ad964..bdccc415599 100644 --- a/tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat +++ b/tests/regression_tests/random_ray_vtk/fs_linear/inputs_true.dat @@ -192,8 +192,8 @@ fixed source 90 - 10 - 5 + 15 + 10 100.0 1.0 diff --git a/tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat b/tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat index c1cc0fac88d..df8a6b1253d 100644 --- a/tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat +++ b/tests/regression_tests/random_ray_vtk/fs_linear/results_true.dat @@ -1,40 +1,40 @@ tally 1: -5.993658E-01 -7.200175E-02 +5.422753E-01 +5.888788E-02 tally 2: -3.205919E-02 -2.062652E-04 +2.666460E-02 +1.448679E-04 tally 3: -2.096403E-03 -8.804872E-07 +1.874218E-03 +7.240497E-07 plot_1.vtk flux_group_0: -5.489871E-02 -2.379240E-02 -7.877886E-03 -2.677029E-03 -1.789258E-02 -3.797880E-04 -8.056443E-05 -4.037824E-03 -8.067211E-05 -6.229131E-03 -4.903862E-03 -6.967458E-03 -1.197564E-03 -5.637538E-03 -9.136149E-04 -1.454110E-04 -5.397870E-03 -4.470478E-04 -1.091852E-02 -1.560840E-03 -1.661248E-03 -5.901166E-03 -3.684082E-03 -1.203939E-02 -6.173793E-03 -1.314195E-04 -4.132313E-03 +9.133315E-03 +2.470312E-02 +8.639651E-03 +2.068152E-02 +1.821846E-02 +3.879083E-04 +3.972599E-03 +1.556799E-02 +1.563231E-03 +6.325816E-03 +6.817768E-03 +8.863986E-03 +5.132107E-04 +2.907239E-03 +2.343546E-02 +7.046433E-03 +1.158762E-02 +2.694198E-04 +2.483241E-03 +8.822081E-04 +2.509553E-04 +1.298585E-02 +1.076230E-03 +1.506452E-03 +5.795310E-03 +3.468050E-04 +2.400703E-03 plot_1.vtk external_source: 3.140000E+00 0.000000E+00 diff --git a/tests/regression_tests/random_ray_vtk/test.py b/tests/regression_tests/random_ray_vtk/test.py index 7024efe0b3a..1b78e1777c7 100644 --- a/tests/regression_tests/random_ray_vtk/test.py +++ b/tests/regression_tests/random_ray_vtk/test.py @@ -34,5 +34,9 @@ def test_random_ray_vtk(run_mode, shape): plot.width = (24.9, 24.9, 24.9) plot.pixels = (3, 3, 3) model.settings.random_ray['source_shape'] = shape - harness = MGXSTestHarness('statepoint.10.h5', model, plot) + # The linear source keeps its gradients at zero for the first ten + # batches, so put all the active batches after them + model.settings.inactive = 10 + model.settings.batches = 15 + harness = MGXSTestHarness('statepoint.15.h5', model, plot) harness.main() diff --git a/tests/testing_harness.py b/tests/testing_harness.py index ece3e68b5f3..f4717c1c3a4 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -487,9 +487,10 @@ def _get_results(self): # Adjoint runs also write the forward solve, to a .forward.vtk file for vtk_file in sorted(glob.glob('*.vtk')): for name, values in read_vtk_arrays(vtk_file).items(): - # Compare the flux and source fields; the other arrays (FSR - # and rank colors, materials, loads, weight windows) are - # visualization aids + # Compare the flux and source fields. The other arrays are + # random colors (FSRs, rank_subdomains), timings + # (measured_load), or not under test (Materials, + # weight_window_lower) if name.startswith('flux_group_') or name in ( 'total_fission_source', 'external_source'): outstr += f'{vtk_file} {name}:\n'