Vector field visualization method, system, storage medium, and ferroelectric polarization field vector field visualization method
By calculating the magnitude of the vector field and mapping the coloring function to the RGB color space, this method solves the problems of high computational complexity and low accuracy in high-density scenes in existing technologies, and achieves efficient and accurate vector field visualization, which is suitable for real-time observation and analysis of large-scale data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU INTERNATIONAL INNOVATION INSTITUTE OF BEIHANG UNIVERSITY
- Filing Date
- 2025-09-04
- Publication Date
- 2026-07-21
AI Technical Summary
Existing vector field visualization methods suffer from high computational complexity and poor real-time performance in high-density scenes, and low computational accuracy at angular boundaries, leading to visual confusion and fuzzy classification, making it difficult to achieve efficient and accurate dynamic observation and analysis.
By calculating the magnitude of the vector field, normalizing it, and mapping it based on a coloring function, the vector field data is mapped to the RGB color space and visualized using a method that does not require trigonometric functions. The process includes data acquisition, magnitude calculation, normalization, vector field mapping, and color mapping steps.
It achieves efficient, reliable, and accurate vector field visualization, can accurately distinguish vector directions, is suitable for large-scale data, and supports real-time observation and analysis.
Smart Images

Figure CN121170058B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computational visualization technology, specifically relating to a vector field visualization method, system, storage medium, and a visualization method for ferroelectric polarization vector fields. Background Technology
[0002] In the field of computational visualization, the visualization of vector fields has always been one of the key means to understand various types of physical phenomena. Vector fields are widely present in fields such as computational fluid dynamics (CFD), electromagnetism, and geomechanics, for example, the velocity field of fluids, the intensity distribution of electromagnetic fields, and the microstructure of polarization fields in ferroelectrics. To more quickly and scientifically understand the properties and characteristics of vector fields, their visualization has always been one of the most important methods.
[0003] Currently, commonly used vector field visualization schemes include geometric representation schemes, texture mapping schemes, and color encoding schemes. Geometric representation schemes generally use geometric elements such as arrows, streamlines, and tubes to visually depict vector directions; for example, the arrow method uses the direction and length of the arrow to show the vector direction and magnitude. However, when facing high-density vector fields, these schemes are prone to arrows (or streamlines, tubes, etc.) occluding each other, causing visual confusion and making it difficult to grasp the overall trend of the vector field. Texture mapping schemes are generally represented by line integral convolution (LIC); this scheme uses the direction of the texture pattern to reflect the vector trend; however, the calculation process of this type of scheme involves a large number of integral operations, resulting in extremely high computational complexity. It is difficult to achieve real-time updates in scenarios with high real-time requirements, and therefore cannot meet the needs of real-time observation and analysis of dynamic vector fields. Color coding schemes typically map vector directions to colors, such as using hue to represent vector directions in the HSV color space. A common approach is based on angle calculations, such as using the arctan2 function to calculate the angle between a vector and the coordinate axes, and then mapping the angle to the corresponding color. However, this method has significant drawbacks: on the one hand, frequent calls to trigonometric functions lead to low computational efficiency, and the computation time increases significantly when processing large-scale vector field data, such as data containing millions of grid points; on the other hand, at angular boundaries, due to the issue of computational precision, classification ambiguity can easily occur, making it impossible to accurately classify vector directions. Summary of the Invention
[0004] One of the objectives of this invention is to provide a vector field visualization method that is highly reliable, accurate, and efficient.
[0005] The second objective of this invention is to provide a system for implementing the aforementioned vector field visualization method.
[0006] A third objective of this invention is to provide a storage medium on which a computer program is stored; when the computer program is executed by a processor, it implements the vector field visualization method.
[0007] The fourth objective of this invention is to provide a visualization method for ferropolar polarization vector fields that includes the aforementioned vector field visualization method.
[0008] The vector field visualization method provided by this invention includes the following steps:
[0009] S1. Obtain data information of the target vector field;
[0010] S2. Calculate the magnitude of the target vector field based on the data obtained in step S1;
[0011] S3. Based on the modulus obtained in step S2, normalize the data of the target vector field;
[0012] S4. Based on the direction the vector points, and using the coloring function, map the target vector field to the real number interval;
[0013] S5. Map the coloring function to the RGB color space;
[0014] S6. Complete the visualization of the target vector field.
[0015] Step S1, which involves obtaining the target vector field data information, specifically includes the following steps:
[0016] Acquire data information of the target vector field; the data information is two-dimensional vector field data information or three-dimensional vector field data information;
[0017] Information formats include binary format, binary / text format, and text format.
[0018] Step S2, which involves calculating the magnitude of the target vector field based on the data obtained in step S1, specifically includes the following steps:
[0019] If the target vector field is a two-dimensional vector field, the modulus R is calculated using the following formula:
[0020]
[0021] In the formula, P1 is the component of the vector field in direction 1 in the Cartesian coordinate system; P2 is the component of the vector field in direction 2 in the Cartesian coordinate system.
[0022] If the target vector field is a three-dimensional vector field, the modulus R is calculated using the following formula:
[0023]
[0024] In the formula, P1 is the component of the vector field in direction 1 in the Cartesian coordinate system; P2 is the component of the vector field in direction 2 in the Cartesian coordinate system; and P3 is the component of the vector field in direction 3 in the Cartesian coordinate system.
[0025] Step S3, which involves normalizing the target vector field data based on the modulus obtained in step S2, specifically includes the following steps:
[0026] If the target vector field is a two-dimensional vector field, then the following formula is used for normalization:
[0027]
[0028] In the formula The component of the normalized vector field in the 1 direction in the Cartesian coordinate system; These are the components of the normalized vector field in the Cartesian coordinate system in two directions.
[0029] If the target vector field is a three-dimensional vector field, then the following formula is used for normalization:
[0030]
[0031]
[0032] In the formula The component of the normalized vector field in the 1 direction in the Cartesian coordinate system; These are the components of the normalized vector field in the Cartesian coordinate system in two directions. This represents the component of the vector field in the 1 direction in the Cartesian coordinate system after normalization.
[0033] Step S4, which maps the target vector field to the real number interval based on the direction the vector points and the coloring function, specifically includes the following steps:
[0034] If the target vector field is a two-dimensional vector field, then the following function is used as the two-dimensional coloring function C(P1,P2):
[0035]
[0036] In the formula, A1 is the first coefficient; A2 is the second coefficient; and A3 is the third coefficient.
[0037] A set of two-dimensional vector components (P1, P2) corresponds to a point in the target vector field; the two-dimensional coloring function C(P1, P2) can map a set of two-dimensional vector components (P1, P2) to an integer; all two-dimensional vector components in the target vector field are mapped using the two-dimensional coloring function C(P1, P2); finally, four integers are obtained, each integer corresponding to a direction in the two-dimensional vector field;
[0038] If the target vector field is a three-dimensional vector field, then the following function is used as the three-dimensional coloring function D(P1,P2,P3):
[0039]
[0040] In the formula, A4 is the fourth coefficient; A5 is the fifth coefficient; A6 is the sixth coefficient; A7 is the seventh coefficient; and A8 is the eighth coefficient. This is the floor function;
[0041] A set of three-dimensional vector components (P1, P2, P3) corresponds to a point in the target vector field; the three-dimensional coloring function D(P1, P2, P3) can map a set of three-dimensional vector components (P1, P2, P3) to an integer; all three-dimensional vector components in the target vector field are mapped using the three-dimensional coloring function D(P1, P2, P3); finally, 6 integers are obtained, each integer corresponding to a direction in the three-dimensional vector field.
[0042] Step S5, which maps the coloring function to the RGB color space, specifically includes the following steps:
[0043] Two-dimensional case:
[0044] The integers corresponding to the four directions obtained in step S4 are respectively 0, 1, 2 and 3;
[0045] Each integer {0,1,2,3} is assigned a hue in the color wheel at 90° intervals; for example, 0 corresponds to H=0; 1 corresponds to H=90; 2 corresponds to H=180; and 3 corresponds to H=270.
[0046] Assign brightness and saturation to each integer {0,1,2,3};
[0047] Mapping HSV values to the RGB color space involves the following steps:
[0048] The normalized hue H' is calculated to be H' = H / 60°, where H is the hue;
[0049] The calculated hue region index i is in This is a round-down operation;
[0050] The calculated sub-index f for the hue region is f = H' - i;
[0051] The initial color vector {p,q,t} is calculated as follows: p = V × (1-S), q = V × (1-S × f); t = V × (1-S × (1-f)); where V is lightness, S is saturation, p is the first component, q is the second component, and t is the third component.
[0052] Based on the value of i, the values of R, G, and B are determined using the following rules:
[0053] If i = 0, then R = V, G = t, and B = p;
[0054] If i = 1, then R = q, G = V, and B = p;
[0055] If i = 2, then R = p, G = V, and B = t;
[0056] If i = 3, then R = p, G = q and B = V;
[0057] If i = 4, then R = t, G = p, and B = V;
[0058] If i = 5, then R = V, G = p, and B = q.
[0059] Three-dimensional situation:
[0060] The integers corresponding to the six directions obtained in step S4 are 0, 1, 2, 3, 4 and 5 respectively;
[0061] Each integer {0,1,2,3,4,5} is assigned a hue in the color wheel at 60° intervals; for example, 0 corresponds to H=0, 1 corresponds to H=60, 2 corresponds to H=120, 3 corresponds to H=180, 4 corresponds to H=240, and 5 corresponds to H=300.
[0062] Assign brightness and saturation to each integer {0,1,2,3,4,5};
[0063] Mapping HSV values to the RGB color space involves the following steps:
[0064] The normalized hue H' is calculated to be H' = H / 60°, where H is the hue;
[0065] The calculated hue region index i is in This is a round-down operation;
[0066] The calculated sub-index f for the hue region is f = H' - i;
[0067] The initial color vector {p,q,t} is calculated as follows: p = V × (1-S), q = V × (1-S × f); t = V × (1-S × (1-f)); where V is lightness, S is saturation, p is the first component, q is the second component, and t is the third component.
[0068] Based on the value of i, the values of R, G, and B are determined using the following rules:
[0069] If i = 0, then R = V, G = t, and B = p;
[0070] If i = 1, then R = q, G = V, and B = p;
[0071] If i = 2, then R = p, G = V, and B = t;
[0072] If i = 3, then R = p, G = q and B = V;
[0073] If i = 4, then R = t, G = p, and B = V;
[0074] If i = 5, then R = V, G = p, and B = q.
[0075] This invention also provides a system for implementing the aforementioned vector field visualization method, comprising a data acquisition module, a modulus calculation module, a normalization module, a vector field mapping module, a function mapping module, and a vector field visualization module; the data acquisition module, modulus calculation module, normalization module, vector field mapping module, function mapping module, and vector field visualization module are connected in series; the data acquisition module acquires data information of the target vector field and uploads the data information to the modulus calculation module; the modulus calculation module calculates the modulus of the target vector field based on the received data information and the acquired data information, and uploads the data information to the normalization module; the normalization module normalizes the data of the target vector field based on the received data information and the obtained modulus, and uploads the data information to the vector field mapping module; the vector field mapping module maps the target vector field to the real number interval based on the direction of the vector and a coloring function, and uploads the data information to the function mapping module; the function mapping module maps the coloring function to the RGB color space, and uploads the data information to the vector field visualization module; the vector field visualization module visualizes the target vector field based on the received data information.
[0076] The present invention also provides a storage medium on which a computer program is stored; when the computer program is executed by a processor, it implements the vector field visualization method.
[0077] The present invention also provides a method for visualizing a ferroelectric polarization vector field, including the aforementioned vector field visualization method, comprising the following steps:
[0078] A. Spatial distribution information of polarization field in ferroelectric materials can be obtained through finite element calculations or experimental characterization.
[0079] B. Based on the data information obtained in step A, classify the vector data according to its spatial dimension (2D or 3D);
[0080] C. Based on the classification results obtained in step B, visualize them using the vector field visualization method described above.
[0081] The vector field visualization method, system, storage medium, and ferroelectric polarization vector field visualization method provided by this invention, through the calculation of modulus and data normalization, as well as the design and mapping of coloring functions, not only realizes the visualization of vector fields and ferroelectric polarization vector fields, but also has higher reliability, better accuracy, and higher efficiency. Attached Figure Description
[0082] Figure 1 This is a schematic diagram of the method flow for the vector field visualization method of the present invention.
[0083] Figure 2 This is a schematic diagram of the staining effect of the first embodiment of the vector field visualization method of the present invention.
[0084] Figure 3 This is a schematic diagram of the coloring effect on a unit sphere in a second embodiment of the vector field visualization method of the present invention.
[0085] Figure 4 This is a schematic diagram of the coloring effect of a vector field on a three-dimensional structured mesh, representing a second embodiment of the vector field visualization method of the present invention.
[0086] Figure 5 This is a schematic diagram of the functional modules of the system of the present invention.
[0087] Figure 6 This is a schematic diagram of the method flow for visualizing the ferroelectric polarization field vector field of the present invention. Detailed Implementation
[0088] like Figure 1 The diagram shown is a flowchart of the vector field visualization method of the present invention: The vector field visualization method disclosed in this invention includes the following steps:
[0089] S1. Obtain the target vector field data information; specifically including the following steps:
[0090] Acquire data information of the target vector field; the data information is two-dimensional vector field data information or three-dimensional vector field data information;
[0091] Information formats include binary formats (such as FGA format), binary / text formats (such as VTK format), and text formats (such as JSON format);
[0092] For example, a two-dimensional ferroelectric domain structure simulation data can be used as an implementation example. This simulation data uses a phase-field model and the Ginzburg-Landau equation to calculate the evolution of the ferroelectric microdomain structure over time. Each node has a vector field representing polarization, which is P(P1,P2) in the two-dimensional case and P(P1,P2,P3) in the three-dimensional case. Since the polarization field strength is constrained by the equation, its modulus |P| is distributed around the spontaneous polarization field strength P_0, and the probability that 0 < |P| < 1.5P_0 is greater than 98%. This invention selects data when the polarization evolution is stable as the input data for the implementation example.
[0093] S2. Based on the data obtained in step S1, calculate the magnitude of the target vector field; specifically, this includes the following steps:
[0094] If the target vector field is a two-dimensional vector field, the modulus R is calculated using the following formula:
[0095]
[0096] In the formula, P1 is the component of the vector field in direction 1 in the Cartesian coordinate system; P2 is the component of the vector field in direction 2 in the Cartesian coordinate system.
[0097] If the target vector field is a three-dimensional vector field, the modulus R is calculated using the following formula:
[0098]
[0099] In the formula, P1 is the component of the vector field in direction 1 in the Cartesian coordinate system; P2 is the component of the vector field in direction 2 in the Cartesian coordinate system; and P3 is the component of the vector field in direction 3 in the Cartesian coordinate system.
[0100] S3. Based on the modulus obtained in step S2, normalize the target vector field data; specifically, this includes the following steps:
[0101] If the target vector field is a two-dimensional vector field, then the following formula is used for normalization:
[0102]
[0103] In the formula The component of the normalized vector field in the 1 direction in the Cartesian coordinate system; These are the components of the normalized vector field in the Cartesian coordinate system in two directions.
[0104] If the target vector field is a three-dimensional vector field, then the following formula is used for normalization:
[0105]
[0106] In the formula The component of the normalized vector field in the 1 direction in the Cartesian coordinate system; These are the components of the normalized vector field in the Cartesian coordinate system in two directions. The component of the normalized vector field in the 1 direction in the Cartesian coordinate system;
[0107] S4. Based on the direction the vector points and using the coloring function, map the target vector field to the real number interval; specifically, this includes the following steps:
[0108] If the target vector field is a two-dimensional vector field, then the following function is used as the two-dimensional coloring function C(P1,P2):
[0109]
[0110] In the formula, A1 is the first coefficient; A2 is the second coefficient; and A3 is the third coefficient. As a set of preferred values, A1 takes the value of 2, A2 takes the value of 1, and A3 takes the value of 1.
[0111] A set of two-dimensional vector components (P1, P2) corresponds to a point in the target vector field; the two-dimensional coloring function C(P1, P2) can map a set of two-dimensional vector components (P1, P2) to an integer; all two-dimensional vector components in the target vector field are mapped using the two-dimensional coloring function C(P1, P2); finally, four integers are obtained, each integer corresponding to a direction in the two-dimensional vector field; and the values of these four integers are related to the values of the first coefficient, the second coefficient, and the third coefficient.
[0112] If the target vector field is a three-dimensional vector field, then the following function is used as the three-dimensional coloring function D(P1,P2,P3):
[0113]
[0114] In the formula, A4 is the fourth coefficient; A5 is the fifth coefficient; A6 is the sixth coefficient; A7 is the seventh coefficient; and A8 is the eighth coefficient. This is the floor function; as a set of preferred values, A4 takes the value 1, A5 takes the value 2, A6 takes the value 3, A7 takes the value 2, and A8 takes the value 1.
[0115] The algorithm logic for two-dimensional vectors differs from that for three-dimensional vectors. In two-dimensional vectors, the vectors are normalized, rotated 45°, and then rounded. In three-dimensional vectors, the vectors are normalized, affine transformation is performed, and then the rounding is applied.
[0116] A set of three-dimensional vector components (P1, P2, P3) corresponds to a point in the target vector field; the three-dimensional coloring function D(P1, P2, P3) can map a set of three-dimensional vector components (P1, P2, P3) to an integer; all three-dimensional vector components in the target vector field are mapped using the three-dimensional coloring function D(P1, P2, P3); finally, six integers are obtained, each integer corresponding to a direction in the three-dimensional vector field; and the values of these six integers are related to the values of the fourth to eighth coefficients;
[0117] S5. Map the coloring function to the RGB color space; this includes the following steps:
[0118] Two-dimensional case:
[0119] The integers corresponding to the four directions obtained in step S4 are assigned to 0, 1, 2 and 3 respectively; for example, the integers corresponding to the four directions obtained in step S4 can be arranged from smallest to largest and assigned to 0 to 3 respectively.
[0120] Each integer {0,1,2,3} is assigned a hue in the color wheel at 90° intervals; for example, 0 corresponds to H=0; 1 corresponds to H=90; 2 corresponds to H=180; and 3 corresponds to H=270.
[0121] Assign brightness and saturation to each integer {0,1,2,3};
[0122] Mapping HSV values to the RGB color space involves the following steps:
[0123] The normalized hue H' is calculated to be H' = H / 60°, where H is the hue;
[0124] The calculated hue region index i is in This is a round-down operation;
[0125] The calculated sub-index f for the hue region is f = H' - i;
[0126] The initial color vector {p,q,t} is calculated as follows: p = V × (1-S), q = V × (1-S × f); t = V × (1-S × (1-f)); where V is lightness, S is saturation, p is the first component, q is the second component, and t is the third component.
[0127] Based on the value of i, the values of R, G, and B are determined using the following rules:
[0128] If i = 0, then R = V, G = t, and B = p;
[0129] If i = 1, then R = q, G = V, and B = p;
[0130] If i = 2, then R = p, G = V, and B = t;
[0131] If i = 3, then R = p, G = q and B = V;
[0132] If i = 4, then R = t, G = p, and B = V;
[0133] If i = 5, then R = V, G = p, and B = q.
[0134] Three-dimensional situation:
[0135] The integers corresponding to the six directions obtained in step S4 are assigned to 0, 1, 2, 3, 4 and 5 respectively; for example, the integers corresponding to the six directions obtained in step S4 can be arranged from smallest to largest and assigned to 0 to 5 respectively.
[0136] Each integer {0,1,2,3,4,5} is assigned a hue in the color wheel at 60° intervals; for example, 0 corresponds to H=0, 1 corresponds to H=60, 2 corresponds to H=120, 3 corresponds to H=180, 4 corresponds to H=240, and 5 corresponds to H=300.
[0137] Assign brightness and saturation to each integer {0,1,2,3,4,5};
[0138] Mapping HSV values to the RGB color space involves the following steps:
[0139] The normalized hue H' is calculated to be H' = H / 60°, where H is the hue;
[0140] The calculated hue region index i is in This is a round-down operation;
[0141] The calculated sub-index f for the hue region is f = H' - i;
[0142] The initial color vector {p,q,t} is calculated as follows: p = V × (1-S), q = V × (1-S × f); t = V × (1-S × (1-f)); where V is lightness, S is saturation, p is the first component, q is the second component, and t is the third component.
[0143] Based on the value of i, the values of R, G, and B are determined using the following rules:
[0144] If i = 0, then R = V, G = t, and B = p;
[0145] If i = 1, then R = q, G = V, and B = p;
[0146] If i = 2, then R = p, G = V, and B = t;
[0147] If i = 3, then R = p, G = q and B = V;
[0148] If i = 4, then R = t, G = p, and B = V;
[0149] If i = 5, then R = V, G = p, and B = q;
[0150] In practice, a specific color mapping table instance (paraview format) is as follows:
[0151] Two-dimensional:
[0152] <colormaps>
[0153] <ColorMap space="HSV"indexedLookup="false"name="blot">
[0154] <Point x="-3.5"o="0"r="128"g="0"b="0" / >
[0155] <Point x="-2.5"o="0"r="128"g="0"b="0" / >
[0156] <Point x="-2.5"o="0"r="128"g="128"b="0" / >
[0157] <Point x="-1.5"o="0"r="128"g="128"b="0" / >
[0158] <Point x="-1.5"o="0"r="0"g="128"b="128" / >
[0159] <Point x="-0.5"o="0"r="0"g="128"b="128" / >
[0160] <Point x="-0.5"o="0"r="128"g="0"b="128" / >
[0161] <Point x="0.5"o="0"r="128"g="0"b="128" / >
[0162] <NaN r="0"g="0"b="0" / >
[0163]
[0164] A possible set of RGB values for the six colors (top, bottom, left, right, front, back) of a 3D vector is:
[0165] Top: RGB(128,0,0)
[0166] Below: →RGB(128,128,0)
[0167] Left: →RGB(0,128,0)
[0168] Right: →RGB(0,128,128)
[0169] Forward: →RGB(0,0,128)
[0170] After: →RGB(128,0,128)
[0171] S6. Complete the visualization of the target vector field.
[0172] The following example illustrates the effectiveness of the vector field visualization method of the present invention:
[0173] There is a set of data on the distribution of 2D ferroelectric domain structure calculated by the finite element method. The grid is a 100x100 2D quadrilateral grid with 10201 nodes and 10000 elements. Each node stores a polarization field vector P(u1,u2). The vector value is stored in text form and encoded in VTK format.
[0174] First, import the .vtk file into the Paraview software.
[0175] In the pipeline module, the calculator calculates the two-dimensional coloring function value C for (u1, u2) using the S4 algorithm:
[0176] C=2*floor((u_0 / sqrt(u_0^2+u_1^2)+u_1 / sqrt(u_0^2+u_1^2)) / sqrt(2))+floor((u_0 / sqrt(u_0^2+u_1^2)-u_1 / sqrt(u_0^2+u_1^2)) / sqrt(2))
[0177] A color mapping table obtained using the method in step S5 is applied to variable C, and its effect is... Figure 2 As shown (this process does not require conditional statements or trigonometric functions).
[0178] Figure 2 The left side shows a 100x100 node ferroelectric domain structure diagram, and the right side is the legend. By calculating the coloring function and the corresponding color mapping table, the vectors in the four directions can be successfully labeled with four colors.
[0179] The above algorithm does not depend on Paraview software and can be implemented directly using Python NumPy combined with Matplotlib to generate images.
[0180] Another example of a three-dimensional vector is shown below:
[0181] There is a set of data on the distribution of 3D ferroelectric domain structure calculated by the finite element method. The mesh is a 100×100×100 3D hexahedral mesh with 1,030,301 nodes and 1,000,000 elements. Each node stores a polarization field vector P(u1,u2,u3). The vector values are stored in text form and encoded in VTK format.
[0182] First, import the .vtk file into the Paraview software.
[0183] In the pipeline module, the calculator calculates the two-dimensional coloring function value D for (u1, u2, u3) using the S4 algorithm:
[0184] D=floor((sqrt(3)*u1 / (sqrt(u1*u1+u2*u2+u3*u3)+1e-12)+1) / 2)+2*floor((sqrt(3)
[0185] *u2 / (sqrt(u1*u1+u2*u2+u3*u3)+1e-12)+1) / 2)+3*floor((sqrt(3)*u3 / (sqrt(u1*u1+u2*u2+u3*u3)+1e-12)+1) / 2)
[0186] A three-dimensional color mapping table obtained using the method in step S5 is applied to variable C; its coloring effect on a unit sphere is as follows: Figure 3 As shown;
[0187] The final coloring effect of the vector field on the three-dimensional structured mesh is as follows: Figure 4 As shown:
[0188] pass Figure 4 As can be seen, by calculating the coloring function and the corresponding color mapping table, the vectors in the six directions can be successfully labeled with six colors. As can be seen from the white vector arrows, the colors correctly reflect the vector directions.
[0189] like Figure 5 The diagram shows the functional modules of the system of the present invention: The system for implementing the vector field visualization method disclosed in this invention includes a data acquisition module, a modulus calculation module, a normalization module, a vector field mapping module, a function mapping module, and a vector field visualization module; these modules are connected in series. The data acquisition module acquires data information of the target vector field and uploads the data information to the modulus calculation module. The modulus calculation module calculates the modulus of the target vector field based on the received data information and the acquired data information, and then uploads the data information to the modulus calculation module. The module uploads a normalization module; this module normalizes the target vector field data based on the received data and the obtained modulus, and then uploads the data to the vector field mapping module; the vector field mapping module maps the target vector field to the real number interval based on the received data, the direction of the vector, and a coloring function, and then uploads the data to the function mapping module; the function mapping module maps the coloring function to the RGB color space based on the received data, and then uploads the data to the vector field visualization module; the vector field visualization module visualizes the target vector field based on the received data.
[0190] The vector field visualization method provided by this invention can discretize vectors according to different principal directions, and can efficiently and accurately obtain the spatial distribution of vector fields without relying on trigonometric functions and other elementary functions, thereby obtaining the trend of vector field changes over time and realizing quantitative analysis of vector field structure.
[0191] like Figure 6 The diagram shown is a flowchart of the method for visualizing the ferropolar polarization vector field according to the present invention: The method for visualizing the ferropolar polarization vector field disclosed in this invention, which includes the aforementioned vector field visualization method, comprises the following steps:
[0192] A. Spatial distribution information of polarization field in ferroelectric materials can be obtained through finite element calculations or experimental characterization.
[0193] B. Based on the data information obtained in step A, classify the vector data according to its spatial dimension (2D or 3D);
[0194] C. Based on the classification results obtained in step B, visualize them using the vector field visualization method described above.
[0195] By visualizing the ferroelectric polarization vector field, the ferroelectric polarization direction can be quickly determined, thereby obtaining the spatial distribution of the ferroelectric domain structure and directly acquiring information on the 180-degree domain wall and 90-degree domain wall. This provides an efficient, accurate, and highly applicable mathematical tool for the domain structure analysis of ferroelectric thin films.
[0196] Furthermore, the vector field visualization method disclosed in this invention is also applicable to vector field visualization in fields such as ferromagnetic physics, fluid mechanics, phase transition physics, oceanography, and atmosphere.< / colormaps>
Claims
1. A method for visualizing vector fields, comprising the following steps: S1. Obtain data information of the target vector field; S2. Calculate the magnitude of the target vector field based on the data obtained in step S1; S3. Based on the modulus obtained in step S2, normalize the data of the target vector field; S4. Based on the direction the vector points and using the coloring function, map the target vector field to the real number interval; specifically, this includes the following steps: If the target vector field is a two-dimensional vector field, then the following function is used as the two-dimensional coloring function. : In the formula The first coefficient; The second coefficient; It is the third coefficient; A set of two-dimensional vector components Corresponding to a point in the target vector field; two-dimensional coloring function Able to convert a set of two-dimensional vector components Mapped to an integer; all two-dimensional vector components in the target vector field are colored using a two-dimensional coloring function. The mapping is performed, resulting in four integers, each corresponding to a direction in the two-dimensional vector field. If the target vector field is a three-dimensional vector field, then the following function is used as the three-dimensional coloring function. : In the formula It is the fourth coefficient; It is the fifth coefficient; It is the sixth coefficient; It is the seventh coefficient; It is the eighth coefficient; This is the floor function; The component of the normalized vector field in the 1 direction in the Cartesian coordinate system; These are the components of the normalized vector field in the Cartesian coordinate system in two directions. These are the components of the normalized vector field in the Cartesian coordinate system in three directions. A set of three-dimensional vector components Corresponding to a point in the target vector field; three-dimensional coloring function Able to combine a set of three-dimensional vector components Mapped to an integer; all three-dimensional vector components in the target vector field are colored using a three-dimensional coloring function. The mapping process is performed, resulting in six integers, each corresponding to a direction in the three-dimensional vector field. Let be the component of the vector field in the 1 direction in the Cartesian coordinate system; Let be the two-direction components of the vector field in Cartesian coordinates; These are the components of the vector field in three directions in the Cartesian coordinate system; S5. Map the coloring function to the RGB color space; this includes the following steps: Two-dimensional case: The integers corresponding to the four directions obtained in step S4 are respectively 0, 1, 2 and 3; Each integer Press in the color wheel Assign hue; For each integer Assign brightness and saturation; Mapping HSV values to the RGB color space involves the following steps: Normalized hue was calculated for ,in Hue; Calculated hue region index for ,in This is a round-down operation; Calculate the sub-index of hue region for ; The initial color vector is calculated. : , ; ;in For brightness, For saturation, As the first component, For the second component, It is the third component; Based on the value of i, the values of R, G, and B are determined using the following rules: like ,but , and ; like ,but , and ; like ,but , and ; like ,but , and ; like ,but , and ; like ,but , and ; Three-dimensional situation: The integers corresponding to the six directions obtained in step S4 are 0, 1, 2, 3, 4 and 5 respectively; Each integer Press in the color wheel Assign hue; For each integer Brightness and saturation; Mapping HSV values to the RGB color space involves the following steps: Normalized hue was calculated for ,in Hue; Calculated hue region index for ,in This is a round-down operation; Calculate the sub-index of hue region for ; The initial color vector is calculated. : , ; ;in For brightness, For saturation, As the first component, For the second component, It is the third component; Based on the value of i, the values of R, G, and B are determined using the following rules: like ,but , and ; like ,but , and ; like ,but , and ; like ,but , and ; like ,but , and ; like ,but , and ; S6. Complete the visualization of the target vector field.
2. The vector field visualization method according to claim 1, characterized in that... Step S1, which involves obtaining the target vector field data information, specifically includes the following steps: Acquire data information of the target vector field; the data information is two-dimensional vector field data information or three-dimensional vector field data information; Information formats include binary format, binary / text format, and text format.
3. The vector field visualization method according to claim 2, characterized in that... Step S2, which involves calculating the magnitude of the target vector field based on the data obtained in step S1, specifically includes the following steps: If the target vector field is a two-dimensional vector field, the modulus is calculated using the following formula. : In the formula Let be the component of the vector field in the 1 direction in the Cartesian coordinate system; Let be the two-direction components of the vector field in Cartesian coordinates; If the target vector field is a three-dimensional vector field, the modulus is calculated using the following formula. : In the formula Let be the component of the vector field in the 1 direction in the Cartesian coordinate system; Let be the two-direction components of the vector field in Cartesian coordinates; Let be the components of the vector field in the three directions in the Cartesian coordinate system.
4. The vector field visualization method according to claim 3, characterized in that... Step S3, which involves normalizing the target vector field data based on the modulus obtained in step S2, specifically includes the following steps: If the target vector field is a two-dimensional vector field, then the following formula is used for normalization: In the formula The component of the normalized vector field in the 1 direction in the Cartesian coordinate system; These are the components of the normalized vector field in the Cartesian coordinate system in two directions. If the target vector field is a three-dimensional vector field, then the following formula is used for normalization: In the formula The component of the normalized vector field in the 1 direction in the Cartesian coordinate system; These are the components of the normalized vector field in the Cartesian coordinate system in two directions. These are the components of the normalized vector field in the Cartesian coordinate system in three directions.
5. A system for implementing the vector field visualization method according to any one of claims 1 to 4, characterized in that... It includes a data acquisition module, a modulus calculation module, a normalization module, a vector field mapping module, a function mapping module, and a vector field visualization module; these modules are connected in series. The data acquisition module acquires the data information of the target vector field and uploads it to the modulus calculation module. The modulus calculation module calculates the modulus of the target vector field based on the received and acquired data information and uploads it to the normalization module. The normalization module is used to normalize the target vector field data based on the received data information and the obtained modulus, and then upload the data information to the vector field mapping module. The vector field mapping module is used to map the target vector field to the real number interval based on the direction of the vector and the coloring function, according to the received data information, and then upload the data information to the function mapping module. The function mapping module is used to map the coloring function to the RGB color space based on the received data information, and upload the data information to the vector field visualization module; The vector field visualization module is used to visualize the target vector field based on the received data.
6. A storage medium having a computer program stored thereon; said computer program, when executed by a processor, implements the vector field visualization method according to any one of claims 1 to 4.
7. A method for visualizing a ferroelectric polarization vector field, comprising the following steps: A. Obtain spatial distribution information of the polarization field of ferroelectric materials; B. Based on the data information obtained in step A, classify the spatial dimensions of the vector data; C. Based on the classification results obtained in step B, visualize the vector field using the vector field visualization method described in any one of claims 1 to 4.