This paper will propose an approach to increase the accuracy and efficiency of seeding algorithms of magnetic flux lines in magnetic field visualization. To obtain accurate and reliable visualization results, the density of the magnetic flux lines should map the magnetic induction intensity, and seed points should determine the density of the magnetic flux lines. However, the traditional seeding algorithm, which is a statistical algorithm based on data, will produce errors when computing magnetic flux through subdivision of the plane. To achieve higher accuracy, more subdivisions should be made, which will reduce efficiency. This paper analyzes the errors made when the traditional seeding algorithm is used and gives an improved algorithm. It then validates the accuracy and efficiency of the improved algorithm by comparing the results of the two algorithms with results from the equivalent magnetic flux algorithm.
Scientific visualization is used to assist in the estimation and evaluation of computational results and in the understanding of their physical meaning. Accurate and reliable visualization results should obey the physical rules. The key goal of three dimensional magnetic field visualization is to provide insight into field structures while an aesthetic image helps the user quickly recognize field patterns without visual distractions. A magnetic flux line is the most popular way to visualize a magnetic field, and it can be regarded as streamline. Most papers related to the streamline only discuss the placement quality, such as discontinuities, closure, cavities, speed, etc. Some papers have discussed the density of streamlines from an aesthetic aspect instead of discussing the physical accuracy (
However, in this traditional seeding algorithm, subdividing the plane is difficult, and approximations must be used in the process of computing the magnetic fluxes after division. This kind of approximation reduces the accuracy of understanding the field. To get higher accuracy, more subdivisions must be made, but this reduces the computation efficiency. Our paper presents an improved algorithm with which to solve this conflict. We first analyzed the error made by the traditional algorithm and found that the shape of the subdivision relates to this error. Therefore, choosing an appropriate subdivision according to the distribution of the magnetic field will improve accuracy. Based on this discovery, we proposed a feasible way to improve accuracy. Finally we compared the results computed from the two algorithms with that computed from the equivalent magnetic flux algorithm, which is based on analytic expressions and introduces no errors. Our work validates the accuracy and efficiency of the improved algorithm.
The procedure of the traditional algorithm is as follows:
Define the value of the total number of flux lines
Divide plane
Plane
Calculate the average magnetic flux value for each subplane
where i is the number of the subplane, B
d. Compute the number of flux lines in each subplane
where
In this way, the plane is divided into foursquares, and the average fluxes for each subplane are computed using the magnetic induction intensity values of the four vertexes. In this approximation process, error is introduced.
While discussing the intrinsic error caused by discrete points that contain only partial information about the magnetic field, the error brought about by the subdivision of the plane in the traditional seeding algorithm should be discussed as well. However, very few papers have discussed this issue. The average value of the magnetic induction intensity of the four vertexes is used to obtain the approximate magnetic flux of this lattice in the algorithm based on data. In this process, the error has been introduced, and we find that the accuracy of the approximation can actually be affected by the subdivision of the plane. Therefore, to improve accuracy we need to choose an appropriate subdivision according to the distribution of the magnetic field. This section presents the error analysis process.
First, we define the magnetic flux error as:
where ΔΦ = Φ – Φ’, Φ is the real magnetic flux, and Φ’ is the approximate magnetic flux.
As shown in Figure
The domain of subdivision along axis X and axis Y.
Under this assumption, the real and approximate magnetic fluxes are:
We will discuss the relationship between the shape of subplanes and the approximation error in the following two situations.
A.
where
Substitute
Under this distribution of magnetic induction intensity, we use the average magnetic induction intensity of four vertexes to compute the approximate magnetic flux of the subplane. The result is as follows:
Therefore, the error can be deduced:
This demonstrates that the approximate magnetic flux will always be equal to the real magnetic flux no matter which side is longer under linear conditions.
B.
(1)
We suppose:
where
By substituting
Then we select the average of four vertexes to compute the approximate magnetic flux:
Therefore,
If we define S as the area of the subplane,
Thus, the error becomes:
It is easy to get an error range 0 <
becomes, the smaller the error will be. In addition, the error will vary with starting point changes. Thus, the error of each lattice is different. Suppose the real magnetic flux of lattice 1 is Φ_{1} and that of lattice 2 is Φ_{2} ; then the magnetic fluxes become 1.5Φ_{1} and 1.1Φ_{2} with their errors
The variations of magnetic flux caused by the errors.
From Eqs. (16) and (17), we know that the shorter the side of the subplane along direction X, the higher the accuracy. This is because the exponent of variable
We can also discuss the error when the exponent of
(2)
(3) Take
Discussion is difficult under this condition. Perhaps the lattice is not suitable, and we need to use other kinds of curvilinear meshes, such as a rhombus. Thus the issue remains to be examined in further study.
There are also other nonlinear functions we have not discussed, but we aim to present one idea rather than discuss all the specific relationships between error and the shape of the subplane. In conclusion, to improve accuracy, variations of the magnetic induction intensity on a plane should be analyzed. Then we can divide the plane into appropriate subplanes.
According to the analyses in the above section, we propose an improved seeding algorithm that uses a more appropriate subdivision of the plane to reduce the approximate error in order to improve the accuracy of the magnetic flux lines density. The procedure of the improved algorithm is as follows:
Define the value of the total number of flux lines N and a plane S in 3D space from which flux lines will emerge.
Analyze the distribution of the magnetic induction intensity in the entire space and find the type of variation, either linear or nonlinear.
According to the variation type, choose the appropriate subdivision to get a high degree of precision.
Compute the approximate magnetic flux of each subplane and determine the number of flux lines in each subplane according to the flux result.
The final visualization result from the improved seeding algorithm can represent the physical property more accurately.
To validate the improved seeding algorithm, we use the results of the equivalent magnetic flux algorithm as an objective reflection of the magnetic field. The equivalent flux algorithm always chooses the areas that have the same flux according to the rule that the same flux value maps the same number of flux lines. The shape of the area should make the integration of the flux easy to compute, and the seed points are at the vertexes of each area. We choose as an example a magnetic field that can be represented accurately and objectively by an analytic expression because computation of the equivalent magnetic flux algorithm through analytic expression has no approximation. We believe that the magnetic flux of each subplane computed by this method is the real magnetic flux while the error of the seeding algorithm based on data comes from discrete points.
Thanks to the symmetry of the magnetic dipole field, the density distributions of the magnetic flux lines have the same symmetry. In this section we use the equivalent flux algorithm in a dipole field as an example. As shown in Figure
The distribution of magnetic flux lines from dipole field on the magnetic equatorial plane.
The formula for computing the magnetic flux is as follows:
Thus the magnetic fluxes of red area ABED and yellow area BCFE can be computed:
According to equivalent magnetic flux condition:
Finally we get the relationship:
From the analyses above, we can see that the magnetic flux lines pass vertically through the magnetic equatorial plane. Because the magnetic induction intensity does not change along the same magnetic latitude in a circle, the density distribution of the lines is uniform along the circle. Under the equivalent magnetic flux condition, the stronger the magnetic induction intensity is, the denser the magnetic flux lines and the smaller the area will be. This obeys the rule that the density of magnetic flux lines maps the magnetic induction intensity.
Due to the accuracy of the equivalent magnetic flux algorithm, the distribution of seed points computed from it can be used as the standard. To compare the accuracies of the traditional and improved algorithms using the equivalent magnetic flux algorithm as a standard, an equal number of magnetic flux lines should be used to express the magnetic field in the same area. If the numbers computed by these methods in the same subdomain of this area are equal to that computed by the equivalent magnetic algorithm, these two algorithms are both correct: otherwise, the errors should be analyzed.
We also take the magnetic dipole field as an example. First, Figure
The distribution of seed points from the equivalent magnetic flux algorithm.
The number of seed points in the blue area is 107 so we use 107 seed points to express the magnetic field in the blue area and compare the distributions in the subdomain of the blue area as calculated using the traditional algorithm and the equivalent magnetic flux algorithm.
We choose the subdomains as follows:
We need to divide the blue foursquare area into many small lattices before calculating the seed point distribution. Tables
The accuracies of the traditional and improved algorithms with the same number of grids using different subdivisions.
4/9x4/9 subdomain A  5/9x5/9 subdomain B  7/9x7/9 subdomain C  



18x18  27x27  36x36  18x18  27x27  36x36  18x18  27x27  36x36  
30.1211  30.1197  30.1192  43.6988  43.6973  43.6967  74.2201  74.2189  74.2185  
7.5754  7.5705  7.5688  1.6251  1.6216  1.6204  0.2975  0.2959  0.2953  
9x36  9x81  18x72  9x36  9x81  18x72  9x36  9x81  18x72  
30.1136  30.1128  30.1174  43.6903  43.6895  43.6946  74.2134  74.2127  74.2168  
7.5486  7.5458  7.5621  1.6053  1.6034  1.6155  0.2884  0.2874  0.2931 
The accuracies of the traditional and improved algorithms with a different numbers of grids using different subdivisions.
4/9x4/9 subdomain A  5/9x5/9 subdomain B  7/9x7/9 subdomain C  



18x18  27x27  36x36  18x18  27x27  36x36  18x18  27x27  36x36  
30.1211  30.1197  30.1192  43.6988  43.6973  43.6967  74.2201  74.2189  74.2185  
7.5754  7.5705  7.5688  1.6251  1.6216  1.6204  0.2975  0.2959  0.2953  
9x18  18x27  27x36  9x18  18x27  27x36  9x18  18x27  27x36  
30.1165  30.1189  30.1189  43.6937  43.6963  43.6964  74.2160  74.2182  74.2183  
7.5592  7.5675  7.5677  1.6132  1.6194  1.6196  0.2919  0.2949  0.2950 
The subdomain after subdivision is one foursquare in the traditional algorithm. Because
We compute the numbers of seed points in the subdomains with both algorithms using different types of subdivisions. The results are represented by the following two tables.
From Table
From the tables above, we conclude:
In the same area, the improved algorithm can get a higher accuracy than the traditional algorithm with the same number of grids;
A greater accuracy in the distribution of magnetic flux lines can be obtained from the improved algorithm with fewer subdivisions than from the traditional algorithm;
When choosing the larger subdomain of the blue area to be calculated, the results of both algorithms are closer to the equivalent magnetic flux algorithm.
The results verify the higher precision obtained by using the improved traditional algorithm.
This paper tells of our work in improving the traditional seeding algorithm to obtain more accurate visualization results and more computation efficiency. We found that the shape of the subdomain has an effect on the approximation of the computed magnetic flux. To get a more highly accurate magnetic flux, subdivisions of the plane should not always be foursquare. The shape should relate to the distribution of the magnetic induction intensity. Subdivisions along the direction in which the magnetic induction intensity changes more quickly should be smaller. Finally, we used the results computed by the equivalent magnetic flux algorithm based on analytic expression as an objective reflection of the magnetic field and compared the accuracies and efficiencies of the unimproved traditional algorithm with those of the improved algorithm. The results demonstrate that the improved algorithm is feasible.
We discussed only two types of magnetic fields, omitting discussion of other complex magnetic fields. In practice, choosing the appropriate subdivision according to the characteristics of the specific magnetic field is difficult. We need to choose appropriate coordinate systems and an optimal subdivision strategy, according to the distribution of the magnetic induction intensity. Perhaps we can choose rhombusshaped sectors, not just simple rectangles, for the shape of the subplanes. These issues need further study while this paper only reaches preliminary conclusions. We have aimed to propose an idea to improve accuracy, not to give concrete details appropriate for all cases.
The equivalent magnetic flux algorithm is based on analytic expressions and has no approximation. It provides a new idea about visualizing the 3D magnetic field by using the seeding algorithm based on analytic expressions. In the future we would like to extend the algorithm to other magnetic field types and discuss its applicability.
This work is partially supported by the Chinese Space Science Data Center, National Space Science Center, and the Chinese Academy of Sciences. We also thank the reviewers for their constructive suggestions and the editors for their careful check and revisions, which further improved this article.