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
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Using a license file on a new license server
- Ansys Insight: Diverging Simulations
- Error: addfdtd is not a valid function or a variable name
- Error on Lumerical device
- Questions about the calculation of the cross-polarization conversion efficiency of metasurface
- Ansys Insight: About override mesh in FDTD: its use and settings
- Finding your Ansys (or Lumerical) account number
- Lumerical – error message when trying to open from Linux terminal
-
7626
-
4456
-
2955
-
1427
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.