CN116167221B - Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium - Google Patents

Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium Download PDF

Info

Publication number
CN116167221B
CN116167221B CN202310143145.6A CN202310143145A CN116167221B CN 116167221 B CN116167221 B CN 116167221B CN 202310143145 A CN202310143145 A CN 202310143145A CN 116167221 B CN116167221 B CN 116167221B
Authority
CN
China
Prior art keywords
information entropy
streamline
point
seed
adaptive
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310143145.6A
Other languages
Chinese (zh)
Other versions
CN116167221A (en
Inventor
李宝君
唐滨
***
王海峰
孙道博
马贵蛙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin Engineering University
Original Assignee
Harbin Engineering University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Harbin Engineering University filed Critical Harbin Engineering University
Priority to CN202310143145.6A priority Critical patent/CN116167221B/en
Publication of CN116167221A publication Critical patent/CN116167221A/en
Application granted granted Critical
Publication of CN116167221B publication Critical patent/CN116167221B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage media belong to the technical field of computer simulation and solve the problems of low precision and low efficiency of the existing streamline generating technology. The method of the application comprises the following steps: the integration method in the flow line generation process is self-adaptive, a four-order Dragon-Gray-Tower method with higher calculation precision is used for calculating a region with higher information entropy, and an Euler method with lower calculation precision but shorter calculation time is used for calculating a region with lower information entropy; the integration step length of the flow line generation algorithm is subjected to self-adaptive transformation, so that a shorter integration step length is used in a region with higher information entropy, and a longer integration step length is used in a region with lower information entropy; a parallel dividing method based on the number of seed points is provided for a flow line generating process, and a parallel dividing method based on data blocks is provided for calculating information entropy, reconstructing an intermediate vector field and calculating conditional entropy. The method is suitable for streamline generation in simulation technology.

Description

Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium
Technical Field
The application relates to the technical field of computer simulation, in particular to a simulation technology for streamline generation.
Background
With the continuous improvement of the hardware level of a computer and the continuous development of the simulation industry, the current streamline generation method cannot meet the calculation requirement. In order to more quickly and accurately show the motion trend and track of the streamline through simulation calculation, the feature extraction of the flow field needs to be considered, and a feature extraction technology based on information entropy is generated in the background, so that a related streamline generation algorithm becomes one of the most active research directions.
The streamline distribution method determines the expression effect of the velocity field, and is mainly divided into two types: a streamline distribution method based on uniform distribution and a streamline distribution method based on characteristics. The method is characterized in that seed points are directly arranged to generate streamline without pretreatment, when the number of generated streamline is small, important features in a speed field are easily lost, and when the number of generated streamline is large, chaotic shielding is easily generated; and the streamline distribution method based on the characteristics carries out pretreatment on the data of the flow field to extract the characteristics of the flow field, and the seed points are arranged in the characteristic areas in the flow field so as to facilitate the streamline to be distributed near the key areas of the vector field in a concentrated manner, thereby facilitating the analysis of the important characteristics of the vector field by scientific researchers.
The traditional streamline generation algorithm based on information entropy only considers the direction of the vector and does not consider the length of the vector, meanwhile, the traditional streamline generation algorithm is a fixed integral step length and does not consider the self-adaptive integral step length, meanwhile, the traditional method generally uses a fourth-order Dragon-lattice-tower method for integral calculation, the fourth-order Dragon-lattice-tower method has high calculation accuracy, but the calculation cost is high, and the fourth-order Dragon-lattice-tower method is redundant in a non-characteristic area.
In summary, the disadvantages of the prior art include: the streamline visualization is used as one of the flow field visualization methods, so that the flow condition of the current flow field can be depicted in an image, and compared with other methods (texture visualization and particle visualization), the flow field condition depicted by the streamline is more visual and reliable. The effect of streamline visualization mainly depends on the step length of selection and integration of seed points, the important features of a flow field are lost when the seed points are selected too little, too many seed points can cause the streamline to be too dense, and shielding and disorder situations occur; the size of the integration step is also an important factor for generating a flow field, and too short integration step can cause the problems of overlong integration time and too low efficiency, too long integration step can cause the problems of overlong streamline precision and inaccurate description, and the problems are more obvious in a three-dimensional flow field, so that a better streamline generating method needs to be researched.
Disclosure of Invention
The application aims to solve the problems of low precision and low efficiency of the existing streamline generation technology, and provides a self-adaptive step length streamline generation method, computer equipment and a storage medium based on complete information entropy.
The application is realized by the following technical scheme, and in one aspect, the application provides a self-adaptive step length streamline generating method based on complete information entropy, which comprises the following steps:
step 1, inputting flow field data to obtain a speed vector field;
step 2, calculating an information entropy value for each grid point in the grid of the streaming field;
step 3, obtaining a maximum information entropy value according to the information entropy value of each grid point, determining a local maximum information entropy value point, taking the local maximum information entropy value point as a characteristic point, and carrying out seed point arrangement on the characteristic point;
step 4, calculating an adaptive integral step length, and calculating the adaptive integral step length by using the following formula:
wherein, dt is the integral step length, st is the fixed integral step length input by a user, and t is the time; maximum information entropy value of maxEntropy whole vector field, minimum information entropy value of minEntropy whole vector field, information entropy value of currentEntropy current grid point;
step 5, generating a streamline in a region with the information entropy value being more than 0.7 times of the maximum value by using a fourth-order Dragon-grid tower method;
step 6, establishing a Dsep grid structure for judging the similarity between the streamlines in the streamline generating process, and terminating the streamline generation with the similarity greater than the preset similarity;
step 7, restoring an intermediate vector field by the generated streamline;
step 8, acquiring conditional entropy of the intermediate vector field and the original vector field, outputting a streamline set when the conditional entropy converges, and executing step 9 if not;
and 9, carrying out seed point arrangement by using importance sampling, calculating the self-adaptive integration step length by using the method of the step 4, integrating by using an Euler method, and returning to the step 6.
Further, step 2 specifically includes:
step 2.1, regarding any grid point i, regarding the grid point i and vectors in a neighborhood R thereof as a random system, solving intervals [ lenBin, dirBin ] of all vectors in the system through a grid point vector direction interval formula and a grid point vector magnitude interval formula, counting the number of vector points in each interval, and solving the probability p of the vectors appearing in each interval;
step 2.2, calculating the information entropy value of the grid point i according to an information entropy formula;
wherein, the grid point vector direction interval formula:
wherein u and v are velocity components in the x-axis direction and the y-axis direction of the current point respectively;
the grid point vector inter-cell formula:
where α is the vector magnitude inter-cell constant (input value), maxLength is the maximum value of the vector in the flow field, and floor is the downward rounding function.
Further, the information entropy formula specifically includes:
wherein X is the grid point position, X is all grid points, p i ∈[0.0,1.0],Σp i =1.0。
Further, in step 3, the step of arranging the seed points for the feature points specifically includes:
arranging seed points by using a template seed point mode, and placing a diamond template on each characteristic point for two-dimensional data, wherein 9 seed points are used for each characteristic point;
for three-dimensional data, a cube template is adopted, 1 seed point is arranged in the center of a cube, 1 seed point is arranged in the center of each cube surface, one seed point is arranged at each of 8 vertexes, and 27 seed points are arranged at the centers of 12 edges.
Further, step 7 specifically includes:
deriving a generated intermediate vector field through a current generated streamline by using an energy function, solving a vector field minimizing the energy function as an intermediate vector field through a flow field diffusion method, wherein the energy function is as follows:
wherein ,
wherein x represents the position of the object,values representing the original vector field X (X) in the upper part of the streamline, the remaining positions being 0; as long as x is not on the streamlines, for any Y (x) value,ε 1 this term is 0; empirically μ=0.1; y (x) represents an intermediate vector field; u (x), v (x), w (x) are velocity components in the x, y, z directions at position x, respectively.
Further, in step 3, the determining the local maximum information entropy value point specifically includes:
and setting a preset multiple, and determining grid points which are larger than the preset multiple of the maximum information entropy value as local maximum information entropy value points.
Further, before step 4 and step 9, the method further includes:
let the total number of threads of work be p t The total number of seed points is n, and the thread number p id ∈[0,p t -1]To equalize the task partitioning as much as possible, consider the following three cases:
if n<p t The number of seed points is smaller than the number of threads, and n seed points are divided into threads with ID of 0-n-1, and each thread is allocated with 1 seed point;
in the actual flow field, the total number n of seed points is far greater than the total number p of threads t The method comprises the steps of carrying out a first treatment on the surface of the If n can be p t Integer divisors, i.e. n% p t =0, each thread is assigned n/p t Seed points;
when n% p t If not equal to 0, redundant seed points exist, the number of the residual seed points is definitely smaller than the total number of threads, and the residual k seed points are uniformly distributed to the threads from 0 to k-1.
Further, before step 2, step 7 and step 8, the method further comprises:
the whole vector field is equally divided by the number of threads along the x-axis direction.
In a first aspect, the present application provides a computer device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, performs the steps of an adaptive step size streamline generating method based on full information entropy as described above.
In a second aspect, the present application provides a computer-readable storage medium having stored therein a plurality of computer instructions for causing a computer to perform an adaptive step size streamline generation method based on full information entropy as described above.
The application has the beneficial effects that:
the application relates to a method for generating parallel streamline based on vector complete information entropy.
1. The integration method in the flow line generation process adopts self-adaption, a four-order Dragon-Gray-Tower method with higher calculation precision is used for calculating a region with higher information entropy, and an Euler method with lower calculation precision but shorter calculation time is used for calculating a region with lower information entropy, so that the simulation precision can be ensured, and the calculation amount can be reduced.
2. The integration step length of the flow line generation algorithm is adaptively transformed, so that a shorter integration step length is used in a region with higher information entropy, and a longer integration step length is used in a region with lower information entropy.
3. A parallel dividing method based on the number of seed points is provided for the streamline generating process, and a parallel dividing method based on data blocks is provided for calculating information entropy, reconstructing an intermediate vector field and calculating conditional entropy so as to improve the streamline generating efficiency.
The method is suitable for streamline generation in simulation technology.
Drawings
In order to more clearly illustrate the technical solution of the present application, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow chart of the method of the present application;
FIG. 2 is a schematic diagram of information entropy calculation according to the present application ((a) an original vector field, (b) a probability of each direction interval of the vector field, (c) a probability of each size interval of the vector, and (d) a joint probability of each direction and size interval of the vector field);
FIG. 3 is a schematic diagram of the placement of seed points using a template seed point approach of the present application;
FIG. 4 is a schematic diagram of the present application equally divided by thread number along the x-axis.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended to illustrate the present application and should not be construed as limiting the application.
An embodiment is a method for generating an adaptive step length streamline based on complete information entropy, the method comprising:
step 1, inputting flow field data to obtain a speed vector field;
step 2, calculating an information entropy value for each grid point in the grid of the streaming field;
step 3, obtaining a maximum information entropy value according to the information entropy value of each grid point, determining a local maximum information entropy value point, taking the local maximum information entropy value point as a characteristic point, and carrying out seed point arrangement on the characteristic point;
step 4, calculating an adaptive integral step length, and calculating the adaptive integral step length by using the following formula:
wherein, dt is the integral step length, st is the fixed integral step length input by a user, and t is the time; maximum information entropy value of maxEntropy whole vector field, minimum information entropy value of minEntropy whole vector field, information entropy value of currentEntropy current grid point;
in order to avoid the problem that the currentEntropy is too small, which leads to too large dt, the present embodiment may limit the integration step to a maximum of 5 times st.
Step 5, generating a streamline in a region with the information entropy value being more than 0.7 times of the maximum value by using a fourth-order Dragon-grid tower method;
step 6, establishing a Dsep grid structure for judging the similarity between the streamlines in the streamline generating process, and terminating the streamline generation with the similarity greater than the preset similarity;
for example: each grid point of the Dsep grid stores a flag of whether it is available.
All parts of the initial state Dsep grids are available, the grids of the generated streamline are marked as unavailable in the streamline generating process, and the new streamline can only pass through the available grids when being generated.
Since the features of the region with higher information entropy are complex, it may not be possible to display all the details thereof by using only one point, so if the entropy value of a certain point is high, which means that it is within the feature region, the vicinity of the point allows to accommodate more streamlines to highlight the display of the features thereof.
Step 7, restoring an intermediate vector field by the generated streamline;
step 8, acquiring conditional entropy of the intermediate vector field and the original vector field, outputting a streamline set when the conditional entropy converges, and executing step 9 if not;
and 9, carrying out seed point arrangement by using importance sampling, calculating the self-adaptive integration step length by using the method of the step 4, integrating by using an Euler method, and returning to the step 6.
In this embodiment, the integration method in the flow line generation process is adaptive, and the four-order longgrid-base tower method with higher calculation accuracy is used for calculating the region with higher information entropy, and the euler method with lower calculation accuracy but shorter calculation time is used for calculating the region with lower information entropy, so that the simulation accuracy can be ensured, and the calculation amount can be reduced.
The integration step length of the flow line generation algorithm is adaptively transformed, so that a shorter integration step length is used in a region with higher information entropy, and a longer integration step length is used in a region with lower information entropy.
A parallel dividing method based on the number of seed points is provided for the streamline generating process, and a parallel dividing method based on data blocks is provided for calculating information entropy, reconstructing an intermediate vector field and calculating conditional entropy so as to improve the streamline generating efficiency.
In a second embodiment, the method for generating an adaptive step size streamline based on complete information entropy according to the first embodiment is further defined, and in this embodiment, the step 2 is further defined, and specifically includes:
step 2.1, regarding any grid point i, regarding the grid point i and vectors in a neighborhood R thereof as a random system, solving intervals [ lenBin, dirBin ] of all vectors in the system through a grid point vector direction interval formula and a grid point vector magnitude interval formula, counting the number of vector points in each interval, and solving the probability p of the vectors appearing in each interval;
step 2.2, calculating the information entropy value of the grid point i according to an information entropy formula;
wherein, the grid point vector direction interval formula:
wherein u and v are velocity components in the x-axis direction and the y-axis direction of the current point respectively;
the grid point vector inter-cell formula:
where α is the vector magnitude inter-cell constant (input value), maxLength is the maximum value of the vector in the flow field, and floor is the downward rounding function.
The method for solving the entropy value can achieve better extraction of the features with small speed and direction changes but large speed and size changes in the flow field, and further better reveal the features in the flow field and avoid loss of feature areas.
In a third embodiment, the present embodiment is further defined by the method for generating an adaptive step-size streamline based on complete information entropy according to the second embodiment, where the information entropy formula is further defined, and specifically includes:
the information entropy formula specifically comprises the following steps:
wherein X is the grid point position, X is all grid points, p i ∈[0.0,1.0],Σp i =1.0。
In a fourth embodiment, the method for generating an adaptive step-size streamline based on complete information entropy according to the first embodiment is further defined, and in the present embodiment, the step 3 further defines the step of arranging the seed points for the feature points, and specifically includes:
arranging seed points by using a template seed point mode, and placing a diamond template on each characteristic point for two-dimensional data, wherein 9 seed points are used for each characteristic point;
for three-dimensional data, a cube template is adopted, 1 seed point is arranged in the center of a cube, 1 seed point is arranged in the center of each cube surface, one seed point is arranged at each of 8 vertexes, and 27 seed points are arranged at the centers of 12 edges.
In the embodiment, the seed point setting is performed by using a template seed distribution method in the area with higher information entropy, so that the characteristic area in the flow field can be better captured, and further the characteristic in the flow field is prevented from being lost.
In a fifth embodiment, the present embodiment is further defined by the method for generating an adaptive step size streamline based on complete information entropy according to the first embodiment, where step 7 is further defined and specifically includes:
deriving a generated intermediate vector field through a current generated streamline by using an energy function, solving a vector field minimizing the energy function as an intermediate vector field through a flow field diffusion method, wherein the energy function is as follows:
wherein ,
wherein x represents the position of the object,values representing the original vector field X (X) in the upper part of the streamline, the remaining positions being 0; thus, regardless of the value of Y (x), ε, as long as x is not on the streamline 1 This term is 0; empirically μ=0.1; y (x) represents an intermediate vector field; u (x), v (x), w (x) are velocity components in the x, y, z directions at position x, respectively.
In the embodiment, the method for restoring the intermediate vector field can ensure that a large-area undisclosed blank area does not appear in the flow field, thereby ensuring that all the characteristics of the flow field are revealed and the problems of shielding disorder and the like do not appear.
In a sixth embodiment, the method for generating an adaptive step-size streamline based on complete information entropy according to the first embodiment is further defined, and in the embodiment, the determining a local maximum information entropy value point in step 3 is further defined, and specifically includes:
and setting a preset multiple, and determining grid points which are larger than the preset multiple of the maximum information entropy value as local maximum information entropy value points.
In this embodiment, extreme points, that is, local maximum information entropy points, may be found, and these points may be used as feature points to fully extract the feature region of the flow field, so that more seed points may be arranged for the feature points, and more streamline reveal feature regions may be generated.
In a seventh embodiment, the method for generating an adaptive step size streamline based on complete information entropy according to the first embodiment is further defined, where the steps 4 and 9 are further defined, and specifically includes:
before step 4 and step 9, the method further comprises:
let the total number of threads of work be p t The total number of seed points is n, and the thread number p id ∈[0,p t -1]To equalize the task partitioning as much as possible, consider the following three cases:
if n<p t The number of seed points is smaller than the number of threads, and n seed points are divided into threads with ID of 0-n-1, and each thread is allocated with 1 seed point;
in the actual flow field, the total number n of seed points is far greater than the total number p of threads t The method comprises the steps of carrying out a first treatment on the surface of the If n can be p t Integer divisors, i.e. n% p t =0, each thread is assigned n/p t Seed points;
when n% p t If not equal to 0, redundant seed points exist, the number of the residual seed points is definitely smaller than the total number of threads, and the residual k seed points are uniformly distributed to the threads from 0 to k-1.
In this embodiment, the seed point parallel processing is performed for the steps 4, 5, and 10, so as to improve the working efficiency.
Before generating the streamline, the positions of the seed points are required to be selected first, calculation of streamline integration can be started once the seed points are determined, and the seed points are independent of each other, so that parallelization of the seed points can be divided according to the number of the seed points, and each thread processes the seed points with the same number. Each thread calculates the integral independently as the streamlines are generated.
In an eighth embodiment, the method for generating an adaptive step size streamline based on complete information entropy according to the first embodiment is further defined, where the steps 2, 7 and 8 are preceded by the following steps:
before step 2, step 7 and step 8, the method further comprises:
the whole vector field is equally divided by the number of threads along the x-axis direction.
In this embodiment, when dividing tasks, different tasks need to be allocated to different non-processors according to the number of processors and the processing capacity. In a multi-core computer system, the processing capacities of the processors are the same, so that the loads of the nodes can be relatively balanced by dividing tasks as equally as possible. Therefore, the whole vector field is equally divided according to the number of threads along the x-axis direction, so that the streamline generation efficiency is improved.
A ninth embodiment, this embodiment is a specific example of a method for generating an adaptive step size streamline based on complete information entropy, which specifically includes:
the main flow of the method is as shown in figure 1:
1. the preprocessing is performed on the original data, the original data usually comes from numerical simulation of scientific calculation, and a large amount of information including scalar, vector, tensor and the like is contained in the original data, and only speed information is needed for calculating the streamline, so that the original data needs to be preprocessed to remove redundant information, and only a speed vector field needed for solving the streamline is reserved.
2. Finding out a region with larger entropy value, firstly calculating the entropy value of each grid vertex in the flow field grid, namely calculating an entropy field.
For any grid point i, the information entropy calculation method at that point is as follows: regarding the grid point i and vectors in the neighborhood R thereof as a random system, solving the intervals [ lenBin, dirBin ] of all vectors in the system through a grid point vector direction interval formula and a grid point vector magnitude interval formula, counting the number of vector points in each interval, and solving the probability p of the vectors appearing in each interval; and finally, solving the information entropy value of the grid point i according to an information entropy formula.
A statistical grid point vector direction interval formula:
where u and v are the velocity components in the x-axis and y-axis directions, respectively, of the current point.
The statistical grid point vector inter-cell formula:
where α is the vector magnitude inter-cell constant (input value), maxLength is the maximum value of the vector in the flow field, and floor is the downward rounding function.
As shown in fig. 2, in the graph, (a) is an original vector field, (b) is the inter-direction probability of the vector field, (c) is the inter-cell probability of the vector field, and (d) is the joint probability of the vector field in each direction and between the cells; wherein Direction is Direction, magnitode is size, and Combined is joint.
Information entropy calculation formula:
wherein X is the grid point position, X is all grid points, p i ∈[0.0,1.0],Σp i =1.0。
3. After solving the information entropy of each grid point according to the method of the previous section, using the local maximum entropy value point (which is larger than 0.7 times of the maximum entropy value) as a characteristic point, and carrying out seed point arrangement. For three-dimensional data, a cube template is adopted, 1 seed point is arranged in the center of a cube, 1 seed point is arranged in the center of each cube face, one seed point is arranged at each of 8 vertexes, and 27 seed points are arranged at the centers of 12 edges, as shown in fig. 3.
4. The adaptive integration step size is calculated using the following formula:
in the formula, the parameter dt is an integral step length, st is a fixed integral step length input by a user, and t is time. maximum information entropy value of maxEntropy whole vector field, minimum information entropy value of minenttropy whole vector field, information entropy value of currentEntropy current grid point. To avoid the problem of too small currentEntropy, resulting in too large dt, the integration step size is limited to a maximum of 5 times st.
5. And generating a streamline, namely generating the streamline in a region with the information entropy value being more than 0.7 times of the maximum value by using a fourth-order Dragon-grid tower method.
The calculation formula of the fourth-order Dragon-Gregorian integration method is as follows:
k 1 =dt×v(x n )
k 4 =dt×v(x n +k 3 )
in the formula, the parameter x n For the current position, the parameter v (x n ) For the current point x n Velocity vector, parameter x n+1 For the position of the next point, the parameter dt is the integration step, t is the time, the parameter O (dt 5 ) Is the error generated during integration.
6. A Dsep grid structure is established based on Euclidean distance algorithm, so that the similarity between the streamlines can be judged in the generation process of the streamlines, and the streamlines with too high similarity are terminated in advance to continue to be generated.
Each grid point of the Dsep grid stores a flag of whether it is available.
All parts of the initial state Dsep grids are available, the grids of the generated streamline are marked as unavailable in the streamline generating process, and the new streamline can only pass through the available grids when being generated.
Since the features of the region with higher information entropy are complex, it may not be possible to display all the details thereof by using only one point, so if the entropy value of a certain point is high, which means that it is within the feature region, the vicinity of the point allows to accommodate more streamlines to highlight the display of the features thereof.
7. Ensuring the accuracy and effectiveness of the visualization effect is critical to flow field visualization. In the flow field visualization process, two important steps are required for judging the accuracy and the effectiveness of the flow field.
Firstly, restoring an intermediate vector field from the generated streamline, which specifically comprises the following steps:
deriving a generated intermediate vector field through a current generated streamline by using an energy function, solving a vector field minimizing the energy function as an intermediate vector field through a flow field diffusion method, wherein the energy function is as follows:
wherein ,
wherein x represents the position of the object,representing the values of the original vector field X (X) in the upper part of the streamline, the remaining positions being 0. Thus, regardless of the value of Y (x), ε, as long as x is not on the streamline 1 This term is 0. Empirically μ=0.1. Y (x) represents the intermediate vector field. u (x), v (x), w (x) are velocity components in the x, y, z directions at position x, respectively.
8. The information difference of the original vector field and the intermediate vector field is then calculated.
The shannon conditional entropy, which indicates how much information remains in the intermediate vector field reconstructed from the known streamlines compared to the original vector field, can be used to take into account the distribution of the intermediate vector field and the original vector field.
If enough streamlines are placed, the conditional entropy will converge to a minimum, and the iterative output of the streamline set is stopped. This attribute can be used to avoid unnecessary streamlines to be placed, thereby reducing visual clutter.
Assuming that the original vector field is denoted as random variable X, the intermediate vector field is denoted as random variable Y, and the conditional entropy of X given Y is defined as:
wherein ,
9. if the conditional entropy of the two vector fields is found to be not converged after the conditional entropy is calculated, the characteristic that the original vector field cannot be fully restored by the current streamline is indicated, step 10 is carried out, and seed points are continuously added into the current flow field to generate the streamline until the conditional entropy is converged; otherwise, ending the algorithm.
10. By importance sampling, new seed points are acquired, and the number of the new seed points is one power of half of the grid length-width product. For the seed points sampled by importance, the integration step length is calculated by using the step 4, integration is performed by using the Euler method, similarity judgment is still performed by using the Dsep grid mentioned in the step 6 in the integration process, and the step 7 is returned after the integration calculation of all the seed points is completed.
The calculation formula of the Euler method is as follows:
x n+1 =x n +dt×v(x n )
in the formula, the parameter x n For the current position, the parameter v (x n ) Is at presentPoint x n Velocity vector, parameter x n+1 For the position of the next point, the parameter dt is the integration step size and t is the time.
Parallelization may also be performed for the method in the above embodiment:
1) Seed point parallelism (for steps 4, 5, 10 above)
Before generating the streamline, the positions of the seed points are required to be selected first, calculation of streamline integration can be started once the seed points are determined, and the seed points are independent of each other, so that parallelization of the seed points can be divided according to the number of the seed points, and each thread processes the seed points with the same number. Each thread calculates the integral independently as the streamlines are generated. The specific dividing method is as follows:
let the total number of threads of work be p t The total number of seed points is n, and the thread number p id ∈[0,p t -1]. To equalize the task partitioning as much as possible, consider the following three cases:
if n<p t The number of seed points is smaller than the number of threads, and at the moment, n seed points are only needed to be divided into threads with ID of 0-n-1, and each thread is allocated with 1 seed point. This task allocation is the simplest one, and is only applicable to very small or regular grids, with a low probability of occurrence, and therefore will not be described in detail.
In the actual flow field, the total number n of seed points is far greater than the total number p of threads t . If n can be p t Integer divisors, i.e. n% p t The division method is relatively simple and no division imbalance occurs, if 0. I.e. each thread is assigned n/p t And (5) seed points are needed.
When n% p t If not equal to 0, it is proved that there are redundant seed points, and the number of the remaining seed points is smaller than the total number of threads, if the seed points are still divided in the above manner, the seed points with uneven division will appear. The remaining k seed points need to be evenly allocated to threads 0 through k-1.
2) Data block parallelism (for steps 2, 7, 8 above)
In task partitioning, different tasks need to be allocated to different non-processors according to the number of processors and processing power. In a multi-core computer system, the processing capacities of the processors are the same, so that the loads of the nodes can be relatively balanced by dividing tasks as equally as possible. The whole vector field is thus equally divided by the number of threads in the x-axis direction, as shown in fig. 4.
The application realizes a streamline generating algorithm for extracting the characteristics based on the information entropy, and mainly comprises the processes of data preprocessing, characteristic extraction, speed vector interpolation, self-adaptive step integration and the like; after solving the information entropy, generating seed points and setting integral step sizes for the areas according to the size of the area information entropy, setting the seed points and setting shorter time step sizes for the areas with higher information entropy by using a template seed distribution method, and distributing seeds and setting shorter time step sizes for the areas with lower information entropy by using an importance seed distribution method.
Aiming at the problems of low execution efficiency of a streamline generation algorithm based on feature extraction and overlong calculation condition entropy time of reconstruction of an intermediate vector field, the application utilizes parallel calculation to improve the calculation efficiency. The calculation of streamline generation is mainly focused on streamline integration, so the number of seed points and the step size directly determine the calculated amount of one node. Meanwhile, the application accelerates the reconstruction of the intermediate vector field and the calculation of conditional entropy by using a parallel calculation technology.
Because the traditional streamline generating algorithm based on information entropy only considers the direction information of the vector and does not consider the length information of the vector, the position with small vector direction change but severe size change in the flow field can be ignored.
Meanwhile, the traditional algorithm generally uses a four-order Dragon-Gregory tower method plus a fixed integral step length to perform streamline calculation, but in a non-characteristic area with low information entropy, a method with a smaller integral step length and a four-order Dragon-Gregory tower method and larger calculation amount is not needed.
Therefore, the application improves the defect of the traditional method that the information entropy is calculated by using vector complete information, not only considers the direction information of the vector, but also considers the size information of the vector, and the application uses the Euler method and the four-order Dragon-Gregory tower method to generate the streamline in a self-adaptive integral step length mode.
For the problems of overlong calculation time of a streamline generating process, a reconstructed vector field and conditional entropy, the application provides a method for parallel processing of the whole algorithm by using a dividing mode based on data blocks and seed point number, and improves streamline generating efficiency.
Table 1, experimental data
Experimental data Data size Data format Data type
Data 1 12*10 ASCII *.txt
Data 2 300*300 ASCII *.txt
Data 3 300*200*100 ASCII *.txt
TABLE 2 execution time of serial and parallel algorithms (in seconds (s))
Experimental data 1 thread 2 threads 3 threads 4-threading
Data 1 0.092 0.074 0.055 0.045
Data 2 19.535 15.296 11.082 8.494
Data 3 403.711 250.443 198.026 170.458
Comparison analysis by the above data readily reveals:
in a parallel environment, the visualized computation time increases with the increase of the data size under the condition that the thread size is unchanged.
Under the parallel environment, on the premise of unchanged data scale, the visualized calculation time is reduced along with the increase of the number of threads; and the more significant the effect as the number of threads increases.
TABLE 3 parallel acceleration results (in seconds (s)) for each process of the parallel algorithm
As can be seen from the table 3, the acceleration effects on the three steps of calculating the information entropy, reconstructing the vector field and calculating the conditional entropy are obvious, and the parallel acceleration ratio can reach more than 2; the acceleration effect on the generated streamline is not obvious, but the speed is still improved.

