Skip to content

Commit

Permalink
remove extraneous num_elements specialization (#121)
Browse files Browse the repository at this point in the history
* remove extraneous num_elements specialization

* use getfield instead of getproperty

* fix error
  • Loading branch information
jlchan authored May 9, 2023
1 parent fbc55b9 commit 2dd29c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/MeshData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ function Base.getproperty(x::MeshData{Dim, <:VertexMappedMesh}, s::Symbol) where
end
end

num_elements(md::MeshData) = size(md.x, 2) # number of columns in the "x" coordinate array
num_elements(md::MeshData{Dim, <:VertexMappedMesh}) where {Dim} = size(md.mesh_type.EToV, 1)
@inline num_elements(md::MeshData) = size(first(getfield(md, :xyz)), 2) # number of columns in the coordinate array

# splat `uniform_mesh` arguments, e.g., enables `MeshData(uniform_mesh(Line(), 1), rd)`
# TODO: wrap `uniform_mesh` in a custom type so we can dispatch more precisely
Expand Down

0 comments on commit 2dd29c3

Please sign in to comment.