Hi everyone,
I need to save .his files for each particle geometry, capturing displacement, force, rotation spin, force chains, and other features at each time step. This will allow me to plot the data in a specific format using Matlab. Could anyone please provide the Fish code to save these properties in .his files for pfc 2d?
There is a command in PFC 9.1 called ball history. This would work if you have <100 or so particles. Just create ball histories, set history interval to 1, and use history export at the end to export data. Note that histories are typically used to track results/states at points throughout the model – not each and every particle (or zone). Could you track a lot of history points? Possibly, but it would take a ton of memory and not sure how responsive/efficient the model would be.
If many particles are to be tracked, suggest using a FISH function (ideally, one that’s multi-threaded (e.g., FISH operator) – especially if trying to capture data each step. The FISH function would be essentially: loop/split through all the balls, query each property (displacement, spin) directly, then export data to a CSV file (append, line by line), step 1, and repeat.
You could also look at the FISH callback command too as another option.
Again, doing something like this each step (depending on model size) will likely be time consuming. So, consider using a Python library that does whatever you want to do in MatLab — in PFC itself. A bunch of scientific plotting libraries are already built-in, and with v900 you can add your own Python libraries more easily.