1818from tests .conftest import OUTPUT_DIR_FOR_DISTRIBUTION_ELEMENT
1919import bim2fem .ifcplus .util .geometry
2020import numpy as np
21+ from typing import cast
2122
2223
2324class TestAddEquipment :
@@ -151,12 +152,23 @@ def test_add_elbows(
151152 )
152153 )
153154
155+ material = bim2fem .ifcplus .api .material .add_material_with_structural_properties (
156+ ifc4_file = ifc_file_with_ventilation_distribution_system ,
157+ name = "Galvanized Steel" ,
158+ category = "steel" ,
159+ mass_density = 7850.0 ,
160+ young_modulus = 200.0e9 ,
161+ poisson_ratio = 0.3 ,
162+ thermal_expansion_coefficient = 1.2e-6 ,
163+ check_for_duplicate = True ,
164+ )
165+
154166 bim2fem .ifcplus .api .distribution_element .create_elbow (
155167 ifc4_file = ifc_file_with_ventilation_distribution_system ,
156168 horizontal_curve = horizontal_curve_1 ,
157169 nominal_diameter = 1.0 ,
158170 thickness = 0.10 ,
159- material = None ,
171+ material = material ,
160172 name = "Elbow #1" ,
161173 spatial_element = site ,
162174 distribution_system = distribution_system ,
@@ -177,7 +189,7 @@ def test_add_elbows(
177189 horizontal_curve = horizontal_curve_2 ,
178190 nominal_diameter = 1.0 ,
179191 thickness = 0.10 ,
180- material = None ,
192+ material = material ,
181193 name = "Elbow #2" ,
182194 spatial_element = site ,
183195 distribution_system = distribution_system ,
@@ -198,7 +210,7 @@ def test_add_elbows(
198210 horizontal_curve = horizontal_curve_3 ,
199211 nominal_diameter = 1.0 ,
200212 thickness = 0.10 ,
201- material = None ,
213+ material = material ,
202214 name = "Elbow #3" ,
203215 spatial_element = site ,
204216 distribution_system = distribution_system ,
@@ -220,7 +232,7 @@ def test_add_elbows(
220232 horizontal_curve = horizontal_curve_4 ,
221233 nominal_diameter = 1.0 ,
222234 thickness = 0.10 ,
223- material = None ,
235+ material = material ,
224236 name = "Elbow #4" ,
225237 spatial_element = site ,
226238 distribution_system = distribution_system ,
@@ -241,7 +253,7 @@ def test_add_elbows(
241253 horizontal_curve = horizontal_curve_5 ,
242254 nominal_diameter = 1.0 ,
243255 thickness = 0.10 ,
244- material = None ,
256+ material = material ,
245257 name = "Elbow #5" ,
246258 spatial_element = site ,
247259 distribution_system = distribution_system ,
@@ -335,14 +347,13 @@ def test_connect_make_up_air_unit_and_hepa_filter_with_dumb_piping(
335347 )
336348 )
337349
338- assert isinstance (steel_material , ifcopenshell .entity_instance )
339-
340350 bim2fem .ifcplus .api .system .connect_two_distribution_ports_via_piping_with_no_intelligence (
351+ ifc4_file = ifc_file_with_ventilation_distribution_system ,
341352 source_port = mau_source_port ,
342353 sink_port = hepa_sink_port ,
343354 nominal_diameter = 0.20 ,
344355 thickness = 0.20 * 0.10 ,
345- material = steel_material ,
356+ material = cast ( ifcopenshell . entity_instance , steel_material ) ,
346357 distribution_system = distribution_system ,
347358 elbow_radius_type = "SHORT" ,
348359 branch_name = "Branch #1" ,
@@ -437,15 +448,13 @@ def test_connect_make_up_air_unit_and_hepa_filter_using_ant_colony(
437448 )
438449 )
439450
440- assert isinstance (steel_material , ifcopenshell .entity_instance )
441-
442451 bim2fem .ifcplus .api .system .connect_two_distribution_ports_via_piping_using_ant_colony (
443452 source_port = mau_source_port ,
444453 sink_port = hepa_sink_port ,
445454 obstacle = None ,
446455 nominal_diameter = 0.20 ,
447456 thickness = 0.20 * 0.10 ,
448- material = steel_material ,
457+ material = cast ( ifcopenshell . entity_instance , steel_material ) ,
449458 distribution_system = distribution_system ,
450459 elbow_radius_type = "SHORT" ,
451460 branch_name = "Branch #1" ,
@@ -540,12 +549,11 @@ def test_connect_make_up_air_unit_and_hepa_filter_using_ant_colony_with_obstacle
540549 representation_type = ifcopenshell .util .representation .guess_type (
541550 items = [csg_solid ]
542551 )
543- assert isinstance (representation_type , str )
544552 shape_model = bim2fem .ifcplus .api .geometry .add_shape_model (
545553 ifc4_file = ifc_file_with_ventilation_distribution_system ,
546554 shape_model_class = "IfcShapeRepresentation" ,
547555 representation_identifier = "Body" ,
548- representation_type = representation_type ,
556+ representation_type = cast ( str , representation_type ) ,
549557 items = [csg_solid ],
550558 )
551559 ifcopenshell .api .geometry .assign_representation (
@@ -596,15 +604,13 @@ def test_connect_make_up_air_unit_and_hepa_filter_using_ant_colony_with_obstacle
596604 )
597605 )
598606
599- assert isinstance (steel_material , ifcopenshell .entity_instance )
600-
601607 bim2fem .ifcplus .api .system .connect_two_distribution_ports_via_piping_using_ant_colony (
602608 source_port = mau_source_port ,
603609 sink_port = hepa_sink_port ,
604610 obstacle = obstacle ,
605611 nominal_diameter = 0.20 ,
606612 thickness = 0.20 * 0.10 ,
607- material = steel_material ,
613+ material = cast ( ifcopenshell . entity_instance , steel_material ) ,
608614 distribution_system = distribution_system ,
609615 elbow_radius_type = "SHORT" ,
610616 branch_name = "Branch #1" ,
0 commit comments