diff --git a/src/tet_element.jl b/src/tet_element.jl index 0b53d72..d97dacf 100644 --- a/src/tet_element.jl +++ b/src/tet_element.jl @@ -74,7 +74,6 @@ function equi_nodes(elem::Tet,N) r1D = LinRange(-1,1,N+1) r,s,t = ntuple(x->zeros(Np),3) sk = 1 - #for i = 0:N, j = 0:N-i, k = 0:N-i-j for k = 0:N, j = 0:N-k, i = 0:N-j-k r[sk] = r1D[i+1] s[sk] = r1D[j+1] diff --git a/src/tri_element.jl b/src/tri_element.jl index 362415d..807ea2d 100644 --- a/src/tri_element.jl +++ b/src/tri_element.jl @@ -106,12 +106,18 @@ function equi_nodes(::Tri, N) r1D = LinRange(-1, 1, N+1) sk = 1 - for i = 0:N - for j = 0:N-i - r[sk] = r1D[i+1] - s[sk] = r1D[j+1] - sk += 1 - end + + # order so that the nodes change fastest in the x-direction, + # then the y-direction. For N=1, the nodes should be + # + # 3 + # | \ + # 1---2 + + for j = 0:N, i = 0:N-j + r[sk] = r1D[i+1] + s[sk] = r1D[j+1] + sk += 1 end return r[:], s[:] diff --git a/src/warpblend_interp_nodes.jl b/src/warpblend_interp_nodes.jl index 15e87ac..51e5324 100644 --- a/src/warpblend_interp_nodes.jl +++ b/src/warpblend_interp_nodes.jl @@ -108,7 +108,7 @@ function find_face_nodes(::Tri, r, s, tol=50*eps()) e1 = findall(@. abs(s + 1) < tol) e2 = findall(@. abs(r + s) < tol) e3 = findall(@. abs(r + 1) < tol) - return e1, reverse(e2), reverse(e3) + return e1, e2, reverse(e3) end function find_face_nodes(::Quad, r, s, tol=50*eps())