Skip to content

Rewrite Particle loops to be over objects, instead of integers #868

@erikvansebille

Description

@erikvansebille

Make the loops in Field and FieldSet that access Particles (in particular those two classes; possibly others too) independent of of the order - hence: migrate loops like

for i in range(numerical):
       new_value = array[i]

to either:

for obj in array:
      new_value = obj

or:

for i, obj in enumerate(array):
      new_array[i] = obj

This would simplify the integration of the linked list of nodes and the lists-of-arrays of particles (#862) later. This is because their indices are dynamic and could rearrange - a classic reason why to use iterators.

Thanks to @CKehl for bringing this up

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions