TAGGED: 3DFDTD, adduserprop, fdtd, lumerical, properties
-
-
July 26, 2023 at 5:22 pm
-
July 26, 2023 at 6:25 pm
Amrita Pati
Ansys EmployeeHello,
Please refer to the following link and let me know if you have any questions:Structure Group.
Regards,
Amrita -
July 26, 2023 at 7:04 pm
-
July 26, 2023 at 7:56 pm
Amrita Pati
Ansys EmployeeHello,
Thanks for sharing more information. Would you be able to copy and paste the script (instead of screenshots) in your response? This would allow me to test the script much faster.Regards,
Amrita -
July 26, 2023 at 10:49 pm
minusunny
Subscriberaddstructuregroup; adduserprop("coremat",5,"Si (Silicon) - Palik"); adduserprop("submat",5,"SiO2 (Glass) - Palik"); adduserprop("N_wg",0,60); adduserprop("W_1",2,6e-06); adduserprop("W_2",2,12e-06); adduserprop("wg_width",2,1.7e-06); adduserprop("T",2,0.22e-06); adduserprop("period",2,222e-09); adduserprop("dc",0,0.5); adduserprop("lambda",2,1.55e-06); simtime = 70000e-15; start = 0e-06; myscript = " for(i = 1:N) { stop = start + period; edge = stop - dc*period; addlen = (W_2-W_1)/N; addrect; set('name','seg_multimode'+num2str(i)); set('x max',stop); set('x min',edge); set('y',0); set('y span',W_1+addlen*i); set('z',0); set('z span',T); set('material',coremat); addtogroup('rect'); start = stop; } \n"; #myscript = myscript + "set(\"N"\",N);"; #myscript = myscript + "set(\"N_wg"\",N_wg);"; #myscript = myscript + "set(\"y span"\",W_1);"; #myscript = myscript + "set(\"W_2"\",W_2);"; myscript = myscript + "set(\"z span"\",T);"; myscript = myscript + "set(\"material"\",coremat);"; -
July 27, 2023 at 8:12 pm
Amrita Pati
Ansys EmployeeHi,
Thank you for sharing your code. Here is the modified version. Please let me know in case it does not work.
addstructuregroup;
adduserprop("coremat",5,"Si (Silicon) - Palik");
adduserprop("submat",5,"SiO2 (Glass) - Palik");
adduserprop("N_wg",0,60);
adduserprop("W_1",2,6e-06);
adduserprop("W_2",2,12e-06);
adduserprop("wg_width",2,1.7e-06);
adduserprop("T",2,0.22e-06);
adduserprop("period",2,222e-09);
adduserprop("dc",0,0.5);
adduserprop("lambda",2,1.55e-06);
simtime = 70000e-15; start = 0e-06;
Â
myscript = " for(i = 1:N)
{
stop = start + period;
edge = stop - dc*period;
addlen = (W_2-W_1)/N;
addrect; set('name','seg_multimode'+num2str(i));
set('x max',stop);
set('x min',edge);
set('y',0);
set('y span',W_1+addlen*i);
set('z',0);
set('z span',T);
set('material',coremat);
addtogroup('rect'); start = stop; } \n";
Â
Â
#myscript = myscript + "set(\"N"\",N);";
#myscript = myscript + "set(\"N_wg"\",N_wg);";
#myscript = myscript + "set(\"y span"\",W_1);";
#myscript = myscript + "set(\"W_2"\",W_2);";
myscript = myscript + "set(\"z span\",T);";
myscript = myscript + "set(\"material\",coremat);";
Â
Â
set('script',myscript);
Regards,
Amrita -
July 27, 2023 at 8:51 pm
-
July 27, 2023 at 9:40 pm
-
July 27, 2023 at 10:01 pm
-
July 27, 2023 at 10:03 pm
Amrita Pati
Ansys EmployeeThat is beacause you haven’t assigned any value to N before using it in the for loop. I also do not see N being input as a user property in the code.
Regards,
AmritaÂ
-
July 27, 2023 at 10:34 pm
-
July 28, 2023 at 4:45 pm
minusunny
SubscriberI figured it out. It was indentation error
-
- The topic ‘Script for group analysis and parameters’ is closed to new replies.
-
3477
-
1057
-
1051
-
945
-
912
© 2025 Copyright ANSYS, Inc. All rights reserved.