Skip to content

Commit

Permalink
add comment explaining count logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Joroks committed Jun 22, 2024
1 parent b4e93d5 commit 05ebf59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/LAMMPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ function _get_count(lmp::LMP, name::String)
count_ptr = reinterpret(Ptr{Cint}, count_ptr)
count = unsafe_load(count_ptr)

# a count of 0 indicates that the entity is a vector. In order to perserve type stability we just treat that as a 1xN Matrix.
return count == 0 ? 1 : count
elseif name in ("mass", "id", "type", "mask", "image", "molecule", "q", "radius", "rmass", "ellipsoid", "line", "tri", "body", "temperature", "heatflow")
return 1
Expand Down

0 comments on commit 05ebf59

Please sign in to comment.