Skip to content

PBs_volume_inertia_checkScripts

Vasileios Angelidakis requested to merge PBs_volume_inertia_checkScripts into master

In this commit I push some further improvements regarding the Potential Blocks code:

  • Migrated some functions from BlockGen.cpp to PotentialBlock.cpp, to calculate the volume and inertia tensor of a Potential Block. So far, the user had to define the volume and inertia tensor of a PB manually. Now, for each newly defined Potential Block, these are calculated automatically for any convex polyhedral shape, reducing pre-processing work and hopefully errors. I validated these against the "polyhedra" code and mesh-processing software packages (MeshLab & a Matlab code of mine, in particular). A big part of these codes was already developed by Boon in BlockGen.cpp, and I made some modifications to properly calculate the inertia tensor of a tetrahedron, using Tonon's formulae, like in the Tetra class. Also, I made sure that b.state.ori=Identity corresponds to the principal directions always (till now it depended on the coordinate system in which the user defined the particle).
  • Updated BlockGen to conform with the changes above.
  • Created a boolean in the BlockGen, to control whether the results of the block generation are written in a file or displayed on the terminal.
  • (Finally found the time to) push two check scripts for the PotentialBlocks and the BlockGen codes. :)
  • Removed unnecessary comments from PotentialBlock2AABB.cpp/hpp.
  • Simplified the example scripts cubePBscaled.py & WedgeYADE.py, removing the manual calculation of volume & inertia.
  • Updated the PBs & PPs documentation to follow the changes in the code.

Cheers, Vasileios

Edited by Vasileios Angelidakis

Merge request reports