-
-
July 6, 2023 at 7:57 pm
nina.megier
SubscriberI am trying to set first two modes for the port with a code
fdtd.addport()fdtd.set("name","output_port")fdtd.set("x",3*unit)fdtd.set("x span",0*unit)fdtd.set("y",2*unit)fdtd.set("y span",3*unit)fdtd.set("z",0*unit)fdtd.set("z span",2*unit)fdtd.set('mode selection',(1,2))which does not work. I have tried also with [1,2], without success. How can I reach this?Setting only one mode works perfectly fine, with, eg.fdtd.set('mode selection','fundamental TM mode') -
July 6, 2023 at 10:55 pm
Devika Padmakumar Nair
Ansys Employee -
July 7, 2023 at 4:27 am
nina.megier
SubscriberActually, I get with
fdtd.updateportmodes(1,2)an error:
lumapi.LumApiError: “argument list for the updateportmode is incorrect – updateportmodes arguments were converted to (‘int, ‘int)”
fdtd.updateportmodes([1,2]) also does not work with an error:”lumapi.LumApiError: ‘argument list for the updateportmode is incorrect – updateportmodes arguments were converted to (cell array)'” -
July 7, 2023 at 5:16 am
nina.megier
SubscriberI have solved the issue, one should use
fdtd.set('mode selection','user select')fdtd.set("selected mode numbers",np.array([1,2])) -
July 7, 2023 at 6:37 am
Devika Padmakumar Nair
Ansys EmployeeHello Nina, thanks for the update.
We cab also use:
fdtd.updateportmodes(np.array([1,2]))https://optics.ansys.com/hc/en-us/articles/360034409174
https://optics.ansys.com/hc/en-us/articles/360043683873-lumapi-getv-Python-API-method
-
Viewing 4 reply threads
- The topic ‘set modes in python’ is closed to new replies.
Ansys Innovation Space
Trending discussions
Top Contributors
-
3190
-
1024
-
962
-
858
-
798
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.