Claims (9)

1. An adaptive step length streamline generation method based on complete information entropy is characterized by comprising the following steps:
step 1, inputting flow field data to obtain a speed vector field;
step 2, calculating an information entropy value for each grid point in the grid of the streaming field;
step 3, obtaining a maximum information entropy value according to the information entropy value of each grid point, determining a local maximum information entropy value point, taking the local maximum information entropy value point as a characteristic point, and carrying out seed point arrangement on the characteristic point;
step 4, calculating an adaptive integral step length, and calculating the adaptive integral step length by using the following formula:
wherein, dt is the integral step length, st is the fixed integral step length input by a user, and t is the time; maximum information entropy value of maxEntropy whole vector field, minimum information entropy value of minEntropy whole vector field, information entropy value of currentEntropy current grid point;
step 5, generating a streamline at a grid point of a zone with the information entropy value being more than 0.7 times of the maximum value by using a fourth-order Dragon-Gregory tower method;
step 6, establishing D sep The grid structure is used for judging the similarity between the streamlines in the streamline generating process and terminating the streamline generation with the similarity larger than the preset similarity;
step 7, restoring an intermediate vector field by the generated streamline;
step 8, acquiring conditional entropy of the intermediate vector field and the original vector field, outputting a streamline set when the conditional entropy converges, and executing step 9 if not;
step 9, seed point arrangement is carried out by using importance sampling, the self-adaptive integral step length is calculated by using the method of step 4, the integral line is generated by using the Euler method, and the step 6 is returned;
step 2, specifically comprising:
step 2.1, regarding any grid point i, regarding the grid point i and vectors in a neighborhood R thereof as a random system, solving intervals [ lenBin, dirBin ] of all vectors in the system through a grid point vector direction interval formula and a grid point vector magnitude interval formula, counting the number of vector points in each interval, and solving the probability p of the vectors appearing in each interval;
step 2.2, calculating the information entropy value of the grid point i according to an information entropy formula;
wherein, the grid point vector direction interval formula:
wherein u and v are velocity components in the x-axis direction and the y-axis direction of the current point respectively;
the grid point vector inter-cell formula:
where α is the vector magnitude constant, maxLength is the maximum value of the vector in the flow field, and floor is the downward rounding function.
2. The method for generating a self-adaptive step length streamline based on complete information entropy according to claim 1, wherein the information entropy formula specifically comprises:
wherein X is the grid point position, X is all grid points, p i ∈[0.0,1.0],∑p i =1.0。
3. The method for generating an adaptive step size streamline based on complete information entropy according to claim 1, wherein in step 3, the seed point arrangement is performed on the feature points, and specifically includes:
arranging seed points by using a template seed point mode, and placing a diamond template on each characteristic point for two-dimensional data, wherein 9 seed points are used for each characteristic point;
for three-dimensional data, a cube template is adopted, 1 seed point is arranged in the center of a cube, 1 seed point is arranged in the center of each cube surface, one seed point is arranged at each of 8 vertexes, and 27 seed points are arranged at the centers of 12 edges.
4. The method for generating an adaptive step size streamline based on complete information entropy according to claim 1, wherein step 7 specifically comprises:
deriving a generated intermediate vector field through a current generated streamline by using an energy function, solving a vector field minimizing the energy function as an intermediate vector field through a flow field diffusion method, wherein the energy function is as follows:
wherein ,
wherein x represents the position of the object,values representing the original vector field X () in the upper part of the stream line, the remaining positions being 0; epsilon for any Y (x) value as long as x is not on the streamline 1 This term is 0; empirically μ=0.1; y (x) represents an intermediate vector field; u (x), v (x), w (x) are velocity components in the x, y, z directions at position x, respectively.
5. The method for generating an adaptive step size streamline based on complete information entropy according to claim 1, wherein in step 3, the determining a local maximum information entropy value point specifically includes:
and setting a preset multiple, and determining grid points which are larger than the preset multiple of the maximum information entropy value as local maximum information entropy value points.
6. The method for generating an adaptive step size streamline based on complete information entropy as claimed in claim 1, further comprising, before step 4 and step 9:
let the total number of threads of work be p t The total number of seed points is n, and the thread number p id ∈[0,p t -1]To equalize the task partitioning as much as possible, consider the following three cases:
if n<P t The number of seed points is smaller than the number of threads, and n seed points are divided into threads with ID of 0-n-1, and each thread is allocated with 1 seed point;
in the actual flow field, the total number n of seed points is far greater than the total number p of threads t The method comprises the steps of carrying out a first treatment on the surface of the If n can be p t Integer divisors, i.e. n% P t =0, each thread is assigned n/P t Seed points;
when n% P t If not equal to 0, redundant seed points exist, the number of the residual seed points is definitely smaller than the total number of threads, and the residual k seed points are uniformly distributed to the threads from 0 to k-1.
7. The method for generating an adaptive step size streamline based on complete information entropy according to claim 1, wherein before step 2, step 7 and step 8, further comprising:
the whole vector field is equally divided by the number of threads along the x-axis direction.
8. A computer device comprising a memory and a processor, the memory having stored therein a computer program, characterized in that the processor, when running the computer program stored in the memory, performs the steps of the method of any one of claims 1 to 7.
9. A computer-readable storage medium having stored therein a plurality of computer instructions for causing a computer to perform the method of any one of claims 1 to 7.
CN202310143145.6A 2023-02-21 2023-02-21 Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium Active CN116167221B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310143145.6A CN116167221B (en) 2023-02-21 2023-02-21 Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310143145.6A CN116167221B (en) 2023-02-21 2023-02-21 Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116167221A CN116167221A (en) 2023-05-26
CN116167221B true CN116167221B (en) 2023-09-01

