  We demonstrate that the frozen-ion contribution to the flexoelectric
coefficient is given solely in terms of the sum of third moments of the charge
density distortions induced by atomic displacements, even for ferroelectric or
piezoelectric materials. We introduce several practical supercell-based methods
for calculating these coefficients from first principles, and demonstrate them
by computing the coefficients for C, Si, MgO, NaCl, SrTiO$_3$, BaTiO$_3$, and
  PbTiO$_3$. Three important subtleties associated with pseudopotentials, the
treatment of surfaces, and the calculation of transverse components are also
discussed.
