  Planetary magnetic fields are generated by motions of electrically conducting fluids in their interiors. The dynamo problem has thus received much attention in spherical geometries, even though planetary bodies are non-spherical. To go beyond the spherical assumption, we develop an algorithm that exploits a fully spectral description of the magnetic field in triaxial ellipsoids to solve the induction equation with local boundary conditions (i.e. pseudo-vacuum or perfectly conducting boundaries). We use the method to compute the free-decay magnetic modes and to solve the kinematic dynamo problem for prescribed flows. The new method is thoroughly compared with analytical solutions and standard finite-element computations, which are also used to model an insulating exterior. We obtain dynamo magnetic fields at low magnetic Reynolds numbers in ellipsoids, which could be used as simple benchmarks for future dynamo studies in such geometries. We finally discuss how the magnetic boundary conditions can modify the dynamo onset, showing that a perfectly conducting boundary can strongly weaken dynamo action, whereas pseudo-vacuum and insulating boundaries often give similar results. 
Kinematic dynamos in triaxial ellipsoids