-
-
May 16, 2023 at 1:29 pm
Mickael Aelbrecht
SubscriberHello everyone!
I would like to write a script to automatically set up a coated sphere. Unfortunately, I couldn't find any information on how to write that. Before, I used "addsphere" for example. But now that I want ellipses, I don't know how to script it. Can you help me?
Thanks a lot!
-
May 16, 2023 at 4:32 pm
Amrita Pati
Ansys EmployeeHi Mickael,
Once you create the the sphere, you can use the following code for creating an ellipsoid:setnamed("sphere","make ellipsoid",true);
setnamed("sphere","radius",0.5e-6);
setnamed("sphere","radius 2",1e-6);
The semi-major and semi-minor axis are defined by radius and radius 2. Please let me know if you have any other questions.Regards,
Amrita -
May 16, 2023 at 5:22 pm
Mickael Aelbrecht
SubscriberHi Amrita,
I'm sorry but I'm not sure that you understood my problem correctly. I need to create a coated ellipse. The fact is that I know how to create a sphere, an ellipsoid or even a coated ellipse by hand but I need to place a coated ellipse automatically using a script. How can I manage to create it and to modify it only using script ?Thanks a lot for your previous answer though.
Regards,
Mickaël Aelbrecht
-
May 16, 2023 at 6:10 pm
Amrita Pati
Ansys EmployeeHi Mickaël,
Let's say you have a SiO2 coated Au ellipsoid. If the thickness of the coat is fixed, then it could be simply done by creating two ellipsoids and changing their mesh orders. If the central ellipsoid has a lower mesh order than the coating, then in the overlapping regions, the central ellipsoid will take priority. Assuming that the thickness of the coat is 250 nm and the ellipsoid is placed at the origin (0,0,0), then you can use the following code:addsphere;
set("name","central");
setnamed("central","make ellipsoid",true);
setnamed("central","x",0e-6);
setnamed("central","y",0e-6);
setnamed("central","z",0e-6);
setnamed("central","radius",0.5e-6);
setnamed("central","radius 2",1e-6);
setnamed("central","radius 3",1e-6);
setnamed("central","material","Au (Gold) - Johnson and Christy");
######
addsphere;
set("name","coat");
setnamed("coat","make ellipsoid",true);
setnamed("coat","x",0e-6);
setnamed("coat","y",0e-6);
setnamed("coat","z",0e-6);
setnamed("coat","radius",0.75e-6);
setnamed("coat","radius 2",1.25e-6);
setnamed("coat","radius 3",1.25e-6);
setnamed("coat","material","SiO2 (Glass) - Palik");
setnamed("coat","override mesh order from material database",true);
setnamed("coat","mesh order",3);
setnamed("coat","override color opacity from material database",true);
setnamed("coat","alpha",0.5);
Here, by default, the mesh order of "central" is 2 and I have changed the mesh order of "coat" to 3. So, you effectively have a gold ellipsoid that is coated by 250 nm of SiO2 (index preview from the index monitor shown below).
Please let me know if I missed something.
Regards,
Amrita
-
- 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.
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- “Import optical generation” or “delta generation rate”?
- Error: addfdtd is not a valid function or a variable name
- Error on Lumerical device
- Using a license file on a new license server
- Ansys Insight: Transmission results greater than one
- Ansys Insight: Diverging Simulations
- Finding your Ansys (or Lumerical) account number
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- Ansys Insight: Why my simulation result is different from published paper or experiment?
-
5290
-
3311
-
2469
-
1308
-
1016
© 2023 Copyright ANSYS, Inc. All rights reserved.