From f001e629730a4a214d009a1d6f26799802d84e11 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Tue, 31 Oct 2023 10:11:49 -0500 Subject: [PATCH 1/2] change tri ordering to be consistent with tet --- src/tet_element.jl | 1 - src/tri_element.jl | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) 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[:] From b70e4a76575f2920f609c24549272ad7dbe534bc Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Tue, 31 Oct 2023 11:07:29 -0500 Subject: [PATCH 2/2] fixing face node orientations --- src/warpblend_interp_nodes.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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())