Hi,
I’m new to this forum and also learning NGSolve.
I had a very basic set of questions:
In examples that I have seen, one can create geometry by declaring an object and then add items to it. This object then can be referred to for meshing, etc. My query is if I import geometry from an external STEP file, with what name this geometry is available for further operations.
Similarly when I generate a mesh using the GUI, with what name I can access the mesh when writing python commands for further operations.
Please let me know if my query is clear enough. I tried to understand the above steps but could not find a resolution on my own. Many thanks for your help…
I tried below commands and received an error:
####################
import netgen.gui
%gui tk
from ngsolve.solve import Draw, Redraw # just for visualization
from netgen import NgOCC
geo = NgOCC.LoadOCCGeometry(“191_SD_Flat.stp”)
To generate a mesh from your geometry and see the mesh and geometry in Netgen, you can do something like this:
[code]import netgen.gui
%gui tk
from netgen import NgOCC
geo = NgOCC.LoadOCCGeometry(“191_SD_Flat.stp”)
msh = geo.GenerateMesh()
[/code]
It may take a couple minutes to generate the mesh. Once the mesh is complete, you can select Geometry or Mesh in the Netgen GUI to see the result. You can also control the maximum element dimension by
msg = geo.GenerateMesh(maxh=0.5)