Closed OmarZaki96 closed 3 months ago
@OmarZaki96 what you are missing here is that you called a TUI command, which sends the result to the console/transcript. In other words, It does not return the mesh_size()
, it instead just prints that output, for example:
>>> return_value = meshing.tui.report.mesh_size()
number of boundary nodes = 2814
number of boundary edges = 506
number of boundary faces = 4612
>>> print(return_value)
True
This is not a bug, I would classify this as a feature/improvement request instead. Considering this is a TUI command, and I don't think we have a Settings API equivalent for this command at this time, we could consider adding Settings API equivalent or similar that returns e.g. a dictionary with the mesh size results (and does not print to the console).
@OmarZaki96, actually tui commands does not return anything. Calling meshing.tui.report.mesh_size() prints the data like @raph-luc mentioned.
There is a scheme call which can be used to retrieve these values which you can use now. mesh_size = meshing.scheme_eval.scheme_eval("(%tg-length-of-entity-list)")
This returns the entire list: [51301, 0, 83476, 17264, 13260, 300, 4800]
Thanks @raph-luc and @prmukherj, for your help. I tried the code and it worked!
I am going to close the issue since I think it is not needed anymore; Please open again if you still want to put it in the todo list
π Before submitting the issue
π Description of the bug
I am trying to get some statistics on the mesh (specifically the mesh size), but I am unable to do this. I am using the following method:
meshing.tui.report.mesh_size()
but it returns an empty string.
is there something wrong with the method? is there another method?
π Steps to reproduce
π» Which operating system are you using?
Windows
π Which ANSYS version are you using?
2024R1
π Which Python version are you using?
3.10
π¦ Installed packages