From 03f6b5b263bb984528862b8a32da1316a6b070d8 Mon Sep 17 00:00:00 2001
From: skywalker_cn <2324714651@qq.com>
Date: Thu, 11 Sep 2025 07:44:43 +0000
Subject: [PATCH] Update the triso_virtual_lattice test
---
.../triso_virtual_lattice/inputs_true.dat | 554 +++++++++---------
.../triso_virtual_lattice/results_true.dat | 2 +-
.../triso_virtual_lattice/test.py | 18 +-
3 files changed, 287 insertions(+), 287 deletions(-)
diff --git a/tests/regression_tests/triso_virtual_lattice/inputs_true.dat b/tests/regression_tests/triso_virtual_lattice/inputs_true.dat
index aac4fde5d5..cdf1574633 100644
--- a/tests/regression_tests/triso_virtual_lattice/inputs_true.dat
+++ b/tests/regression_tests/triso_virtual_lattice/inputs_true.dat
@@ -1,278 +1,278 @@
-
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
-
- 1.0 1.0 1.0
- 12
- 1 1 1
- -0.5 -0.5 -0.5
-
-11
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- eigenvalue
- 100
- 4
- 0
-
-
- 0.0 0.0 0.0
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+ 1.0 1.0 1.0
+ 4
+ 1 1 1
+ -0.5 -0.5 -0.5
+
+3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ eigenvalue
+ 100
+ 4
+ 0
+
+
+ 0.0 0.0 0.0
+
+
+
+
diff --git a/tests/regression_tests/triso_virtual_lattice/results_true.dat b/tests/regression_tests/triso_virtual_lattice/results_true.dat
index 3e9ca126f8..b576675599 100644
--- a/tests/regression_tests/triso_virtual_lattice/results_true.dat
+++ b/tests/regression_tests/triso_virtual_lattice/results_true.dat
@@ -1,2 +1,2 @@
k-combined:
-1.719897E+00 3.608153E-02
+1.514485E+00 2.297724E-02
diff --git a/tests/regression_tests/triso_virtual_lattice/test.py b/tests/regression_tests/triso_virtual_lattice/test.py
index 481866a944..dbde24bfcc 100644
--- a/tests/regression_tests/triso_virtual_lattice/test.py
+++ b/tests/regression_tests/triso_virtual_lattice/test.py
@@ -9,7 +9,8 @@ from tests.testing_harness import PyAPITestHarness
class TRISOVirtualLatticeTestHarness(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)
@@ -65,7 +66,7 @@ class TRISOVirtualLatticeTestHarness(PyAPITestHarness):
outer_radius = 422.5*1e-4
centers = openmc.model.pack_spheres(radius=outer_radius,
- region=box_region, num_spheres=100)
+ region=box_region, num_spheres=100, seed=1)
trisos = [openmc.model.TRISO(outer_radius, inner_univ, c)
for c in centers]
@@ -78,20 +79,19 @@ class TRISOVirtualLatticeTestHarness(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()
+ settings.source = openmc.IndependentSource(space=openmc.stats.Point())
+ 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_virtual_lattice():
- harness = TRISOVirtualLatticeTestHarness('statepoint.4.h5')
+ harness = TRISOVirtualLatticeTestHarness('statepoint.4.h5', model=openmc.Model())
harness.main()