Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement slicing for LB #4195

Merged
merged 19 commits into from
Apr 1, 2021
Merged

Implement slicing for LB #4195

merged 19 commits into from
Apr 1, 2021

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Mar 31, 2021

Fixes #4143

Description of changes:

  • Modified getitem to detect slices in input keys
  • Introduced LBSlice class that calculates node indices from slice input and calls single node getter from LBFLuidRoutines class for every node in the slice.

The output is a multidimensional array containing the requested quantity and is of dimension len(slice_x)*len(slice_y)*len(slice_z)*len(quantity), where len(quantity) is the dimensions of the quantity, for example 3 in case of velocity. The output array is arranged in the way numpy cycles through slices. Therefore, when setting attributes one has to set the dimensions of the input array exactly the same way numpy cycles through the sliced nodes.
An error is issued if the dimensions of the slices and the input does not match.

@KaiSzuttor
Copy link
Member

@KaiserMartin thanks a lot for your implementation

@jngrad jngrad added the automerge Merge with kodiak label Apr 1, 2021
@kodiakhq kodiakhq bot merged commit 0c342e6 into espressomd:python Apr 1, 2021
@jngrad jngrad deleted the fix-4143 branch April 1, 2021 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement slicing support for LB
3 participants