January 18, 2023 at 4:13 pmmartinmiSubscriber
Hallo all, i ihave a problem when i try to use the addplanarsolid() function in python. I first create vtx and an cell array a like:
vtx = np.array([[0,0,0], [1e-6,0,0], [1e-6,1e-6,0], [0,1e-6,0], [0,0,1e-6], [1e-6,0,1e-6], [1e-6,1e-6,1e-6], [0,1e-6,1e-6]])
a = np.array([[1,4,3,2], [1,2,6,5], [2,3,7,6], [3,4,8,7], [1,5,8,4], [5,6,7,8]])
The result that i am getting is:
I saw that some other users have the same problem, so if any Admin know how to resolve the problem,
please post an example code.
I tested the same structure with ,lsf script and it was working perfectly. The Problem is when i try to add addplanarsolid with Python.
January 25, 2023 at 5:40 pmTaylor RobertsonAnsys Employee
It seems to me that the list of facets would be problem. This should be a list of np.arrays, with each entry correnponding to a single facet. Not an NP array of the facets.
The following are methods of a session handle, so they should be used like fdtd.addplanersolid(),
I would suggest using putv and compare vtx and a between the API and lsf methods. However if you have a method that works in lsf pehaps you can just use fdtd.eval('' lsf script'')
January 26, 2023 at 4:22 pmmartinmiSubscriber
Thanks for the reply! After many tries I just found the right data type for the facets. So if someone creates a planarsolid object with Python, the vertices and facets should be defined as follows:
- vtx = np.array([[0,0,0], [1e-6,0,0], [1e-6,1e-6,0], [0,1e-6,0], [0,0,1e-6], [1e-6,0,1e-6], [1e-6,1e-6,1e-6], [0,1e-6,1e-6]])
- a = [[np.array([[1,4,3,2]], dtype = object)], [np.array([[1,5,8,4]], dtype = object)], [np.array([[1,2,6,5]], dtype = object)], [np.array([[2,6,7,3]], dtype = object)], [np.array([[3,4,8,7]], dtype = object)], [np.array([[5,6,7,8]], dtype = object)]]
After that, as you have already mentioned, you need(can) pass the facets and vertices to Lumerical Workspace:
And then use lum.addplanarsolid(vtx,a),
I have run into another problem, this time I think it is more of a problem with the Lumerical Visualization option. So after I create the structure I want, for example a taper, I can't see one of the sides of the taper. Then when I rotate the object in Lumerical, some of the sides of the taper disappear in a certain position and then come back after I rotate the object back. Do you know if this is a problem that could affect my simulation results or is it more of a Lumerical Visualization problem? I have attached some photos that I took while rotating my taper. All the pictures are from the same object, but taken from a different object rotation angle.
- 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.
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?
- Error on Lumerical device
- Using a license file on a new license server
- Error: addfdtd is not a valid function or a variable name
- Ansys Insight: Diverging Simulations
- Ansys Insight: Transmission results greater than one
- Ansys Insight: About override mesh in FDTD: its use and settings
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- Ansys Insight: Convergence issues in CHARGE
© 2023 Copyright ANSYS, Inc. All rights reserved.