chaos-polymtl / lethe

Repository for the open-source lethe CFD/DEM/CFD-DEM project
https://chaos-polymtl.github.io/lethe/index.html
GNU Lesser General Public License v2.1
267 stars 59 forks source link

Refactor DEM to remove function pointers #1098

Closed blaisb closed 3 months ago

blaisb commented 4 months ago

Description of the problem

Description of the solution

Comments

blaisb commented 4 months ago

@voferreira this is ready for a second review. I refactored the way the load balance is checked and called even more,this was extremely messy because the checks and the calls to load balance were all mingled. It was a freaking mess.

blaisb commented 4 months ago

I also updated a test that was behaving very weirdly (aka it was supposed to load balance every 200000k iterations, but would still do one load balancing even if the simulation had 100k iterations which makes no sense... This PR also fixes this odd behavior

blaisb commented 3 months ago

The revert to using std::function brings us a bit closer to the original implementation that used function pointers, although in a cleaner fashion. If you both (@OGaboriault and @voferreira ) think this is a cleaner implementation, then we can continue with it. However, in order to remain coherent, we need to do the same approach for the contact detection And the load balance. Now only the load balance is done with std::function. @OGaboriault can you modify the PR to use the same mechanism for the contact detection ?

voferreira commented 3 months ago

@blaisb To me it is a go. @OGaboriault Pin me and I will review it.

blaisb commented 3 months ago

I will rebase then merge after CI has passed :)