SCOREC / fep

Finite Element Programming course materials
6 stars 4 forks source link

a3 - setting node numbers #9

Closed PeterK26 closed 5 years ago

PeterK26 commented 5 years ago

I'm having a bit of trouble setting the node numbers for the new numbering. A new numbering object is generated, but when displayed in ParaView, all the nodes are labeled as -1. I'm performing the numbering by doing this:

pNumbering numbers=pumi_numbering_create(mesh,"vtx_numbers",s,1); //create numbering object
for(int j=0;j<nodes;j++){ 
  pMeshEnt ent=pumi_mesh_findEnt(mesh,0,IDS[j]); //get mesh entity
  pumi_node_setNumber(numbers,ent,1,1,j); //set new node number
}

Where IDS is an array storing the node IDs from the original numbering and nodes is the total number of nodes.

Is there something I'm missing about how to use pumi_node_setNumber()? Or is there an issue because I'm trying to introduce a second numbering scheme without deleting the original?

cwsmith commented 5 years ago

If the ent object being returned by pumi_mesh_findEnt(...) is valid (not NULL, etc.) then I suspect that the values for n and c are incorrect.

The optional arguments n and c specify a high-order field node and degree of freedom per node (default: 0). In case the mesh entity has only one node and one component, n and c are 0. (page 66 of pumi.pdf)

Why not loop over the mesh using adjacencies and then accessing the nodes on each entity with a nested for loop?

cwsmith commented 5 years ago

I'm guessing this is resolved. Please reopen as needed.