From 4ad07df37f4d124502d9f5c0837f30bde095f3fc Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Wed, 5 Nov 2025 12:38:05 +0530 Subject: [PATCH 01/16] test-2 --- tests/system/general/test_27_Maxwell2D.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index cd7ac7f6ecb..c1bc9961a7a 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -253,6 +253,11 @@ def test_assign_movement(self, aedtapp): assert bound assert bound.props["PositivePos"] == "300deg" assert bound.props["Objects"][0] == "Circle_outer" + assert len(aedtapp.boundaries_by_type["Band"])==2 + bound.delete() + assert len(aedtapp.boundaries_by_type["Band"])==1 + + def test_delete_motion_setup(self, aedtapp): aedtapp.xy_plane = True From 8a27b7e81df5759b86ae1b588790e1bcc5a09d57 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Tue, 16 Sep 2025 12:54:42 +0530 Subject: [PATCH 02/16] test_case for delete motion setup added --- tests/system/general/test_27_Maxwell2D.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index c1bc9961a7a..b83da519ca9 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -253,6 +253,14 @@ def test_assign_movement(self, aedtapp): assert bound assert bound.props["PositivePos"] == "300deg" assert bound.props["Objects"][0] == "Circle_outer" + + + def test_delete_motion_setup(self, aedtapp): + aedtapp.xy_plane = True + aedtapp.modeler.create_circle([0, 0, 0], 10, name="Circle_inner") + aedtapp.modeler.create_circle([0, 0, 0], 30, name="Circle_outer") + bound = aedtapp.assign_rotate_motion("Circle_outer", positive_limit=300, mechanical_transient=True) + assert bound assert len(aedtapp.boundaries_by_type["Band"])==2 bound.delete() assert len(aedtapp.boundaries_by_type["Band"])==1 From 8e5b1570b82f6263dedd93fbc13e5c7c44dc0136 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Fri, 5 Sep 2025 18:35:51 +0530 Subject: [PATCH 03/16] Delete Motion setup added --- tests/system/general/test_27_Maxwell2D.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index b83da519ca9..57519e73d30 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -253,6 +253,11 @@ def test_assign_movement(self, aedtapp): assert bound assert bound.props["PositivePos"] == "300deg" assert bound.props["Objects"][0] == "Circle_outer" + assert len(aedtapp.boundaries_by_type["Band"])==2 + bound.delete() + assert len(aedtapp.boundaries_by_type["Band"])==1 + + def test_delete_motion_setup(self, aedtapp): From fdb3a13f01ae7c31ccb4f23a0c68933ed417bc3c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 13:09:13 +0000 Subject: [PATCH 04/16] CHORE: Auto fixes from pre-commit hooks --- tests/system/general/test_27_Maxwell2D.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 57519e73d30..ce70f27f6f6 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -253,11 +253,9 @@ def test_assign_movement(self, aedtapp): assert bound assert bound.props["PositivePos"] == "300deg" assert bound.props["Objects"][0] == "Circle_outer" - assert len(aedtapp.boundaries_by_type["Band"])==2 + assert len(aedtapp.boundaries_by_type["Band"]) == 2 bound.delete() - assert len(aedtapp.boundaries_by_type["Band"])==1 - - + assert len(aedtapp.boundaries_by_type["Band"]) == 1 def test_delete_motion_setup(self, aedtapp): From ff7694fa34aa7c4b3cba1fabef93a3b4b2455c31 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 8 Sep 2025 07:45:55 +0000 Subject: [PATCH 05/16] chore: adding changelog file 6612.added.md [dependabot-skip] --- doc/changelog.d/6612.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/6612.added.md diff --git a/doc/changelog.d/6612.added.md b/doc/changelog.d/6612.added.md new file mode 100644 index 00000000000..0e34206a9c9 --- /dev/null +++ b/doc/changelog.d/6612.added.md @@ -0,0 +1 @@ +Delete Motion setup added From a65f3b0fbfb2a33d8789e513b6f19dbaf88fa271 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Tue, 16 Sep 2025 13:41:50 +0530 Subject: [PATCH 06/16] initla commit --- src/ansys/aedt/core/maxwell.py | 72 +++++++++++++++++++++++ tests/system/general/test_27_Maxwell2D.py | 7 +++ 2 files changed, 79 insertions(+) diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index 59f33fe59b7..7d9510e4711 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -1422,6 +1422,78 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name raise AEDTRuntimeError("Face Selection is not allowed in Maxwell 2D. Provide a 2D object.") return self._create_boundary(name, props, bound_type) + + # @pyaedt_function_handler(input_object="assignment", conductor_number="conductors_number") + # def assign_coil_group(self, assignment, conductors_number=1, polarity="Positive", name=None): + # """Assign coils to a list of objects or face IDs. + + # Parameters + # ---------- + # assignment : list + # List of objects, objects name or face IDs. + # conductors_number : int, optional + # Number of conductors. The default is ``1``. + # polarity : str, optional + # Type of the polarity. The default is ``"Positive"``. + # name : str, optional + # Name of the coil. The default is ``None``, + # in which case a random name with prefix "Coil" will be generated. + + # Returns + # ------- + # :class:`ansys.aedt.core.modules.boundary.common.BoundaryObject` + # Bounding object for the winding, otherwise only the bounding object. + # ``False`` when failed. + + # References + # ---------- + # >>> oModule.AssignCoil + + # Examples + # -------- + # Assign coil terminal to an object for a Maxwell 2D Transient design. + + # >>> from ansys.aedt.core import Maxwell2d + # >>> m2d = Maxwell2d(solution_type="TransientZ") + # >>> terminal = m2d.modeler.create_rectangle(origin=[0, 0, 0], sizes=[10, 5]) + # >>> coil = m2d.assign_coil(assignment=[terminal], conductors_number=5, name="Coil") + # >>> m2d.release_desktop(True, True) + # """ + # if polarity.lower() == "positive": + # point = False + # else: + # point = True + + # assignment = self.modeler.convert_to_selections(assignment, True) + + # if not name: + # name = generate_unique_name("Coil") + + # if isinstance(assignment[0], str): + # if self.modeler._is3d: + # props = dict( + # {"Objects": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} + # ) + # bound_type = "CoilTerminal" + # else: + # props = dict( + # { + # "Objects": assignment, + # "Conductor number": str(conductors_number), + # "PolarityType": polarity.lower(), + # } + # ) + # bound_type = "Coil" + # else: + # if self.modeler._is3d: + # props = dict( + # {"Faces": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} + # ) + # bound_type = "CoilTerminal" + # else: + # raise AEDTRuntimeError("Face Selection is not allowed in Maxwell 2D. Provide a 2D object.") + + # return self._create_boundary(name, props, bound_type) @pyaedt_function_handler(input_object="assignment", reference_cs="coordinate_system") def assign_force(self, assignment, coordinate_system="Global", is_virtual=True, force_name=None): diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index ce70f27f6f6..59a3d12df60 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -144,6 +144,11 @@ def test_assign_coil(self, aedtapp): bound = aedtapp.assign_coil(assignment=["Coil"], name=bound_name) assert bound_name == bound.name + def test_assign_coilgroup(self, aedtapp): + bound = aedtapp.assign_coil_group(assignment=["Coil", "Coil_1"]) + assert bound + polarity = "Positive" + def test_create_vector_potential(self, aedtapp): region = aedtapp.modeler["Region"] edge_object = region.edges[0] @@ -193,6 +198,8 @@ def test_assign_force(self, aedtapp): force = aedtapp.assign_force(assignment="Magnet2_Section1", force_name="Force_Test") assert force.name == "Force_Test" + + def test_assign_current_source(self, m2d_app): coil = m2d_app.modeler.create_circle( position=[0, 0, 0], radius=5, num_sides="8", is_covered=True, name="Coil", material="Copper" From fbe6fedda95b5dbf28bfc382c2d7f03549698abe Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Tue, 16 Sep 2025 17:40:17 +0530 Subject: [PATCH 07/16] assign_coil_group --- src/ansys/aedt/core/maxwell.py | 12 ++++++++++++ src/ansys/aedt/core/modules/boundary/common.py | 2 ++ tests/system/general/test_27_Maxwell2D.py | 6 +++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index 7d9510e4711..7206756e47c 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -1404,6 +1404,18 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name ) bound_type = "CoilTerminal" else: + bound_objects = {"Objects": assignment} + + if len(assignment) > 1: + coil_group_names = [] + for x in range(0, len(assignment)): + coil_group_names.append(name + f"_{str(x + 1)}") + bound_name = coil_group_names[0] + props = {"items": coil_group_names, bound_name: bound_objects} + bound_type = "CoilGroup" + + else: + props = dict( { "Objects": assignment, diff --git a/src/ansys/aedt/core/modules/boundary/common.py b/src/ansys/aedt/core/modules/boundary/common.py index be296f91b6e..f376b12be94 100644 --- a/src/ansys/aedt/core/modules/boundary/common.py +++ b/src/ansys/aedt/core/modules/boundary/common.py @@ -499,6 +499,8 @@ def create(self): self._app.oboundary.AssignCoilTerminal(self._get_args()) elif bound_type == "Coil": self._app.oboundary.AssignCoil(self._get_args()) + elif bound_type == "CoilGroup": + self._app.oboundary.AssignCoilGroup(self._get_args()[2], self._get_args()[3]) elif bound_type == "Source": self._app.oboundary.AssignSource(self._get_args()) elif bound_type == "Sink": diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 59a3d12df60..b5233158ac2 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -132,10 +132,10 @@ def test_assign_winding(self, aedtapp): assert bounds_name == bounds.name def test_assign_coil(self, aedtapp): - bound = aedtapp.assign_coil(assignment=["Coil"]) - assert bound + # bound = aedtapp.assign_coil(assignment=["Coil"]) + # assert bound polarity = "Positive" - bound = aedtapp.assign_coil(assignment=["Coil"], polarity=polarity) + bound = aedtapp.assign_coil(assignment=["Coil","Coil_2", "Coil_4" ], polarity=polarity) assert bound.props["PolarityType"] == polarity.lower() polarity = "Negative" bound = aedtapp.assign_coil(assignment=["Coil"], polarity=polarity) From 9efc59c079a3da6051698ab28f3826f8cf36ef6b Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Wed, 17 Sep 2025 13:51:49 +0530 Subject: [PATCH 08/16] added assign coil group-2 --- src/ansys/aedt/core/maxwell.py | 85 +++---------------- .../aedt/core/modules/boundary/common.py | 1 + tests/system/general/test_27_Maxwell2D.py | 12 +-- 3 files changed, 20 insertions(+), 78 deletions(-) diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index 7206756e47c..8fff7761c74 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -1408,10 +1408,20 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name if len(assignment) > 1: coil_group_names = [] + bound_props = dict( + { + "Objects": assignment, + "Conductor number": str(conductors_number), + "PolarityType": polarity.lower(), + } + ) + for x in range(0, len(assignment)): coil_group_names.append(name + f"_{str(x + 1)}") - bound_name = coil_group_names[0] - props = {"items": coil_group_names, bound_name: bound_objects} + + props = {"items": coil_group_names} + props[coil_group_names[0]] = bound_props.copy() + bound_type = "CoilGroup" else: @@ -1435,77 +1445,6 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name return self._create_boundary(name, props, bound_type) - # @pyaedt_function_handler(input_object="assignment", conductor_number="conductors_number") - # def assign_coil_group(self, assignment, conductors_number=1, polarity="Positive", name=None): - # """Assign coils to a list of objects or face IDs. - - # Parameters - # ---------- - # assignment : list - # List of objects, objects name or face IDs. - # conductors_number : int, optional - # Number of conductors. The default is ``1``. - # polarity : str, optional - # Type of the polarity. The default is ``"Positive"``. - # name : str, optional - # Name of the coil. The default is ``None``, - # in which case a random name with prefix "Coil" will be generated. - - # Returns - # ------- - # :class:`ansys.aedt.core.modules.boundary.common.BoundaryObject` - # Bounding object for the winding, otherwise only the bounding object. - # ``False`` when failed. - - # References - # ---------- - # >>> oModule.AssignCoil - - # Examples - # -------- - # Assign coil terminal to an object for a Maxwell 2D Transient design. - - # >>> from ansys.aedt.core import Maxwell2d - # >>> m2d = Maxwell2d(solution_type="TransientZ") - # >>> terminal = m2d.modeler.create_rectangle(origin=[0, 0, 0], sizes=[10, 5]) - # >>> coil = m2d.assign_coil(assignment=[terminal], conductors_number=5, name="Coil") - # >>> m2d.release_desktop(True, True) - # """ - # if polarity.lower() == "positive": - # point = False - # else: - # point = True - - # assignment = self.modeler.convert_to_selections(assignment, True) - - # if not name: - # name = generate_unique_name("Coil") - - # if isinstance(assignment[0], str): - # if self.modeler._is3d: - # props = dict( - # {"Objects": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} - # ) - # bound_type = "CoilTerminal" - # else: - # props = dict( - # { - # "Objects": assignment, - # "Conductor number": str(conductors_number), - # "PolarityType": polarity.lower(), - # } - # ) - # bound_type = "Coil" - # else: - # if self.modeler._is3d: - # props = dict( - # {"Faces": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} - # ) - # bound_type = "CoilTerminal" - # else: - # raise AEDTRuntimeError("Face Selection is not allowed in Maxwell 2D. Provide a 2D object.") - - # return self._create_boundary(name, props, bound_type) @pyaedt_function_handler(input_object="assignment", reference_cs="coordinate_system") def assign_force(self, assignment, coordinate_system="Global", is_virtual=True, force_name=None): diff --git a/src/ansys/aedt/core/modules/boundary/common.py b/src/ansys/aedt/core/modules/boundary/common.py index f376b12be94..d415b2785d0 100644 --- a/src/ansys/aedt/core/modules/boundary/common.py +++ b/src/ansys/aedt/core/modules/boundary/common.py @@ -501,6 +501,7 @@ def create(self): self._app.oboundary.AssignCoil(self._get_args()) elif bound_type == "CoilGroup": self._app.oboundary.AssignCoilGroup(self._get_args()[2], self._get_args()[3]) + return True elif bound_type == "Source": self._app.oboundary.AssignSource(self._get_args()) elif bound_type == "Sink": diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index b5233158ac2..ce41554f2c0 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -132,10 +132,9 @@ def test_assign_winding(self, aedtapp): assert bounds_name == bounds.name def test_assign_coil(self, aedtapp): - # bound = aedtapp.assign_coil(assignment=["Coil"]) - # assert bound + bound = aedtapp.assign_coil(assignment=["Coil"]) + assert bound polarity = "Positive" - bound = aedtapp.assign_coil(assignment=["Coil","Coil_2", "Coil_4" ], polarity=polarity) assert bound.props["PolarityType"] == polarity.lower() polarity = "Negative" bound = aedtapp.assign_coil(assignment=["Coil"], polarity=polarity) @@ -145,9 +144,12 @@ def test_assign_coil(self, aedtapp): assert bound_name == bound.name def test_assign_coilgroup(self, aedtapp): - bound = aedtapp.assign_coil_group(assignment=["Coil", "Coil_1"]) - assert bound polarity = "Positive" + bound = aedtapp.assign_coil(assignment=["Coil","Coil_2", "Coil_4" ]) + assert bound + assert len(bound['items'])==3 + assert bound.props["PolarityType"] == polarity.lower() + def test_create_vector_potential(self, aedtapp): region = aedtapp.modeler["Region"] From 4746786d9ba5a7391909bfef032fd6e25d3e1296 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Wed, 17 Sep 2025 14:45:08 +0530 Subject: [PATCH 09/16] assign coild group 3 --- tests/system/general/test_27_Maxwell2D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index ce41554f2c0..58e3e93fbdc 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -148,7 +148,7 @@ def test_assign_coilgroup(self, aedtapp): bound = aedtapp.assign_coil(assignment=["Coil","Coil_2", "Coil_4" ]) assert bound assert len(bound['items'])==3 - assert bound.props["PolarityType"] == polarity.lower() + assert bound.props[(list(bound.props.keys())[1])]["PolarityType"] == polarity.lower() def test_create_vector_potential(self, aedtapp): From effff6520652b05f01d9943a634c372de53800f3 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Wed, 5 Nov 2025 12:43:15 +0530 Subject: [PATCH 10/16] 3d-cases --- src/ansys/aedt/core/maxwell.py | 6 ++--- tests/system/general/test_28_Maxwell3D.py | 28 ++++++++++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index 8fff7761c74..52e0e30bb9a 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -1400,17 +1400,17 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name if isinstance(assignment[0], str): if self.modeler._is3d: props = dict( - {"Objects": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} + {"Faces": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} ) bound_type = "CoilTerminal" else: - bound_objects = {"Objects": assignment} + props = {"Faces": assignment} if len(assignment) > 1: coil_group_names = [] bound_props = dict( { - "Objects": assignment, + "Faces": assignment, "Conductor number": str(conductors_number), "PolarityType": polarity.lower(), } diff --git a/tests/system/general/test_28_Maxwell3D.py b/tests/system/general/test_28_Maxwell3D.py index aac6be6f16d..c009289aef4 100644 --- a/tests/system/general/test_28_Maxwell3D.py +++ b/tests/system/general/test_28_Maxwell3D.py @@ -156,7 +156,33 @@ def test_assign_coil(self, m3d_app): bound_name = generate_unique_name("Coil") bound = m3d_app.assign_coil(assignment=face_id, name=bound_name) assert bound_name == bound.name - + + def test_create_coil_group(self, m3d_app): + coil_hole = m3d_app.modeler.create_box([-50, -50, 0], [100, 100, 100], name="Coil_Hole") + coil = m3d_app.modeler.create_box([-100, -100, 0], [200, 200, 100], name="Coil") + m3d_app.modeler.subtract([coil], [coil_hole]) + m3d_app.modeler.section(["Coil"], Plane.ZX) + m3d_app.modeler.separate_bodies(["Coil_Section1"]) + face_id = [m3d_app.modeler["Coil_Section1"].faces[0].id] + bound_name = generate_unique_name("CoilGroup") + bound = m3d_app.assign_coil(assignment=face_id, name=bound_name) + assert bound_name == bound.name + assert bound.props["Conductor number"] == "1" + assert not bound.props["Point out of terminal"] + bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2) + assert bound.props["Conductor number"] == "2" + assert not bound.props["Point out of terminal"] + bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Positive") + assert bound.props["Conductor number"] == "2" + assert not bound.props["Point out of terminal"] + bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Negative") + assert bound.props["Point out of terminal"] + bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Positive") + assert bound.props["Conductor number"] == "2" + assert not bound.props["Point out of terminal"] + bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Negative") + assert bound.props["Conductor number"] == "2" + assert bound.props["Point out of terminal"] def test_create_air_region(self, m3d_app): region = m3d_app.modeler.create_air_region(*[300] * 6) assert region.material_name == "air" From 8a9362166dbd29c9091190f2483466cabcb1c453 Mon Sep 17 00:00:00 2001 From: Garima Chaturvedi Date: Fri, 19 Sep 2025 11:36:26 +0530 Subject: [PATCH 11/16] coil_group --- src/ansys/aedt/core/maxwell.py | 44 +++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index 52e0e30bb9a..ab7808d74c0 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -27,6 +27,7 @@ import io from pathlib import Path import re +import string import time from ansys.aedt.core.application.analysis_3d import FieldAnalysis3D @@ -1399,20 +1400,31 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name if isinstance(assignment[0], str): if self.modeler._is3d: - props = dict( - {"Faces": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} - ) - bound_type = "CoilTerminal" + coil_group_names = [name + f"_{i+1}" for i in range(len(assignment))] + bound_props = { + "Faces": assignment, + "Conductor number": str(conductors_number), + "Point out of terminal": point + } + props = {"items": coil_group_names} + props[coil_group_names[0]] = bound_props.copy() + bound_type = "CoilTerminalGroup" else: - props = {"Faces": assignment} - + props = { + "Faces": assignment, + "Conductor number": str(conductors_number), + "Point out of terminal": point, + } + bound_type = "CoilTerminal" + + if len(assignment) > 1: coil_group_names = [] bound_props = dict( { "Faces": assignment, "Conductor number": str(conductors_number), - "PolarityType": polarity.lower(), + "Point out of terminal": False } ) @@ -1421,9 +1433,9 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name props = {"items": coil_group_names} props[coil_group_names[0]] = bound_props.copy() - - bound_type = "CoilGroup" - + + bound_type = "CoilTerminal" + else: props = dict( @@ -1434,13 +1446,13 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name } ) bound_type = "Coil" + # else: + # if self.modeler._is3d: + # props = dict( + # {"Faces": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} + # ) + # bound_type = "CoilTerminal" else: - if self.modeler._is3d: - props = dict( - {"Faces": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} - ) - bound_type = "CoilTerminal" - else: raise AEDTRuntimeError("Face Selection is not allowed in Maxwell 2D. Provide a 2D object.") return self._create_boundary(name, props, bound_type) From d5213e0258198e1ec49aee4024c0d1a84521a9ab Mon Sep 17 00:00:00 2001 From: Garima Chaturvedi Date: Fri, 31 Oct 2025 18:58:19 +0530 Subject: [PATCH 12/16] Enhance assign_coil method to support coil groups - Modified assign_coil in maxwell.py to handle multiple object assignments as CoilGroup - Updated test_assign_coil_group in test_27_Maxwell2D.py with comprehensive boundary counting validation - Updated test_create_coil_group in test_28_Maxwell3D.py for 3D coil terminal groups - Added proper boundary type validation and object assignment verification --- src/ansys/aedt/core/maxwell.py | 107 +++++++++++++--------- tests/system/general/test_27_Maxwell2D.py | 39 +++++++- tests/system/general/test_28_Maxwell3D.py | 69 +++++++++----- 3 files changed, 141 insertions(+), 74 deletions(-) diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index ab7808d74c0..c683901da23 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -1400,59 +1400,78 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name if isinstance(assignment[0], str): if self.modeler._is3d: - coil_group_names = [name + f"_{i+1}" for i in range(len(assignment))] - bound_props = { - "Faces": assignment, - "Conductor number": str(conductors_number), - "Point out of terminal": point - } - props = {"items": coil_group_names} - props[coil_group_names[0]] = bound_props.copy() - bound_type = "CoilTerminalGroup" - else: - props = { - "Faces": assignment, - "Conductor number": str(conductors_number), - "Point out of terminal": point, - } - bound_type = "CoilTerminal" - - - if len(assignment) > 1: - coil_group_names = [] - bound_props = dict( - { + # For 3D case with multiple faces, create a coil terminal group + if len(assignment) > 1: + coil_group_names = [name + f"_{i+1}" for i in range(len(assignment))] + props = {"items": coil_group_names} + + for i, coil_name in enumerate(coil_group_names): + bound_props = { + "Faces": [assignment[i]], + "Conductor number": str(conductors_number), + "Point out of terminal": point + } + props[coil_name] = bound_props.copy() + + bound_type = "CoilTerminalGroup" + else: + # Single face in 3D + props = { "Faces": assignment, "Conductor number": str(conductors_number), - "Point out of terminal": False + "Point out of terminal": point } - ) - - for x in range(0, len(assignment)): - coil_group_names.append(name + f"_{str(x + 1)}") - - props = {"items": coil_group_names} - props[coil_group_names[0]] = bound_props.copy() - - bound_type = "CoilTerminal" - + bound_type = "CoilTerminal" else: - - props = dict( - { + # 2D case - objects only + if len(assignment) == 1: + # Single object + props = { "Objects": assignment, "Conductor number": str(conductors_number), "PolarityType": polarity.lower(), } - ) - bound_type = "Coil" - # else: - # if self.modeler._is3d: - # props = dict( - # {"Faces": assignment, "Conductor number": str(conductors_number), "Point out of terminal": point} - # ) - # bound_type = "CoilTerminal" + bound_type = "Coil" + else: + coil_group_names = [name + f"_{i+1}" for i in range(len(assignment))] + + # Structure the properties to match the CurrentDensityGroup pattern + common_props = { + "Objects": assignment, + "Conductor number": str(conductors_number), + "PolarityType": polarity.lower(), + } + props = {"items": coil_group_names} + props[coil_group_names[0]] = common_props.copy() + name = coil_group_names[0] + bound_type = "CoilGroup" else: + # Face IDs provided + if self.modeler._is3d: + if len(assignment) > 1: + + boundaries = [] + for i, face_id in enumerate(assignment): + face_name = name + f"_{i+1}" if len(assignment) > 1 else name + face_props = { + "Faces": [face_id], + "Conductor number": str(conductors_number), + "Point out of terminal": point + } + bound = self._create_boundary(face_name, face_props, "CoilTerminal") + if bound: + boundaries.append(bound) + + + return boundaries[0] if boundaries else False + else: + props = { + "Faces": assignment, + "Conductor number": str(conductors_number), + "Point out of terminal": point + } + bound_type = "CoilTerminal" + else: raise AEDTRuntimeError("Face Selection is not allowed in Maxwell 2D. Provide a 2D object.") return self._create_boundary(name, props, bound_type) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 58e3e93fbdc..555d2d26f53 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -143,12 +143,41 @@ def test_assign_coil(self, aedtapp): bound = aedtapp.assign_coil(assignment=["Coil"], name=bound_name) assert bound_name == bound.name - def test_assign_coilgroup(self, aedtapp): - polarity = "Positive" - bound = aedtapp.assign_coil(assignment=["Coil","Coil_2", "Coil_4" ]) + def test_assign_coil_group(self, aedtapp): + o1 = aedtapp.modeler.create_rectangle([0, 0, 0], [3, 1], name="Coil", material="copper") + o2 = aedtapp.modeler.create_rectangle([5, 0, 0], [3, 1], name="Coil_2", material="copper") + o3 = aedtapp.modeler.create_rectangle([10, 0, 0], [3, 1], name="Coil_4", material="copper") + + + initial_boundary_count = len(aedtapp.boundaries) + + + bound = aedtapp.assign_coil(assignment=[o1.name, o2.name, o3.name]) assert bound - assert len(bound['items'])==3 - assert bound.props[(list(bound.props.keys())[1])]["PolarityType"] == polarity.lower() + + + assert bound.type == "CoilGroup" + + + final_boundary_count = len(aedtapp.boundaries) + objects_assigned = [o1.name, o2.name, o3.name] + expected_new_boundaries = len(objects_assigned) # One individual coil boundary per object + assert final_boundary_count == initial_boundary_count + expected_new_boundaries + + + new_boundaries = [b for b in aedtapp.boundaries if b.name.startswith(bound.name.split('_')[0] + '_' + bound.name.split('_')[1])] + coil_group_boundaries = [b for b in new_boundaries if b.type == "CoilGroup"] + individual_coil_boundaries = [b for b in new_boundaries if b.type == "Coil"] + + + assert len(coil_group_boundaries) == 1 + assert len(individual_coil_boundaries) == len(objects_assigned) - 1 + + + coil_props = bound.props[bound.name] + assert set(coil_props["Objects"]) == {o1.name, o2.name, o3.name} + assert coil_props["PolarityType"] == "positive" + assert coil_props["Conductor number"] == "1" def test_create_vector_potential(self, aedtapp): diff --git a/tests/system/general/test_28_Maxwell3D.py b/tests/system/general/test_28_Maxwell3D.py index c009289aef4..61f648992c3 100644 --- a/tests/system/general/test_28_Maxwell3D.py +++ b/tests/system/general/test_28_Maxwell3D.py @@ -158,31 +158,50 @@ def test_assign_coil(self, m3d_app): assert bound_name == bound.name def test_create_coil_group(self, m3d_app): - coil_hole = m3d_app.modeler.create_box([-50, -50, 0], [100, 100, 100], name="Coil_Hole") - coil = m3d_app.modeler.create_box([-100, -100, 0], [200, 200, 100], name="Coil") - m3d_app.modeler.subtract([coil], [coil_hole]) - m3d_app.modeler.section(["Coil"], Plane.ZX) - m3d_app.modeler.separate_bodies(["Coil_Section1"]) - face_id = [m3d_app.modeler["Coil_Section1"].faces[0].id] - bound_name = generate_unique_name("CoilGroup") - bound = m3d_app.assign_coil(assignment=face_id, name=bound_name) - assert bound_name == bound.name - assert bound.props["Conductor number"] == "1" - assert not bound.props["Point out of terminal"] - bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2) - assert bound.props["Conductor number"] == "2" - assert not bound.props["Point out of terminal"] - bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Positive") - assert bound.props["Conductor number"] == "2" - assert not bound.props["Point out of terminal"] - bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Negative") - assert bound.props["Point out of terminal"] - bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Positive") - assert bound.props["Conductor number"] == "2" - assert not bound.props["Point out of terminal"] - bound = m3d_app.assign_coil(assignment=face_id, conductors_number=2, polarity="Negative") - assert bound.props["Conductor number"] == "2" - assert bound.props["Point out of terminal"] + + coil_hole = m3d_app.modeler.create_box([-50, -50, 0], [100, 100, 100], name="Coil_Hole") + coil = m3d_app.modeler.create_box([-100, -100, 0], [200, 200, 100], name="Coil", material="copper") + m3d_app.modeler.subtract([coil], [coil_hole]) + m3d_app.modeler.section(["Coil"], Plane.ZX) + m3d_app.modeler.separate_bodies(["Coil_Section1"]) + face_id = [m3d_app.modeler["Coil_Section1"].faces[0].id] + bound_name = generate_unique_name("CoilTerminal") + bound = m3d_app.assign_coil(assignment=face_id, name=bound_name) + assert bound_name == bound.name + assert bound.props["Conductor number"] == "1" + assert not bound.props["Point out of terminal"] + coil2 = m3d_app.modeler.create_box([50, 50, 0], [50, 50, 50], name="Coil2", material="copper") + coil3 = m3d_app.modeler.create_box([120, 120, 0], [50, 50, 50], name="Coil3", material="copper") + face_ids = [m3d_app.modeler["Coil_Section1"].faces[0].id, + coil2.faces[0].id, + coil3.faces[0].id] + + + initial_boundary_count = len(m3d_app.boundaries) + + bound = m3d_app.assign_coil(assignment=face_ids) + assert bound + + + assert bound.type == "CoilTerminal" + + final_boundary_count = len(m3d_app.boundaries) + expected_new_boundaries = len(face_ids) + assert final_boundary_count == initial_boundary_count + expected_new_boundaries + + + new_boundaries = [b for b in m3d_app.boundaries if b.name.startswith(bound.name.split('_')[0] + '_' + bound.name.split('_')[1])] + individual_terminal_boundaries = [b for b in new_boundaries if b.type == "CoilTerminal"] + + + assert len(individual_terminal_boundaries) == len(face_ids) + + + assert bound.props["Conductor number"] == "1" + assert not bound.props["Point out of terminal"] + assert bound.props["Faces"] == [face_ids[0]] + + def test_create_air_region(self, m3d_app): region = m3d_app.modeler.create_air_region(*[300] * 6) assert region.material_name == "air" From 5672fc9f41965eaa3f373cbd64a551853ffb6d2b Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Wed, 5 Nov 2025 12:50:14 +0530 Subject: [PATCH 13/16] test-cases-passed --- tests/system/general/test_27_Maxwell2D.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 555d2d26f53..3858ca8bc75 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -307,17 +307,6 @@ def test_delete_motion_setup(self, aedtapp): assert len(aedtapp.boundaries_by_type["Band"])==1 - - def test_delete_motion_setup(self, aedtapp): - aedtapp.xy_plane = True - aedtapp.modeler.create_circle([0, 0, 0], 10, name="Circle_inner") - aedtapp.modeler.create_circle([0, 0, 0], 30, name="Circle_outer") - bound = aedtapp.assign_rotate_motion("Circle_outer", positive_limit=300, mechanical_transient=True) - assert bound - assert len(aedtapp.boundaries_by_type["Band"]) == 2 - bound.delete() - assert len(aedtapp.boundaries_by_type["Band"]) == 1 - def test_change_inductance_computation(self, aedtapp): assert aedtapp.change_inductance_computation() assert aedtapp.change_inductance_computation(True, False) From 2e9eb4a03feb2490ef06390a89d1358c3f53b704 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pallapati Date: Wed, 5 Nov 2025 12:54:13 +0530 Subject: [PATCH 14/16] test-3 --- tests/system/general/test_27_Maxwell2D.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 3858ca8bc75..6f892daee3f 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -291,9 +291,6 @@ def test_assign_movement(self, aedtapp): assert bound assert bound.props["PositivePos"] == "300deg" assert bound.props["Objects"][0] == "Circle_outer" - assert len(aedtapp.boundaries_by_type["Band"]) == 2 - bound.delete() - assert len(aedtapp.boundaries_by_type["Band"]) == 1 def test_delete_motion_setup(self, aedtapp): From 3cbe5f62da8365a53b1cffb4c6220be9ef1de49e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 07:27:19 +0000 Subject: [PATCH 15/16] CHORE: Auto fixes from pre-commit hooks --- src/ansys/aedt/core/maxwell.py | 28 +++++++++----------- tests/system/general/test_27_Maxwell2D.py | 30 ++++++++-------------- tests/system/general/test_28_Maxwell3D.py | 31 ++++++++++------------- 3 files changed, 36 insertions(+), 53 deletions(-) diff --git a/src/ansys/aedt/core/maxwell.py b/src/ansys/aedt/core/maxwell.py index c683901da23..0971358ffb2 100644 --- a/src/ansys/aedt/core/maxwell.py +++ b/src/ansys/aedt/core/maxwell.py @@ -27,7 +27,6 @@ import io from pathlib import Path import re -import string import time from ansys.aedt.core.application.analysis_3d import FieldAnalysis3D @@ -1402,24 +1401,24 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name if self.modeler._is3d: # For 3D case with multiple faces, create a coil terminal group if len(assignment) > 1: - coil_group_names = [name + f"_{i+1}" for i in range(len(assignment))] + coil_group_names = [name + f"_{i + 1}" for i in range(len(assignment))] props = {"items": coil_group_names} - + for i, coil_name in enumerate(coil_group_names): bound_props = { "Faces": [assignment[i]], "Conductor number": str(conductors_number), - "Point out of terminal": point + "Point out of terminal": point, } props[coil_name] = bound_props.copy() - + bound_type = "CoilTerminalGroup" else: # Single face in 3D props = { "Faces": assignment, "Conductor number": str(conductors_number), - "Point out of terminal": point + "Point out of terminal": point, } bound_type = "CoilTerminal" else: @@ -1433,8 +1432,8 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name } bound_type = "Coil" else: - coil_group_names = [name + f"_{i+1}" for i in range(len(assignment))] - + coil_group_names = [name + f"_{i + 1}" for i in range(len(assignment))] + # Structure the properties to match the CurrentDensityGroup pattern common_props = { "Objects": assignment, @@ -1443,39 +1442,36 @@ def assign_coil(self, assignment, conductors_number=1, polarity="Positive", name } props = {"items": coil_group_names} props[coil_group_names[0]] = common_props.copy() - name = coil_group_names[0] + name = coil_group_names[0] bound_type = "CoilGroup" else: # Face IDs provided if self.modeler._is3d: if len(assignment) > 1: - boundaries = [] for i, face_id in enumerate(assignment): - face_name = name + f"_{i+1}" if len(assignment) > 1 else name + face_name = name + f"_{i + 1}" if len(assignment) > 1 else name face_props = { "Faces": [face_id], "Conductor number": str(conductors_number), - "Point out of terminal": point + "Point out of terminal": point, } bound = self._create_boundary(face_name, face_props, "CoilTerminal") if bound: boundaries.append(bound) - - + return boundaries[0] if boundaries else False else: props = { "Faces": assignment, "Conductor number": str(conductors_number), - "Point out of terminal": point + "Point out of terminal": point, } bound_type = "CoilTerminal" else: raise AEDTRuntimeError("Face Selection is not allowed in Maxwell 2D. Provide a 2D object.") return self._create_boundary(name, props, bound_type) - @pyaedt_function_handler(input_object="assignment", reference_cs="coordinate_system") def assign_force(self, assignment, coordinate_system="Global", is_virtual=True, force_name=None): diff --git a/tests/system/general/test_27_Maxwell2D.py b/tests/system/general/test_27_Maxwell2D.py index 6f892daee3f..cdf6fe1ce60 100644 --- a/tests/system/general/test_27_Maxwell2D.py +++ b/tests/system/general/test_27_Maxwell2D.py @@ -148,37 +148,33 @@ def test_assign_coil_group(self, aedtapp): o2 = aedtapp.modeler.create_rectangle([5, 0, 0], [3, 1], name="Coil_2", material="copper") o3 = aedtapp.modeler.create_rectangle([10, 0, 0], [3, 1], name="Coil_4", material="copper") - initial_boundary_count = len(aedtapp.boundaries) - - + bound = aedtapp.assign_coil(assignment=[o1.name, o2.name, o3.name]) assert bound - assert bound.type == "CoilGroup" - - + final_boundary_count = len(aedtapp.boundaries) objects_assigned = [o1.name, o2.name, o3.name] expected_new_boundaries = len(objects_assigned) # One individual coil boundary per object assert final_boundary_count == initial_boundary_count + expected_new_boundaries - - - new_boundaries = [b for b in aedtapp.boundaries if b.name.startswith(bound.name.split('_')[0] + '_' + bound.name.split('_')[1])] + + new_boundaries = [ + b + for b in aedtapp.boundaries + if b.name.startswith(bound.name.split("_")[0] + "_" + bound.name.split("_")[1]) + ] coil_group_boundaries = [b for b in new_boundaries if b.type == "CoilGroup"] individual_coil_boundaries = [b for b in new_boundaries if b.type == "Coil"] - - + assert len(coil_group_boundaries) == 1 assert len(individual_coil_boundaries) == len(objects_assigned) - 1 - coil_props = bound.props[bound.name] assert set(coil_props["Objects"]) == {o1.name, o2.name, o3.name} assert coil_props["PolarityType"] == "positive" assert coil_props["Conductor number"] == "1" - def test_create_vector_potential(self, aedtapp): region = aedtapp.modeler["Region"] @@ -229,8 +225,6 @@ def test_assign_force(self, aedtapp): force = aedtapp.assign_force(assignment="Magnet2_Section1", force_name="Force_Test") assert force.name == "Force_Test" - - def test_assign_current_source(self, m2d_app): coil = m2d_app.modeler.create_circle( position=[0, 0, 0], radius=5, num_sides="8", is_covered=True, name="Coil", material="Copper" @@ -292,17 +286,15 @@ def test_assign_movement(self, aedtapp): assert bound.props["PositivePos"] == "300deg" assert bound.props["Objects"][0] == "Circle_outer" - def test_delete_motion_setup(self, aedtapp): aedtapp.xy_plane = True aedtapp.modeler.create_circle([0, 0, 0], 10, name="Circle_inner") aedtapp.modeler.create_circle([0, 0, 0], 30, name="Circle_outer") bound = aedtapp.assign_rotate_motion("Circle_outer", positive_limit=300, mechanical_transient=True) assert bound - assert len(aedtapp.boundaries_by_type["Band"])==2 + assert len(aedtapp.boundaries_by_type["Band"]) == 2 bound.delete() - assert len(aedtapp.boundaries_by_type["Band"])==1 - + assert len(aedtapp.boundaries_by_type["Band"]) == 1 def test_change_inductance_computation(self, aedtapp): assert aedtapp.change_inductance_computation() diff --git a/tests/system/general/test_28_Maxwell3D.py b/tests/system/general/test_28_Maxwell3D.py index 61f648992c3..251b4f76a6e 100644 --- a/tests/system/general/test_28_Maxwell3D.py +++ b/tests/system/general/test_28_Maxwell3D.py @@ -156,9 +156,8 @@ def test_assign_coil(self, m3d_app): bound_name = generate_unique_name("Coil") bound = m3d_app.assign_coil(assignment=face_id, name=bound_name) assert bound_name == bound.name - + def test_create_coil_group(self, m3d_app): - coil_hole = m3d_app.modeler.create_box([-50, -50, 0], [100, 100, 100], name="Coil_Hole") coil = m3d_app.modeler.create_box([-100, -100, 0], [200, 200, 100], name="Coil", material="copper") m3d_app.modeler.subtract([coil], [coil_hole]) @@ -172,35 +171,31 @@ def test_create_coil_group(self, m3d_app): assert not bound.props["Point out of terminal"] coil2 = m3d_app.modeler.create_box([50, 50, 0], [50, 50, 50], name="Coil2", material="copper") coil3 = m3d_app.modeler.create_box([120, 120, 0], [50, 50, 50], name="Coil3", material="copper") - face_ids = [m3d_app.modeler["Coil_Section1"].faces[0].id, - coil2.faces[0].id, - coil3.faces[0].id] - - + face_ids = [m3d_app.modeler["Coil_Section1"].faces[0].id, coil2.faces[0].id, coil3.faces[0].id] + initial_boundary_count = len(m3d_app.boundaries) - + bound = m3d_app.assign_coil(assignment=face_ids) assert bound - assert bound.type == "CoilTerminal" - + final_boundary_count = len(m3d_app.boundaries) - expected_new_boundaries = len(face_ids) + expected_new_boundaries = len(face_ids) assert final_boundary_count == initial_boundary_count + expected_new_boundaries - - - new_boundaries = [b for b in m3d_app.boundaries if b.name.startswith(bound.name.split('_')[0] + '_' + bound.name.split('_')[1])] + + new_boundaries = [ + b + for b in m3d_app.boundaries + if b.name.startswith(bound.name.split("_")[0] + "_" + bound.name.split("_")[1]) + ] individual_terminal_boundaries = [b for b in new_boundaries if b.type == "CoilTerminal"] - assert len(individual_terminal_boundaries) == len(face_ids) - assert bound.props["Conductor number"] == "1" assert not bound.props["Point out of terminal"] - assert bound.props["Faces"] == [face_ids[0]] - + assert bound.props["Faces"] == [face_ids[0]] def test_create_air_region(self, m3d_app): region = m3d_app.modeler.create_air_region(*[300] * 6) From efd2fa72807f95606bcba51ec6528b6c8da0f27d Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 5 Nov 2025 07:29:53 +0000 Subject: [PATCH 16/16] chore: adding changelog file 6855.added.md [dependabot-skip] --- doc/changelog.d/6855.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/6855.added.md diff --git a/doc/changelog.d/6855.added.md b/doc/changelog.d/6855.added.md new file mode 100644 index 00000000000..070dc41e6ab --- /dev/null +++ b/doc/changelog.d/6855.added.md @@ -0,0 +1 @@ +Assign coil group