  We present a novel method of magnetohydrodynamics (MHD) within the smoothed
particle hydrodynamics scheme using the Geometric Density average force
expression (GDSPH). GDSPH has recently been shown to reduce the leading order
errors and greatly improve the accuracy near density discontinuities,
eliminating surface tension effects. Here, we extend the study to investigate
how SPMHD benefits from this method. We implement ideal MHD in the Gasoline2
and Changa codes with both GDSPH and traditional SPH (TSPH) schemes. An
constrained hyperbolic divergence cleaning scheme is employed to control the
divergence error, and a switch for artificial resistivity with minimized
dissipation is used. We test the codes with a large suite of MHD tests, and
show that in all problems the results are comparable or improved over previous
SPMHD implementations. While both GDSPH and TSPH perform well with relatively
smooth or highly supersonic flows, GDSPH shows significant improvements in the
presence of strong discontinuities and large dynamic scales. In particular,
when applied to an astrophysical problem of the collapse of a magnetized cloud,
GDSPH realistically captures the development of a magnetic tower and jet
launching in the weak-field regime, and exhibit fast convergence with
resolution, while TSPH failed to do so. Our new method shows qualitatively
similar results to the ones from the meshless finite mass/volume (MFM/MFV)
schemes within the Gizmo code, while remaining computationally less expensive.
