Loading .vol files

Hello,

What is the proper way to load .vol files on NGSolve and then create a mesh? I built a geometry from scratch using CSG but when I save it and try to load it and mesh, it crashes. I even tried loading and meshing with the sample geometries from the documentation, but it still crashes.

Can somebody explain why it crashes or what the proper python code should be?

Thank you very much,
Irving

Hey Irving,

the following code creates an arbitrary geometry and saves it. Further, it deletes all according variables and loads it again. Works fine for me.

I hope that answers your question!

Cheers,
val

[code]from ngsolve import *
from netgen.csg import *

cube = OrthoBrick( Pnt(0,0,0), Pnt(1,1,1) )
hole = Cylinder ( Pnt(0.5, 0.5, 0), Pnt(0.5, 0.5, 1), 0.2)

geo = CSGeometry()
geo.Add (cube-hole)
mesh = geo.GenerateMesh(maxh=0.1)
mesh.Save(“cube_hole.vol”)

del geo, mesh, hole, cube

mesh = Mesh(“cube_hole.vol”)

import netgen.gui
Draw(mesh)
input()
[/code]