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

Deprecate function_*(::VectorValues, ::Int, ::VectorDofs) #698

Merged
merged 1 commit into from
May 9, 2023

Conversation

fredrikekre
Copy link
Member

function_value, function_gradient, function_divergence, and function_curl together with CellVectorValues supports specifying the local dof vector using Vec entries. This patch deprecates this. There is no point in casting T to Vec, just to then recast to T for the evaluation. Deprecations are added, but in practice I estimate that zero people use this functionality.

`function_value`, `function_gradient`, `function_divergence`, and
`function_curl` together with `CellVectorValues` supports specifying the
local dof vector using `Vec` entries. This patch deprecates this. There
is no point in casting `T` to `Vec`, just to then recast to `T` for the
evaluation. Deprecations are added, but in practice I estimate that zero
people use this functionality.
@fredrikekre
Copy link
Member Author

There are similar methods for CellScalarValues + vector dofs, that is at least somewhat useful, but I don't think anyone uses that either. Deprecate that too?

@termi-official
Copy link
Member

Which ones are you referring to?

@fredrikekre
Copy link
Member Author

# TODO: Deprecate this, nobody is using this in practice...
function function_gradient(::ScalarValued, fe_v::Values{dim}, q_point::Int, u::AbstractVector{Vec{dim,T}}) where {dim,T}
n_base_funcs = getn_scalarbasefunctions(fe_v)
length(u) == n_base_funcs || throw_incompatible_dof_length(length(u), n_base_funcs)
@boundscheck checkquadpoint(fe_v, q_point)
grad = zero(Tensor{2,dim,T})
@inbounds for i in 1:n_base_funcs
grad += u[i] shape_gradient(fe_v, q_point, i)
end
return grad
end

@fredrikekre fredrikekre merged commit f0199a8 into master May 9, 2023
@fredrikekre fredrikekre deleted the fe/vector-dofs-be-gone branch May 9, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants