Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

facecoding error

More
6 years 5 months 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
6 years 5 months 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.118 seconds