Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mesh/cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const Facet=Cell

### Cell methods

Base.hash(cell::Cell) = sum(hash(node) for node in cell.nodes)
Base.hash(cell::Cell, h::UInt) = foldl((h, node) -> hash(node, h), cell.nodes; init=h)
Base.isequal(c1::Cell, c2::Cell) = hash(c1)==hash(c2)

"""
Expand Down
2 changes: 1 addition & 1 deletion src/node.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const null_Node = Node(NaN, NaN, NaN)

#Base.hash(n::Node) = hash( (round(n.coord.x, digits=8), round(n.coord.y, digits=8), round(n.coord.z, digits=8)) )
# Base.hash(n::Node) = hash( (n.coord.x, n.coord.y, n.coord.z) )
Base.hash(n::Node) = hash( (n.coord.x+1.0, n.coord.y+2.0, n.coord.z+3.0) ) # 1,2,3 aim to avoid clash in some arrays of nodes.
Base.hash(n::Node, h::UInt) = hash((n.coord.x+1.0, n.coord.y+2.0, n.coord.z+3.0), h) # 1,2,3 aim to avoid clash in some arrays of nodes.
Base.isequal(n1::Node, n2::Node) = hash(n1)==hash(n2)


Expand Down