Skip to content

Commit

Permalink
Merge pull request #128 from bcube-project/optim_ref2phys
Browse files Browse the repository at this point in the history
Improve inference for function `∂fξ_∂x_hypersurface`
  • Loading branch information
bmxam authored Jul 26, 2024
2 parents f52ce71 + b0e282a commit 2ce4cac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mapping/ref2phys.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function ∂fξ_∂x(f::F, ::Val{N}, ctype::AbstractEntityType, cnodes, ξ) wher
return ForwardDiff.jacobian(f, ξ) * mapping_jacobian_inv(ctype, cnodes, ξ)
end

function ∂fξ_∂x_hypersurface(f, ::Val{1}, ctype::AbstractEntityType, cnodes, ξ)
function ∂fξ_∂x_hypersurface(f::F, ::Val{1}, ctype::AbstractEntityType, cnodes, ξ) where {F}
# Gradient in the reference domain. Add missing dimensions. Warning : we always
# consider a hypersurface (topodim = spacedim - 1) and not a line in R^3 for instance.
# Hence we always add only one 0.
Expand All @@ -161,7 +161,13 @@ function ∂fξ_∂x_hypersurface(f, ::Val{1}, ctype::AbstractEntityType, cnodes
return transpose(inv(J)) * ∇f
end

function ∂fξ_∂x_hypersurface(f, ::Val{N}, ctype::AbstractEntityType, cnodes, ξ) where {N}
function ∂fξ_∂x_hypersurface(
f::F,
::Val{N},
ctype::AbstractEntityType,
cnodes,
ξ,
) where {F, N}
# Gradient in the reference domain. Add missing dimensions. Warning : we always
# consider a hypersurface (topodim = spacedim - 1) and not a line in R^3 for instance.
# Hence we always add only one 0.
Expand Down

0 comments on commit 2ce4cac

Please sign in to comment.