flatironinstitute / SkellySim

Hydrodynamic Cytoskeleton Simulator
https://users.flatironinstitute.org/~rblackwell/py-skellysim
Apache License 2.0
23 stars 2 forks source link

Velocity field #9

Closed blackwer closed 2 years ago

blackwer commented 2 years ago

This PR aims to address the issue of post-processing, mostly with respect to velocity fields. This is being tackled on multiple fronts - visualization, input, storage layout, and handling post-processing as similarly to the simulation as possible (avoiding duplicate code).

Velocity fields actually require various state that had not been stored prior to reproduce that complicates code re-use. The velocity field is built both from position data and the solution data that resulted in that position (this includes velocities, densities, etc). This needs to be marshaled from multiple ranks into one rank, and then distributed back at post-processing time. Since this data was temporary and a single array is the natural representation of it, it would make sense to just save this array, but this would be wasteful since a lot of that data is redundant (notably fiber positions). I chose to copy the data back from the solution vector to each object in the relevant fields. For fibers, this meant adding a "tension" attribute. Both the periphery and body just store the solution vector directly, since there was very little redundant data in the bodies (just pos/orientation), and the shell had no output at all prior.

Issues that still remain: