Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Maximilian Köhler <[email protected]>
  • Loading branch information
termi-official and koehlerson authored Jul 16, 2024
1 parent 3c41193 commit 0bcde11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Entity.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
VertexRepresentation
We can identify an edge uniquely by the sorted node numbers associated with the end points.
We can identify a vertex uniquely by the node number.
"""
struct VertexRepresentation
node::Int
Expand Down
6 changes: 3 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Ferrite.toglobal(grid::Ferrite.AbstractGrid,edgeidx::Vector{Ferrite.EdgeIndex})
"""
representation(grid::AbstractGrid, vertexidx::VertexIndex) -> Int
representation(grid::AbstractGrid, vertexidx::AbstractVector{VertexIndex}) -> Vector{Tuple{Int}}
This function takes the local face representation (a `VertexIndex`) and looks up the unique global id (a tuple of `Int`).
This function takes the local vertex representation (a `VertexIndex`) and looks up the unique global id.
"""
representation(grid::AbstractGrid,vertexidx::VertexIndex) = VertexRepresentation(Ferrite.toglobal(grid,vertexidx))
representation(grid::AbstractGrid,vertexidx::AbstractVector{VertexIndex}) = VertexRepresentation.(unique(Ferrite.toglobal.((grid,),vertexidx)))
Expand All @@ -34,10 +34,10 @@ This function takes the local face representation (a `FaceIndex`) and looks up t
representation(grid::AbstractGrid,faceidx::FaceIndex) = FaceRepresentation(faces(getcells(grid,faceidx[1]))[faceidx[2]])
representation(grid::AbstractGrid,faceidx::AbstractVector{FaceIndex}) = FaceRepresentation.(Ferrite.toglobal.((grid,),faceidx))

"""^
"""
representation(grid::AbstractGrid, vertexidx::EdgeIndex) -> Int
representation(grid::AbstractGrid, vertexidx::AbstractVector{EdgeIndex}) -> Vector{Tuple{Int}}
This function takes the local face representation (an `EdgeIndex`) and looks up the unique global id (a tuple of `Int`).
This function takes the local edge representation (an `EdgeIndex`) and looks up the unique global id (a tuple of `Int`).
"""
representation(grid::AbstractGrid,edgeidx::EdgeIndex) = EdgeRepresentation(edges(getcells(grid,edgeidx[1]))[edgeidx[2]])
representation(grid::Ferrite.AbstractGrid,edgeidx::Vector{EdgeIndex}) = EdgeRepresentation.(Ferrite.toglobal.((grid,),edgeidx))
Expand Down

0 comments on commit 0bcde11

Please sign in to comment.