Hi everyone!
I’m experimenting with the HPRefinement function in Netgen.
In particular, I’m trying to construct a Powell-Sabin split. To achieve this I’ve constructed a new refinement reference triangle, i.e.

int reftrig_Powell_splitedges[][3] =
  { 1, 2, 4 },
  { 2, 3, 5 },
  { 3, 1, 6 },
  { 0, 0, 0 },
int reftrig_Powell_splitfaces[][4] =
  { 1, 2, 3, 7 },
  { 0, 0, 0, 0 }

HPREF_ELEMENT_TYPE reftrig_Powell_newelstypes[] =
int reftrig_Powell_newels[][8] =
  { 1, 4, 7 }, 
  { 4, 2, 7 }, 
  { 2, 5, 7 },
  { 5, 3, 7 },
  { 3, 6, 7 },
  { 6, 1, 7 },
HPRef_Struct reftrig_Powell =

Now the structure I get out is more or less correct, but I don’t understand why the edge splits don’t match across two elements.
Any ideas?

Hi Umberto,

It looks like it is due to that line, which we should certainly remove:


So removing L679 seem to create some issues with face splits, for example, it broke the Alfeld split. I’ve introduced a similar quantity known as fac2 to solve this issue. Now the Powell-Sabin refinement works ! I’ve opened a merge request in the TU Gitlab :slight_smile:

thanks Umberto, is merged and will be in the coming nightly,

I tested the Powell-Sabin mesh and the mesh that comes looks great! Yet I think something is off with the new vertex label, in fact, if I try to solve the Poisson equation I get something absolutely wrong. I don’t understand what is going wrong tho because with the Alfeld split coded in the same way everything works. Any idea of what I could have done wrong?

can you share the example?

Sure !
test_powellsabin.py (875 Bytes)

fixed and committed, Joachim

1 Like

I think you posted the wrong image, it actually looks good now :wink:

1 Like

yes sure, thanks, I just found the “first_problem_solved” picture more interesting, and it clearly tells what was the second problem :slight_smile:

May I ask what were the first and second issues ?

the Powell-Sabin split was implemented via hp-Refinement (by you).

New vertices are defined by a weighted partitioning of edges. Shared vertices between two elements are identified by indices of the end-points. While the ordering of the end-points coincide by the “traditional” use of the hp-refinement, this was not the case here. Solution: When the new point is in the middle of the edge, identify them independently of ordering of old vertices.

Problem 2: Boundary elements (segments) were not refined. Thus, the Dirichlet-flag was set only for original vertices (as we can see in the first picture).

Now we are looking forward to see use-cases of the splitted mesh


1 Like