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

Making Lagrange2Tri345 interpolation values exact #633

Merged
merged 2 commits into from
Mar 23, 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
5 changes: 2 additions & 3 deletions src/interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,9 @@ function value(ip::Lagrange2Tri345, i::Int, ξ::Vec{2})
i = permdof2DLagrange2Tri345[order][i]
ξ_x = ξ[1]
ξ_y = ξ[2]
γ = 1. - ξ_x - ξ_y
i1, i2, i3 = _numlin_basis2D(i, order)
val = one(γ)
i1 1 && (val *= prod((order * γ - j) / (j + 1) for j = 0:(i1 - 1)))
val = one(ξ_y)
i1 1 && (val *= prod((order - order * (ξ_x + ξ_y ) - j) / (j + 1) for j = 0:(i1 - 1)))
i2 1 && (val *= prod((order * ξ_x - j) / (j + 1) for j = 0:(i2 - 1)))
i3 1 && (val *= prod((order * ξ_y - j) / (j + 1) for j = 0:(i3 - 1)))
return val
Expand Down
2 changes: 1 addition & 1 deletion test/test_interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Lagrange{2, RefTetrahedron, 2}(),
Lagrange{2, RefTetrahedron, 3}(),
Lagrange{2, RefTetrahedron, 4}(),
#Lagrange{2, RefTetrahedron, 5}(),
Lagrange{2, RefTetrahedron, 5}(),
Lagrange{3, RefCube, 1}(),
Lagrange{3, RefCube, 2}(),
Serendipity{2, RefCube, 2}(),
Expand Down