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:
[ ] Verification
[ ] Visualization (in blender. paraview works, but I much prefer the blender workflow so i'm going to try to get this going)
[ ] Storage: moving volumes (boxes surrounding moving bodies) currently require an unordered point list for the field to remove redundant points. there is definitely a more efficient algorithm to map overlapping boxes to unique ordered points, which would nearly halve the storage cost for moving volumes. worse - i'm pretty sure i use this same algorithm for a single box to remove points outside the periphery
[x] distribute computation? I pile up all the target points on rank 0. Edit: apparently I already did this a while 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: