## [Libmesh-users] Order of points of a side

 [Libmesh-users] Order of points of a side From: - 2007-05-08 08:11:27 ```Dear all, In a certain situation, I want to traverse all vertices of a certain side of a three-dimensional element. I need only the coordinates of these vertices. My idea is this: AutoPtr side = elem->build_side(num); for(l=0; ln_nodes(); l++) { if(side->is_vertex(l)) { do_something(side->point(l)); } } However, it is important for me that I get the points in a sensible order: A--------B | | | | | | | | D--------C In this situation, I need something like (A,B,C,D) or (C,B,A,D), but not (A,C,B,D). I hope you understand what I mean; I currently can't think of the correct English word. Is it guaranteed by the above code that I get a suitable order of the vertices? If not, what should I do? (Currently, I'm working with tetrahedrons, so that the sides are triangles, and thus *any* order is suitable for me; but I want everything to work with hexes as well.) Best Regards, Tim ```

 [Libmesh-users] Order of points of a side From: - 2007-05-08 08:11:27 ```Dear all, In a certain situation, I want to traverse all vertices of a certain side of a three-dimensional element. I need only the coordinates of these vertices. My idea is this: AutoPtr side = elem->build_side(num); for(l=0; ln_nodes(); l++) { if(side->is_vertex(l)) { do_something(side->point(l)); } } However, it is important for me that I get the points in a sensible order: A--------B | | | | | | | | D--------C In this situation, I need something like (A,B,C,D) or (C,B,A,D), but not (A,C,B,D). I hope you understand what I mean; I currently can't think of the correct English word. Is it guaranteed by the above code that I get a suitable order of the vertices? If not, what should I do? (Currently, I'm working with tetrahedrons, so that the sides are triangles, and thus *any* order is suitable for me; but I want everything to work with hexes as well.) Best Regards, Tim ```
 [Libmesh-users] Order of points of a side From: John Peterson - 2007-05-08 13:00:30 ```Hi Tim, I believe the clockwise ordering is the one you will get. See, for example, cell_hex8.C, Hex8::side_nodes_map. For side 0 we have the array {0,3,2,1}. According to the ASCII art picture in cell_hex8.h, we can see that this corresponds to the clockwise ordering of nodes on the bottom face of the hex. Also, we use these sides to perform boundary integrations, so they must be well-formed from that perspective as well. I sense a leading question though, have you already found some behavior which contradicts this? -John Tim Kr,bv(Bger writes: > Dear all, > > In a certain situation, I want to traverse all vertices of a certain > side of a three-dimensional element. I need only the coordinates of > these vertices. My idea is this: > > AutoPtr side = elem->build_side(num); > for(l=0; ln_nodes(); l++) > { > if(side->is_vertex(l)) > { > do_something(side->point(l)); > } > } > > However, it is important for me that I get the points in a sensible > order: > > A--------B > | | > | | > | | > | | > D--------C > > In this situation, I need something like (A,B,C,D) or (C,B,A,D), but > not (A,C,B,D). I hope you understand what I mean; I currently can't > think of the correct English word. > > Is it guaranteed by the above code that I get a suitable order of the > vertices? If not, what should I do? > > (Currently, I'm working with tetrahedrons, so that the sides are > triangles, and thus *any* order is suitable for me; but I want > everything to work with hexes as well.) > > Best Regards, > > Tim ```
 Re: [Libmesh-users] Order of points of a side From: - 2007-05-08 13:11:54 ```Dear John, On Tue, 8 May 2007, John Peterson wrote: > I believe the clockwise ordering is the one you will get. See, for > example, cell_hex8.C, Hex8::side_nodes_map. For side 0 we have the > array {0,3,2,1}. According to the ASCII art picture in cell_hex8.h, > we can see that this corresponds to the clockwise ordering of nodes > on the bottom face of the hex. Also, we use these sides to perform > boundary integrations, so they must be well-formed from that > perspective as well. Okay, thank you. Then, everything is fine. > I sense a leading question though, have you already found some behavior > which contradicts this? No, it was not a leading question. The code works perfectly for my case. I just wanted to know whether it will still work if I switch to hexes (since for tetrahedrons, the order of the vertices of a side is automatically either clockwise or counter-clockwise, both of which is okay for my purpose). Best Regards, Tim ```