SCOREC / fep

Finite Element Programming course materials
6 stars 4 forks source link

[Question] numbering API #16

Closed startrekman closed 3 years ago

startrekman commented 3 years ago

Summary

Question regarding reordering procedure implementation. I am just looking for a little guidance as to how to assign nodes and faces a number. So I have been looking at pNumbering but am unsure that it is relabeling each of the nodes as I can't see it change the ID's in ParaView. For example, should it be something like?

nb = pumi_numbering_create(...) pumi_node_setNumber(nb, v,0,0,162) So that there should be a 162 showing up somewhere on ParaView.

Similarly, should a face should be something like:

f = pumi_node_setField(...) pumi_nodesetField(idk... what to put here)

Thank you for your help.

cwsmith commented 3 years ago

For example, should it be something like?

nb = pumi_numbering_create(...)
pumi_node_setNumber(nb, v,0,0,162)

Correct. For faces you can use the same numbering api. Take a look at using pumi_shape_getConstant(...) to create a numbering to use with faces.

startrekman commented 3 years ago

So, I am a bit confused as to how to use it. For a vertex, n=0, and c=0. But this is not true for an element. How is the correct value of n and c determined.

So For example, I would have: f = pumi_shape_getConstant(mesh,3) nf = pumi_numbering_create( mesh, "faces", f) pumi_node_setNumber(nf, face, n, c, 162) or even to check the number assignment pumi_node_getNumber(nf, face, n , c)

However, I can not seem to find n and c values that do not cause a segmentation fault error. I can not seem to get the default values prior to any assignment without a segmentation fault error- I suspect that it is likely because I do not understand what the n and c values are and am not putting the correct values there.

So basically I have two questions. 1) do we need two different pNumbering objects? 2) What is and what determines n and c for a face? For example, what is it for an edge, face, and or region?

cwsmith commented 3 years ago

1) I used two numberings in my reference solution. As I recall, this was a simple way to get a node on the element that could be numbered and visualized in paraview. 2) Take a look at the pumi user guide (https://www.scorec.rpi.edu/pumi/PUMI.pdf) and the functions: int pumi_field_getSize (...) pumi_shape_getNumNode(...) and pumi_node_setNumber(...)