Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder tri nodes to be consistent with tet nodes #14

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading