Unit cell density calculation