Skip to content

Commit

Permalink
Revert n_ndofs simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Oct 24, 2024
1 parent 619df96 commit ed8c1af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DataLayouts/non_extruded_broadcasted.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ end
# Base.Broadcast.Broadcasted and allow cartesian indexing:
Base.@propagate_inbounds Base.getindex(bc::NonExtrudedBroadcasted) = to_broadcasted(bc)[CartesianIndex(())]

n_dofs(bc::NonExtrudedBroadcasted) = prod(length, axes(bc); init = 0)
import StaticArrays
to_tuple(::Tuple{}) = ()
to_tuple(t::Tuple) = t
to_tuple(t::NTuple{N, <: Base.OneTo}) where {N} = map(x->x.stop, t)
to_tuple(t::NTuple{N, <: StaticArrays.SOneTo}) where {N} = map(x->x.stop, t)
n_dofs(bc::NonExtrudedBroadcasted) = prod(to_tuple(axes(bc)))
# ---

Base.@propagate_inbounds _broadcast_getindex(
Expand Down

0 comments on commit ed8c1af

Please sign in to comment.