Family

ID=86416014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310143145.6A Active CN116167221B (en) 2023-02-21 2023-02-21 Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116167221B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831644A (en) * 2012-07-09 2012-12-19 哈尔滨工程大学 Marine environment information three-dimensional visualization method
CN104658027A (en) * 2015-02-11 2015-05-27 中国海洋大学 Three-dimensional streamline dynamic visualization algorithm facing irregular ocean flow field data
JP2018180707A (en) * 2017-04-06 2018-11-15 富士通株式会社 Streamline visualization apparatus, streamline visualization method, and streamline visualization program
CN110807293A (en) * 2019-10-10 2020-02-18 哈尔滨工程大学 Ocean current field geometric visualization method based on measurement standard
CN112578020A (en) * 2020-12-07 2021-03-30 兰州理工大学 Quantitative detection method and device based on information entropy time-space domain vortex distribution
KR20220150575A (en) * 2021-05-04 2022-11-11 한국과학기술정보연구원 Flow analysis data processing device and computer trogram that performs each step of the device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831644A (en) * 2012-07-09 2012-12-19 哈尔滨工程大学 Marine environment information three-dimensional visualization method
CN104658027A (en) * 2015-02-11 2015-05-27 中国海洋大学 Three-dimensional streamline dynamic visualization algorithm facing irregular ocean flow field data
JP2018180707A (en) * 2017-04-06 2018-11-15 富士通株式会社 Streamline visualization apparatus, streamline visualization method, and streamline visualization program
CN110807293A (en) * 2019-10-10 2020-02-18 哈尔滨工程大学 Ocean current field geometric visualization method based on measurement standard
CN112578020A (en) * 2020-12-07 2021-03-30 兰州理工大学 Quantitative detection method and device based on information entropy time-space domain vortex distribution
KR20220150575A (en) * 2021-05-04 2022-11-11 한국과학기술정보연구원 Flow analysis data processing device and computer trogram that performs each step of the device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
海洋流场数据的可视化技术研究;左少华;《中国硕士学位论文电子期刊》(第2期);第36-50页 *

