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

Update value and derivative deprecation message to make users aware of non-allocating batch evaluation #1125

Merged
merged 6 commits into from
Jan 10, 2025
Merged
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
20 changes: 18 additions & 2 deletions src/deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,26 @@ function FacetValues(
end

function value(ip::Interpolation, ξ::Vec)
throw(DeprecationError("value(ip::Interpolation, ξ::Vec)" => "[reference_shape_value(ip, ξ, i) for i in 1:getnbasefunctions(ip)]"))
io = _iobuffer()
printstyled(io, "`value(ip::Interpolation, ξ::Vec)`", color = :red)
print(io, " is deprecated, use ")
printstyled(io, "`[reference_shape_value(ip, ξ, i) for i in 1:getnbasefunctions(ip)]`", color = :green)
print(io, " or ")
printstyled(io, "`reference_shape_values!(N, ip, ξ)`", color = :green)
print(io, " (with preallocated `N`) instead.")

throw(DeprecationError(takestring(io)))
end
function derivative(ip::Interpolation, ξ::Vec)
throw(DeprecationError("derivative(ip::Interpolation, ξ::Vec)" => "[reference_shape_gradient(ip, ξ, i) for i in 1:getnbasefunctions(ip)]"))
io = _iobuffer()
printstyled(io, "`derivative(ip::Interpolation, ξ::Vec)`", color = :red)
print(io, " is deprecated, use ")
printstyled(io, "`[reference_shape_gradient(ip, ξ, i) for i in 1:getnbasefunctions(ip)]`", color = :green)
print(io, " or ")
printstyled(io, "`reference_shape_gradients!(dNdξ, ip, ξ)`", color = :green)
print(io, " (with preallocated `dNdξ`) instead.")

throw(DeprecationError(takestring(io)))
end
function value(ip::Interpolation, i::Int, ξ::Vec)
throw(DeprecationError("value(ip::Interpolation, i::Int, ξ::Vec)" => "reference_shape_value(ip, ξ, i)"))
Expand Down
Loading