Skip to content

Commit

Permalink
Merge pull request #14 from jlchan/jc/reorder_tri_nodes
Browse files Browse the repository at this point in the history
Reorder tri nodes to be consistent with tet nodes
  • Loading branch information
jlchan committed Nov 1, 2023
2 parents 26718b9 + 4df4436 commit f2db713
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/tet_element.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
18 changes: 12 additions & 6 deletions src/tri_element.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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[:]
Expand Down
2 changes: 1 addition & 1 deletion src/warpblend_interp_nodes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit f2db713

Please sign in to comment.