Civil Engineering Reference
In-Depth Information
// Output: Elements connected to node k: {Pi, i , i = {Pi, k + 1, P k+1 }
Set zero to array P: {P k = 0, k = 1,N p + 1}
Loop: i = 1,Ne
Loop: j = 1,4
k=V j ; P k = P k + 1
End loop j
End loop i
P 1 = P 1 + Np + 1
Loop: k = 1,Np
P k+1 = P k+1 + P k
End loop k
Loop: i = 1,Ne
Loop: j = 1,4
k=V j ; m = P k ; P m = i; P k = m - 1
End loop j
End loop i
2.5.4 Find the edges (unique line segments) of a triangular mesh
This simple algorithm is based on the idea that edge j1 - j2 shared by two elements follow-
ing the orientation of the triangles will be that j1 < j2 in one element and vice versa, j2 < j1,
in the other element, as shown in Figure 2.29. As j1 ≠ j2, the edge will only be counted
once. To complete the set, all the boundary edges still have to be included, which are con-
nected to only one element, and hence, the boundary condition T i j = 0 is also included in
the If test.
Algorithm Edges_T3 (Np, Ne, V, T, E)
// Find the edges (unique line segments) of a triangular mesh
// Np and Ne are respectively the number of nodes and elements in the
// mesh.
// Input: V = Vertices of the elements, Neighbours of triangles T
// Output: Edges E: { E j , i = 1,n; j = 1,2}
n = 0
Loop: i = 1,Ne
Loop: j = 1,3
j1=V i mod(j,3)+1 ; j2=V i mod(j+1,3)+1
j
If (j1 < j2 or T=0
i
) then
1
2
n = n + 1; E=j1; E=j2
n
n
End if
End loop j
End loop i
j 1
Include
Exclude
j 2
Figure 2.29 Finding the edges of a triangular mesh.
Search WWH ::




Custom Search