Skip to content

Comments

added some comments and created lifted directory#1

Open
emilybwsiew wants to merge 2 commits intoklywang:masterfrom
emilybwsiew:testing
Open

added some comments and created lifted directory#1
emilybwsiew wants to merge 2 commits intoklywang:masterfrom
emilybwsiew:testing

Conversation

@emilybwsiew
Copy link
Collaborator

No description provided.

@emilybwsiew emilybwsiew requested a review from klywang June 29, 2021 18:29
Comment on lines 130 to 133
ind_lift = np.empty(len(pos)).astype(int)
# outer shell of particles lifting from to find neighbors
ind_ref = np.atleast_1d(dist_sorted[n_tried]).astype(int)
ind_lift[n_lifted] = dist_sorted[n_tried]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ind_lift: Row index of particle positions that have been lifted
    This starts out as an empty array. ind_ref is appended to the end of the list at the end of each iteration.
    This is used to make sure we don't double lift anything or end up with a deadend.

  • ind_ref: Row index of particle positions that we will perform calculations on
    These are the particles we want to find neighbors for. This list changes each iteration.

I used row indices instead of actual particle positions because I assumed lists of 1D unsigned integers would have better performance than the actual positions.

# Presort nl to reduce in1d calls
# nl_red, nl_construct = np.unique(nl[:, 0], return_inverse=True)

# don't really completely understand what this section is doing
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which lines are you confused by? I can add more comments for clarity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants