|
7 | 7 |
|
8 | 8 | import flow360.component.simulation.units as u |
9 | 9 | from flow360.component.simulation.entity_info import ( |
10 | | - GeometryEntityInfo, |
11 | 10 | SurfaceMeshEntityInfo, |
12 | 11 | VolumeMeshEntityInfo, |
13 | 12 | ) |
@@ -2002,7 +2001,6 @@ def test_beta_mesher_only_features(): |
2002 | 2001 |
|
2003 | 2002 |
|
2004 | 2003 | def test_geometry_AI_only_features(): |
2005 | | - # * Test GAI guardrails |
2006 | 2004 | with SI_unit_system: |
2007 | 2005 | params = SimulationParams( |
2008 | 2006 | meshing=MeshingParams( |
@@ -2063,61 +2061,6 @@ def test_geometry_AI_only_features(): |
2063 | 2061 | errors[0]["msg"] == "Value error, Geometry accuracy is required when geometry AI is used." |
2064 | 2062 | ) |
2065 | 2063 |
|
2066 | | - # * Test geometry_accuracy and planar_face_tolerance compatibility |
2067 | | - with SI_unit_system: |
2068 | | - params_original = SimulationParams( |
2069 | | - meshing=MeshingParams( |
2070 | | - defaults=MeshingDefaults( |
2071 | | - geometry_accuracy=1e-5 * u.m, |
2072 | | - planar_face_tolerance=1e-10, |
2073 | | - boundary_layer_first_layer_thickness=10, |
2074 | | - surface_max_edge_length=1e-2, |
2075 | | - ), |
2076 | | - ), |
2077 | | - private_attribute_asset_cache=AssetCache( |
2078 | | - project_length_unit=1 * u.cm, |
2079 | | - use_inhouse_mesher=True, |
2080 | | - use_geometry_AI=True, |
2081 | | - project_entity_info=GeometryEntityInfo( |
2082 | | - global_bounding_box=[[-100, -100, -100], [100, 1e-12, 100]], |
2083 | | - ), |
2084 | | - ), |
2085 | | - ) |
2086 | | - params, errors, _ = validate_model( |
2087 | | - params_as_dict=params_original.model_dump(mode="json"), |
2088 | | - validated_by=ValidationCalledBy.LOCAL, |
2089 | | - root_item_type="Geometry", |
2090 | | - validation_level="VolumeMesh", |
2091 | | - ) |
2092 | | - assert len(errors) == 1 |
2093 | | - # Largest dim = 200 cm |
2094 | | - # with planar face tolerance = 1e-10 |
2095 | | - # largest geometry accuracy = 1e-10 * 200 cm = 2e-8 cm |
2096 | | - # with geometry accuracy = 1e-5m |
2097 | | - # minimum planar face tolerance = 1e-5m / 200 cm = 5e-06 |
2098 | | - assert errors[0]["msg"] == ( |
2099 | | - "Value error, geometry_accuracy is too large for the planar_face_tolerance to take effect. " |
2100 | | - "Reduce geometry_accuracy to at most 2e-08 cm or increase the planar_face_tolerance to at least 5e-06." |
2101 | | - ) |
2102 | | - params_original.meshing.defaults.geometry_accuracy = 2e-08 * u.cm |
2103 | | - params, _, _ = validate_model( |
2104 | | - params_as_dict=params_original.model_dump(mode="json"), |
2105 | | - validated_by=ValidationCalledBy.LOCAL, |
2106 | | - root_item_type="Geometry", |
2107 | | - validation_level="VolumeMesh", |
2108 | | - ) |
2109 | | - assert params |
2110 | | - |
2111 | | - params_original.meshing.defaults.geometry_accuracy = 1e-5 * u.m |
2112 | | - params_original.meshing.defaults.planar_face_tolerance = 5e-06 |
2113 | | - params, _, _ = validate_model( |
2114 | | - params_as_dict=params_original.model_dump(mode="json"), |
2115 | | - validated_by=ValidationCalledBy.LOCAL, |
2116 | | - root_item_type="Geometry", |
2117 | | - validation_level="VolumeMesh", |
2118 | | - ) |
2119 | | - assert params |
2120 | | - |
2121 | 2064 |
|
2122 | 2065 | def test_redefined_user_defined_fields(): |
2123 | 2066 |
|
|
0 commit comments