assign_master_slave#
- Maxwell2d.assign_master_slave(independent, dependent, reverse_master=False, reverse_slave=False, same_as_master=True, boundary=None)#
Assign dependent and independent boundary conditions to two edges of the same object.
- Parameters:
- independent
int
ID of the master edge.
- dependent
int
ID of the slave edge.
- reverse_masterbool,
optional
Whether to reverse the master edge to the V direction. The default is
False
.- reverse_slavebool,
optional
Whether to reverse the master edge to the U direction. The default is
False
.- same_as_masterbool,
optional
Whether the B-Field of the slave edge and master edge are the same. The default is
True
.- boundary
str
,optional
Name of the master boundary. The default is
None
, in which case the default name is used. The name of the slave boundary has a_dep
suffix.
- independent
- Returns:
ansys.aedt.core.modules.boundary.common.BoundaryObject
,ansys.aedt.core.modules.boundary.common.BoundaryObject
Master and slave objects. If the method fails to execute it returns
False
.
References
>>> oModule.AssignIndependent >>> oModule.AssignDependent
Examples
Create a rectangle, assign dependent and independent boundary conditions to its two edges.
>>> from ansys.aedt.core import Maxwell2d >>> m2d = Maxwell2d() >>> m2d.modeler.create_rectangle([1, 1, 1], [3, 1], name="Rectangle1", material="copper") >>> mas, slave = m2d.assign_master_slave( >>> independent=m2d.modeler["Rectangle1"].edges[0].id, >>> dependent=m2d.modeler["Rectangle1"].edges[2].id >>> ) >>> m2d.release_desktop(True, True)