  The X-ray spectra observed in the persistent emission of magnetars are
evidence for the existence of a magnetosphere. The high-energy part of the
spectra is explained by resonant cyclotron upscattering of soft thermal photons
in a twisted magnetosphere, which has motivated an increasing number of efforts
to improve and generalize existing magnetosphere models. We want to build more
general configurations of twisted, force-free magnetospheres as a first step to
understanding the role played by the magnetic field geometry in the observed
spectra. First we reviewed and extended previous analytical works to assess the
viability and limitations of semi-analytical approaches. Second, we built a
numerical code able to relax an initial configuration of a nonrotating
magnetosphere to a force-free geometry, provided any arbitrary form of the
magnetic field at the star surface. The numerical code is based on a
finite-difference time-domain, divergence-free, and conservative scheme, based
of the magneto-frictional method used in other scenarios. We obtain new
numerical configurations of twisted magnetospheres, with distributions of twist
and currents that differ from previous analytical solutions. The range of
global twist of the new family of solutions is similar to the existing
semi-analytical models (up to some radians), but the achieved geometry may be
quite different. The geometry of twisted, force-free magnetospheres shows a
wider variety of possibilities than previously considered. This has
implications for the observed spectra and opens the possibility of implementing
alternative models in simulations of radiative transfer aiming at providing
spectra to be compared with observations.
