The subject presented in this paper concerns the approximation of a magnetostatic problem, where the primary unknown is the magnetic vector potential in a three-dimensional system composed of two solid parts separated by an interface. The approximation of the problem here is based on the mortar element method combined with edge elements on tetrahedral meshes that do not match at the interface. In this paper we describe the proposed method and its implementation aspects together with some numerical results that illustrate how the method works.Introduction. The flexibility and performance of a numerical method for the simulation of electromagnetic field distributions in electrotechnical devices relies, in several cases, on the possibility of working with nonmatching grids at the interface between adjacent subdomains. One example is given by the treatment of moving structures. We can choose to work in Eulerian coordinates, adding a convective term in the equations, or in Lagrangian coordinates, dealing with nonconforming discretizations. The second choice can be computationally more convenient whenever it is possible to avoid remeshing or interpolation procedures. Another example is the optimization of the structure shape. We can remesh either the whole domain or only a region containing the shape to be optimized: in the second case it can be useful to work with nonmatching grids to simplify the local remeshing task and successive solution of the problem. A third example consists of the possibility of coupling variational methods of different orders and types.In this paper we deal with the edge element approximation on nonmatching grids of a given magnetostatic problem in three dimensions. We will focus our attention on the description of the magnetic field distribution in a domain composed of two solid parts separated by an interface. We aim at describing the three-dimensional mortar edge element method and its main implementation aspects.The general problem of dealing with nonmatching grids in magneto-mechanical applications has been faced for a long time (see [15,16,17,20,24,29,31,32] for the main arguments that have been proposed since 1980 and [25] for further references on the subject). None of the existing methods is simultaneously characterized by involving positive definite matrices, avoiding remeshing and difficult intersection