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

Fixes the discontinuous lagrange reference coords dispatch #559

Merged
merged 3 commits into from
Dec 15, 2022
Merged
Changes from 2 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
11 changes: 10 additions & 1 deletion src/interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,18 @@ function value(ip::DiscontinuousLagrange{dim,shape,order}, i::Int, ξ::Vec{dim})
end

# Excepting the L0 element.
function reference_coordinates(ip::DiscontinuousLagrange{dim,shape,0}) where {dim,shape}
function reference_coordinates(ip::DiscontinuousLagrange{dim,RefCube,0}) where dim
return [Vec{dim, Float64}(ntuple(x->0.0, dim))]
end

function reference_coordinates(ip::DiscontinuousLagrange{2,RefTetrahedron,0})
return [Vec{2,Float64}((1/3,1/3))]
end

function reference_coordinates(ip::DiscontinuousLagrange{3,RefTetrahedron,0})
return [Vec{3,Float64}((1/4,1/4,1/4))]
end
Comment on lines +160 to +166
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a general solution via ntuple, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no :D that's 1:1 the piece of code of the other branch


function value(ip::DiscontinuousLagrange{dim,shape,0}, i::Int, ξ::Vec{dim}) where {dim,shape}
return 1.0
end
Expand Down