You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just used Cthulhu.descend to quickly peek through the package and noticed that integral(f, ::Segment, ::GaussLegendre) inferences an output type ::Any. The _integral(..., ::GaussLegendre) function looks almost entirely blue (good), except for this line
where I see an inference zip(weight_grid, node_grid)::Any. However, I can't descend any further into this line because I get a This is a runtime call notice for the line itself and nothing beneath zip.
My experience deep-diving type inference is very limited, so I'm not sure if this is much of an issue, or how to go about addressing it beyond what I've already done.
Details
Cthulhu.jl output:
68function (_integral(
69 f::Core.Const(Main.f),
70 geometry::Segment{𝔼{2}, CoordRefSystems.Cartesian2D{CoordRefSystems.NoDatum, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}},
71 rule::GaussLegendre::GaussLegendre;
72 FP::Type{Float64}::Type{T}= Float64,
73 diff_method::FiniteDifference{Float64}::DM=_default_diff_method(geometry)
74 ) where {DM <:DifferentiationMethod, T <:AbstractFloat})::Any75 N::Core.Const(1) = Meshes.paramdim(geometry)
7777# Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ78 xs = Iterators.map(FP::Type{Float64}, rule::GaussLegendre.nodes::Vector{Float64})
79 ws = Iterators.map(FP::Type{Float64}, rule::GaussLegendre.weights::Vector{Float64})
80 weight_grid = Iterators.product(ntuple(Returns(ws), N::Core.Const(1))...)
81 node_grid = Iterators.product(ntuple(Returns(xs), N::Core.Const(1))...)
8383# Domain transformation: x [-1,1] ↦ t [0,1]84t(x) = (1//2) * x + (1//2)
8686functionintegrand((weights, nodes))
87# ts = t.(nodes), but non-allocating88 ts =ntuple(i ->t(nodes[i]), length(nodes))
89# Integrand function90prod(weights) *f(geometry(ts...)) *differential(geometry, ts, diff_method)
91end9393return (((1// ((2^N::Core.Const(1))::Core.Const(2)))::Core.Const(1//2)) .*::Core.Const(*) sum(integrand::MeshIntegrals.var"#integrand#28"{FiniteDifference{Float64}, typeof(f), Segment{𝔼{2}, CoordRefSystems.Cartesian2D{CoordRefSystems.NoDatum, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}, MeshIntegrals.var"#t#27"}, zip(weight_grid, node_grid))::Any)::Any
The text was updated successfully, but these errors were encountered:
I just used
Cthulhu.descend
to quickly peek through the package and noticed thatintegral(f, ::Segment, ::GaussLegendre)
inferences an output type::Any
. The_integral(..., ::GaussLegendre)
function looks almost entirely blue (good), except for this lineMeshIntegrals.jl/src/integral.jl
Line 93 in c7c0a47
where I see an inference
zip(weight_grid, node_grid)::Any
. However, I can'tdescend
any further into this line because I get aThis is a runtime call
notice for the line itself and nothing beneathzip
.My experience deep-diving type inference is very limited, so I'm not sure if this is much of an issue, or how to go about addressing it beyond what I've already done.
Details
Cthulhu.jl output:
The text was updated successfully, but these errors were encountered: