diff --git a/tests/test_h5m_in_transport.py b/tests/test_h5m_in_transport.py index 0edfffb..228cfb6 100644 --- a/tests/test_h5m_in_transport.py +++ b/tests/test_h5m_in_transport.py @@ -1,5 +1,6 @@ import openmc - +from cad_to_Dagmc import CadToDagmc +import cadquery as cq """ Tests that check that: @@ -117,21 +118,20 @@ def transport_particles_on_h5m_geometry( def test_transport_result_h5m_with_2_sep_volumes(): - # h5m_filename = "test_two_sep_volumes.h5m" + h5m_filename = "test_two_sep_volumes.h5m" volumes = 2 material_tags = [f"material_{n}" for n in range(1, volumes + 1)] - # workplane1 = cq.Workplane("XY").cylinder(height=10, radius=4) - # workplane2 = cq.Workplane("XY").moveTo(0, 15).cylinder(height=10, radius=5) - # # cq.Assembly().add(workplane1).add(workplane2) + workplane1 = cq.Workplane("XY").cylinder(height=10, radius=4) + workplane2 = cq.Workplane("XY").moveTo(0, 15).cylinder(height=10, radius=5) + # cq.Assembly().add(workplane1).add(workplane2) - # my_model = CadToDagmc() - # my_model.add_cadquery_object(workplane1) - # my_model.add_cadquery_object(workplane2) - # my_model.export_dagmc_h5m_file( - # filename=h5m_filename, material_tags=[material_tags[0], material_tags[1]] - # ) - h5m_filename = "test_two_sep_volumes.h5m" + my_model = CadToDagmc() + my_model.add_cadquery_object(workplane1) + my_model.add_cadquery_object(workplane2) + my_model.export_dagmc_h5m_file( + filename=h5m_filename, material_tags=[material_tags[0], material_tags[1]] + ) transport_particles_on_h5m_geometry( h5m_filename=h5m_filename, @@ -141,17 +141,15 @@ def test_transport_result_h5m_with_2_sep_volumes(): def test_transport_result_h5m_with_1_volumes(): - # h5m_filename = "one_cylinder.h5m" + h5m_filename = "one_cylinder.h5m" volumes = 1 material_tags = [f"material_{n}" for n in range(1, volumes + 1)] - # workplane1 = cq.Workplane("XY").cylinder(height=10, radius=4) + workplane1 = cq.Workplane("XY").cylinder(height=10, radius=4) - # my_model = CadToDagmc() - # my_model.add_cadquery_object(workplane1) - # my_model.export_dagmc_h5m_file(filename=h5m_filename, material_tags=[material_tags[0]]) - - h5m_filename = "one_cylinder.h5m" + my_model = CadToDagmc() + my_model.add_cadquery_object(workplane1) + my_model.export_dagmc_h5m_file(filename=h5m_filename, material_tags=[material_tags[0]]) transport_particles_on_h5m_geometry( h5m_filename=h5m_filename, @@ -161,22 +159,22 @@ def test_transport_result_h5m_with_1_volumes(): def test_transport_result_h5m_with_2_joined_volumes(): - # h5m_filename = "two_connected_cylinders.h5m" + h5m_filename = "two_connected_cylinders.h5m" volumes = 2 material_tags = [f"material_{n}" for n in range(1, volumes + 1)] - # workplane1 = cq.Workplane("XY").cylinder(height=10, radius=4) - # workplane2 = cq.Workplane("XY").cylinder(height=10, radius=5).cut(workplane1) + workplane1 = cq.Workplane("XY").cylinder(height=10, radius=4) + workplane2 = cq.Workplane("XY").cylinder(height=10, radius=5).cut(workplane1) - # my_model = CadToDagmc() - # my_model.add_cadquery_object(workplane1) - # my_model.add_cadquery_object(workplane2) - # my_model.export_dagmc_h5m_file( - # filename=h5m_filename, material_tags=[material_tags[0], material_tags[1]] - # ) + my_model = CadToDagmc() + my_model.add_cadquery_object(workplane1) + my_model.add_cadquery_object(workplane2) + my_model.export_dagmc_h5m_file( + filename=h5m_filename, material_tags=[material_tags[0], material_tags[1]] + ) transport_particles_on_h5m_geometry( - h5m_filename="two_connected_cylinders.h5m", + h5m_filename=h5m_filename, material_tags=material_tags, nuclides=["H1"] * len(material_tags), )