## 2 Principle of 3D Improved XFEM  
Two or more materials may be found in one element in XFEM. These elements crossed by the interface are so-called enrichment elements. Figure 1 shows the enrichment element and the conventional finite element in the 3D tetrahedron element. The level set method can be used to locate an interface or even track its movement. A spatially high one-dimensional level set function \(\phi\) denotes the interface under study, and the zero level set denotes the location of the interface. For the 3D electrostatic field problem studied in this paper, assuming that the bubble is a sphere with the center (\(x_{0}\), \(y_{0}\), \(z_{0}\)), the level set function \(\phi\) can be chosen as:  
\[\phi(x,y,z)=(x-x_{0})^{2}+(y-y_{0})^{2}+(z-z_{0})^{2}-r^{2} \tag{1}\]  
where \(x\), \(y\), \(z\) are the coordinates of a point; \(r\) is the radius of the sphere. Figure 2 is the schematic diagram of the 4D level set function. Different colors represent different function values. There are the same function value and color on the surface of the bubble sphere. Figure 1: Enrichment elements in 3D tetrahedron elements. Figure 2: 4D level set function. This paper takes the improved XFEM method in the electrostatic field as an example. An improved XFEM is presented to solve the Poisson equation shown in Equation (2) for fast calculation of 3D potential distribution. \[\
abla\cdot(\varepsilon\
abla\varphi)=-\frac{\rho}{\varepsilon_{0}} \tag{2}\]  
where \(\varphi\) is the potential, \(\varepsilon\) represents the permittivity of the medium, \(\varepsilon_{0}\) represents the vacuum permittivity, and \(\rho\) stands for bulk charge density. Equation (3) shows the interpolation function of potential used by CFEM. XFEM improves the approximate solution expression of CFEM. The material interface is taken into account and a set of degrees of freedom of enrichment nodes is added. XFEM interpolation function is shown in Equation (4). \[\varphi(x,y,z)=\sum_{i\in I}N_{i}(x,y,z)\alpha_{i} \tag{3}\]  
\[\varphi(x,y,z)=\sum_{i\in I}N_{i}(x,y,z)\alpha_{i}+\sum_{j\in I^{*}}N_{j}(x,y, z)\Phi(x,y,z)\beta_{j} \tag{4}\]  
\[\Phi(x,y,z)=\sum_{I}N_{i}(x,y,z)\cdot|\varphi_{i}|-\left|\sum_{I}N_{i}(x,y,z) \cdot\varphi_{i}\right| \tag{5}\]  
in the discretized domain, where \(I\) is the set of all nodes, \(I^{*}\) is the set of the enriched nodes, \(I^{*}\)\(\in\)\(I\), \(N_{i}\), \(N_{j}\) are the shape functions, \(\Phi\) is the enrichment function as shown in Equation (5), and \(\alpha_{i}\) and \(\beta_{j}\) are nodal unknowns. Much electrical equipment has a complex structure and contains a large number of dense thin layers. The space size of different parts sometimes differs by dozens or even thousands of orders of magnitude. The improved XFEM adjusts the description method of interfaces. By setting a corresponding level set function for each interface, it allows more than two interfaces to appear in one element. The level set on each node is no longer a single value but multiple values due to the number of interfaces in the element. The interface description method when there are two interfaces in the same element under 3D XFEM is shown in Figure 3. The level set function value increases gradually from the center of the sphere to the outside. The value of the function at the interface is zero. The approximate expression of improved XFEM potential is shown as follow:  
\[\varphi(x,y,z)=\sum_{i\in I}N_{i}(x,y,z)\alpha_{i}+\sum_{k}^{N}\sum_{j\in I^{* }}N_{j}(x,y,z)\Phi_{(k)}(x,y,z)\beta_{j(k)} \tag{6}\]  
where \(k=1,2,\ldots,N\), which is the indexing of the interface. This improved XFEM using the 4D level set function is proposed based on 1D and quasi 3D improved XFEM methods. The scope of application is 3D electromagnetic field numerical calculation.