Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added docstring example to assign_force #3667

Merged
merged 6 commits into from
Sep 29, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pyaedt/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,10 +1227,30 @@ def assign_force(self, input_object, reference_cs="Global", is_virtual=True, for
bool
``True`` when successful, ``False`` when failed.


References
----------

>>> oModule.AssignForce

Examples
--------

Assign virtual to force to a magnetic object:
IreneWoyna marked this conversation as resolved.
Show resolved Hide resolved

>>> iron_object = m3d.modeler.create_box([0, 0, 0], [2, 10, 10], name="iron")
>>> magnet_object = m3d.modeler.create_box([10, 0, 0], [2, 10, 10], name="magnet")
>>> m3d.assign_material(iron_object, "iron")
>>> m3d.assign_material(magnet_object, "NdFe30")
>>> m3d.assign_force("iron", force_name="force_iron", is_virtual=True)

Assign Lorentz force to a conductor:

>>> conductor1 = m3d.modeler.create_box([0, 0, 0], [1, 1, 10], name="conductor1")
>>> conductor2 = m3d.modeler.create_box([10, 0, 0], [1, 1, 10], name="conductor2")
>>> m3d.assign_material(conductor1, "copper")
>>> m3d.assign_material(conductor2, "copper")
>>> m3d.assign_force("conductor1", force_name="force_copper", is_virtual=False) # conductor, use Lorentz force
"""
if self.solution_type not in ["ACConduction", "DCConduction"]:
input_object = self.modeler.convert_to_selections(input_object, True)
Expand Down
Loading