cmass: Centre of mass#

Differentiably compute a weight’s centre of mass.

Functionality is available that operates on the “intrinsic” mesh grid coordinates of a tensor (cmass(), cmass_reference_displacement_grid()) or that takes the last axis of a tensor to correspond to different locations and accepts a second argument that indicates explicitly the coordinates of each location (cmass_coor(), diffuse(), cmass_reference_displacement()).