## Re: [Libmesh-users] about the global index of nodes and variable

 Re: [Libmesh-users] about the global index of nodes and variable From: Roy Stogner - 2007-09-10 17:40:55 ```On Mon, 10 Sep 2007, Yujie wrote: > I know the degree of freedom numbering is done element-by-element. I also > know if one uses high order shape functions (p>1), he will obtain more > solution number than the nodes in the mesh. However, now I use First-order > Lagrange shape functions, In one tetrahedron element, to my knowledge, one > varialbe is relevant to one vertex of tetrahedron. Is it right? In this case, you can get the solution corresponding to a single Node with system.current_solution(node.dof_number(system.number(),var_num,0)) Unlike the two methods which I previously suggested to you, this method will fail on non-vertex nodes on non-Lagrange elements, on interior nodes on quadratic Lagrange elements, and on non-vertex nodes on non-isoparametric Lagrange elements. If that's what you want, go nuts, but I hope you're beginning to see why I must again turn down your emailed offers to let me debug your application codes for free. --- Roy ```

 [Libmesh-users] about the global index of nodes and variable From: Yujie - 2007-09-09 05:30:53 Attachments: Message as HTML ```Hi, everyone I want to know whether the global index of nodes in the mesh is the same with that of the variable. Like this: node[1] :: u[1] node[2] :: u[2] . . . node[i]:: u[i] . . . node[n]::u[n] After I solve my PDE, I use system::build_solution_vector to get the values of the variable. However, I found that I can't find they are identical. Could you give me some advice? Thanks a lot. Regards, Yujie ```
 Re: [Libmesh-users] about the global index of nodes and variable From: Roy Stogner - 2007-09-10 04:35:28 ```On Sun, 9 Sep 2007, Yujie wrote: > I want to know whether the global index of nodes in the mesh is the same > with that of the variable. > Like this: > node[1] :: u[1] No, it isn't. For some finite element types (most anything non-Lagrange) doing this would be impossible, and on a dynamically repartitioned parallel mesh doing this would be impractical. > After I solve my PDE, I use system::build_solution_vector to > get the values of the variable. However, I found that I can't find they are > identical. Could you give me some advice? Well, build_solution_vector is how we create nodal solution vectors to output in various visualization formats, but it doesn't change the original solution vector, just creates a new vector of node values. If you want to look at a whole nodal solution at a time, you can use build_solution_vector, but might as well just write it to a file and use a graphical tool on that. If you just need a particular function value at a point, you can construct it by summing up solution coefficients times shape functions as is done in the assembly function in ex13. --- Roy ```
 Re: [Libmesh-users] about the global index of nodes and variable From: Roy Stogner - 2007-09-10 17:40:55 ```On Mon, 10 Sep 2007, Yujie wrote: > I know the degree of freedom numbering is done element-by-element. I also > know if one uses high order shape functions (p>1), he will obtain more > solution number than the nodes in the mesh. However, now I use First-order > Lagrange shape functions, In one tetrahedron element, to my knowledge, one > varialbe is relevant to one vertex of tetrahedron. Is it right? In this case, you can get the solution corresponding to a single Node with system.current_solution(node.dof_number(system.number(),var_num,0)) Unlike the two methods which I previously suggested to you, this method will fail on non-vertex nodes on non-Lagrange elements, on interior nodes on quadratic Lagrange elements, and on non-vertex nodes on non-isoparametric Lagrange elements. If that's what you want, go nuts, but I hope you're beginning to see why I must again turn down your emailed offers to let me debug your application codes for free. --- Roy ```