Also Published As

Publication number Publication date
CN116167221A (en) 2023-05-26

Similar Documents

Publication Publication Date Title
CN108810140B (en) High-performance hierarchical storage optimization method based on dynamic threshold adjustment in cloud storage system
CN110659278A (en) Graph data distributed processing system based on CPU-GPU heterogeneous architecture
Sun et al. Optimizing SpMV for diagonal sparse matrices on GPU
CN115412102B (en) Sparse signal recovery method, system, device and medium based on sparse random Kaczmarz algorithm
Kijsipongse et al. Dynamic load balancing on GPU clusters for large-scale K-Means clustering
CN105229608A (en) Based on the database processing towards array of coprocessor
WO2021088099A1 (en) Total matrix computation-based discrete element neighbor search and solution finding method and system
CN116167221B (en) Self-adaptive step length streamline generating method based on complete information entropy, computer equipment and storage medium
CN108334532B (en) Spark-based Eclat parallelization method, system and device
CN112925627B (en) Graph sampling and random walk accelerating method and system based on graph processor
He et al. Parallel feature selection using positive approximation based on mapreduce
Li et al. An adaptive multiobjective evolutionary algorithm based on grid subspaces
CN107122231A (en) A kind of data stream scheduling optimization method based on Monte-Carlo simulation method
Daoudi et al. A Comparative study of parallel CPU/GPU implementations of the K-Means Algorithm
Subhash et al. A GPU parallel algorithm for computing Morse-Smale complexes
US11934459B2 (en) Ripple push method for graph cut
Lassila et al. Nearly optimal importance sampling for Monte Carlo simulation of loss systems
Zhang et al. Dynamic data repartitioning for load-balanced parallel particle tracing
CN112948643B (en) Structured grid streamline integration method based on thread parallelism
Ismaeel et al. A systematic cloud workload clustering technique in large scale data centers
CN108717444A (en) A kind of big data clustering method and device based on distributed frame
CN107807952B (en) Spark-based Apriori parallelization method, system and device
Hou et al. An adaptive neighborhood taboo search on GPU for hardware/software co-design
CN107424154B (en) Watershed image segmentation parallel method based on dynamic distribution
Binyahib Scientific visualization on supercomputers: A survey

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant