I’m trying to manually build a 2D anisotropic mesh for BL,
so I’ m starting my homework from the mesh building example in ngspy tutorial,
but I get a
has no facedecoding: fd.size = 0, ind = 1
error on the Element2D add operation.
Installation on Ubuntu 16.04 LTS from repository as suggested.
thanks for help
Hi,
you have to add a FaceDescriptor before you can add 2D elements (a 2D mesh is handled as a single face).
When adding a FaceDescriptor you get it’s number as return value. Use this value as first argument of your Element2D.
fd = ngmesh.Add (FaceDescriptor(surfnr=1,domin=1,bc=1))
ngmesh.Add(Element2D(fd,[...]))
You could also use an hp-refinement when generating a SplineGeometry from python. If you append a segment to your geometry, just add “hpref=1” to mark the segment.
geom.Append([...],hpref=1)
After converting the mesh to an ngsolve mesh you can call the RefineHP function like this:
mesh = ngsolve.Mesh(ngmesh)
mesh.RefineHP(levels=3,factor=0.5)
Regards,
Christoph