Skip to content

New engine time averager

Benjamin Dedieu requested to merge newEngineTimeAverager into master

This new engine enables the averaging of data over time for specific spheres identified by their IDs. This approach is particularly beneficial when analysing forces on individual particles, where contact force signals can be very noisy if only instantaneous data is considered. By averaging the data, we reduce the need to store information at every time step, yet retain the true mean particle behaviour.

For now, the engine compute the following particle data : position, velocity, angular velocity, global resultant force and torque, resultant force and torque computed from contacts only and contact force field.

The data must be first initialized with its instantaneous value by running the initialization method. Then averaged values are updated at every time steps with a moving average algorithm, until the initialization method is run again. Common usage is to reinitialize the engine every time after we save the data (can be automated in a PyRunner).

I also implemented an option to compute the contact force field at the surface of the particle. It is obtained by distributing the contact forces on a grid at the surface of the sphere. The contact forces are spread on each point of the grid, according to the distance between the contact point and the grid point. The algorythm uses a gaussian kernel to smooth the field. The grid must be given by the user (for example we can easily distribute points on a sphere using a Fibonacci lattice). Depending on the number of grid points and the number of particles to treat, this can significantly increase the computation time however.

I developed this feature to support my PhD thesis, but as my PHD comes to an end, I did not have much time to refine the code. There might be better ways to implement it. I've included some suggestions at the top of the TimeAverager.cpp file.

Merge request reports

Loading