facecoding error

More
7 years 3 weeks ago #218 by f_m_tassone@yahoo.it
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
More
7 years 3 weeks ago #219 by cwinters
Replied by cwinters on topic facecoding error
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.
Code:
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.
Code:
geom.Append([...],hpref=1)
After converting the mesh to an ngsolve mesh you can call the RefineHP function like this:
Code:
mesh = ngsolve.Mesh(ngmesh) mesh.RefineHP(levels=3,factor=0.5)

Regards,
Christoph
The following user(s) said Thank You: f_m_tassone@yahoo.it
Time to create page: 0.092 seconds