SPH data lightweight processing method for explosive shock wave simulation

By constructing the feature distance matrix and combining parallel calculations with K nearest neighbor algorithm and spectral clustering algorithm, and dynamically adjusting the weight parameters, the problem of low particle accuracy in SPH data processing is solved, efficient dimensionality reduction and multi-scale feature extraction are achieved, and the accuracy and visualization effect of explosion analysis are improved.

CN120372331APending Publication Date: 2025-07-25CHINA SHIP SCIENTIFIC RESEARCH CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510463099.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

When processing SPH data, traditional equal interval interpolation sampling method is difficult to accurately reflect the actual situation of the explosion shock wave, resulting in low particle accuracy, affecting the accuracy and visualization of explosion analysis.

Method used

By constructing the feature distance matrix, combining K nearest neighbor algorithm and spectral clustering algorithm, using parallel computer system, dynamically adjusting the weight parameters and nonlinear index, building the adjacency matrix and performing dimensionality reduction processing, extracting the key features of the explosion shock wave.

Benefits of technology

It realizes that while reducing the amount and complexity of data calculations, maintaining high accuracy and reliability, and accurately extracting multi-scale features of explosion shock waves, improving computing efficiency and visualization effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372331A_ABST
    Figure CN120372331A_ABST
Patent Text Reader

Abstract

The invention discloses an SPH data lightweight processing method for explosion shock wave simulation, and relates to the technical field of explosion analysis, and the method comprises the steps: obtaining original particle cloud data, and constructing a feature distance matrix; in the current iteration process, a plurality of parallel threads are started, and the nearest neighbor K value corresponding to each parallel thread is determined; for any parallel thread, constructing an adjacent matrix based on a K-nearest neighbor algorithm; performing dimension reduction processing on the adjacent matrix by using a spectral clustering algorithm, and performing conversion to obtain a lightweight particle cloud; and evaluating the comprehensive error of the lightweight particle cloud and the original particle cloud, and entering the next iteration until the comprehensive error is smaller than an error threshold value or the optimal particle cloud is obtained when the maximum number of iterations is reached. The K-nearest neighbor algorithm and the spectral clustering algorithm are organically combined by using a parallel computing mechanism, dimensionality reduction and multi-scale feature extraction of particle cloud data are realized, the accuracy of an explosion analysis result is enhanced, and the computing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of explosion analysis, and in particular to a method for lightweight processing of SPH data for explosion shock wave simulation. Background Art

[0002] In the fields of engineering and physics, explosion analysis is an extremely challenging and important research direction. The difficulties lie in the high energy release, non-linear wave propagation, and complex transient response of materials caused by explosions. The explosion shock wave is the main manifestation of the explosion effect. Accurately simulating the explosion shock wave is of great significance for explosion protection design and evaluation.

[0003] The SPH (Smoothed Particle Hydrodynamics) method discretizes the continuous medium into a particle system of interacting particles, which has unique particle discretization characteristics and excellent free surface capture capabilities. This method can effectively handle large deformations, material fractures, and fluid-structure coupling effects caused by explosions, and has been widely used in fluid mechanics, gas dynamics, and other related fields, and has become a key technical means for explosion shock wave simulation. However, the tens of millions of particle data generated by the SPH method pose many challenges to subsequent data processing and visualization.

[0004] Traditional methods reduce the number of particles by equally spaced interpolation sampling of SPH data to improve the calculation efficiency and meet the real-time requirements of visualization. However, due to the highly non-uniform distribution of particles in the explosion shock wave, the particle accuracy obtained by the traditional equally spaced interpolation sampling method is low, and it is difficult to accurately reflect the actual situation of the explosion effect. Summary of the Invention

[0005] In view of the above problems and technical requirements, the present application proposes a method for lightweight processing of SPH data for explosion shock wave simulation. The technical solution of the present application is as follows:

[0006] A method for lightweight processing of SPH data for explosion shock wave simulation includes the following steps:

[0007] Obtain the original particle cloud data and construct a characteristic distance matrix, where the characteristic distance matrix indicates the spatial relationship between particles;

[0008] Initialize the integer parameter Bc = 0, start multiple parallel threads and determine the corresponding nearest neighbor K value for each parallel thread, where the integer parameter Bc ≥ 0;

[0009] In the Bc-th iteration, for any parallel thread b, based on the characteristic distance matrix and the nearest neighbor K value K corresponding to the parallel thread b b , construct an adjacency matrix A based on the K-nearest neighbor algorithm b; The adjacency matrix represents the connection relationship between particles;

[0010] Using the spectral clustering algorithm for the adjacency matrix A b to perform dimensionality reduction processing and transform to obtain the lightweight particle cloud S b ;

[0011] Evaluating the comprehensive error between the lightweight particle cloud S b and the original particle cloud and updating the K value K of the nearest neighbor K corresponding to the parallel thread b b , and entering the (Bc + 1)-th iteration until the comprehensive error is less than the error threshold or the optimal particle cloud is obtained when the maximum number of iterations is reached.

[0012] Its further technical solution is that the adjacency matrix A is constructed based on the K-nearest neighbor algorithm b including:

[0013] Dividing the matrix elements of the feature distance matrix into multiple data groups, and allocating the data of each data group to a parallel thread;

[0014] Parallel computing of the first K b matrix elements with the smallest values in each data group of the feature distance matrix, and setting the values of the first K b matrix elements with the smallest values to 1 and setting the values of the remaining matrix elements to 0;

[0015] Combining the data groups after updating the values of the matrix elements to obtain the adjacency matrix A b , where a matrix element value of 1 indicates a connection relationship between particles, and a matrix element value of 0 indicates no connection relationship between particles.

[0016] Its further technical solution is that the original particle cloud data includes the position information and pressure information of each particle, and constructing the feature distance matrix includes:

[0017] Parallel computing of the feature distance between any two particles according to the position information and pressure information of the particles. The feature distance is related to the position distance and pressure change gradient between particles. The closer the position distance between particles, the greater the pressure change gradient, and the greater the feature distance;

[0018] Taking the feature distance between each particle and all the other particles as a row to construct the feature distance matrix.

[0019] Its further technical solution is that parallel computing of the feature distance between any two particles according to the position information and pressure information of the particles includes:

[0020] According to the position information of particle i and particle j, using the propagation direction perception function g(i, j) introducing a weight parameter to calculate the position distance D between particle i and particle j ij= g(i, j); The weight parameter is related to the propagation direction of the blast shock wave. The farther the propagation direction of the blast shock wave, the smaller the weight parameter;

[0021] According to the pressure information of particle i and particle j, use the pressure change perception function f(i, j) to calculate the pressure change gradient P of particle i and particle j ij = f(i, j);

[0022] The position distance D between particle i and particle j ij and the pressure change gradient P ij are summed to obtain the characteristic distance between particle i and particle j

[0023] Its further technical solution is that the propagation direction perception function g(i, j) = wx(x i - x j ) 2 + wy(y i - y j ) 2 + wz(z i - z j ) 2 ;

[0024] Among them, (x i , y i , z i ) is the position of particle i, (x j , y j , z j ) is the position of particle j, and wx, wy, wz are weight parameters.

[0025] Its further technical solution is that the pressure change perception function

[0026] Among them, p i is the pressure of particle i, p j is the pressure of particle j, σ is the non - linear exponent, and the greater the pressure difference between particle i and particle j, the greater the non - linear exponent σ.

[0027] Its further technical solution is to use the spectral clustering algorithm to perform dimensionality reduction processing on the adjacency matrix A b and convert it to obtain the lightweight particle cloud S b including:

[0028] Divide the adjacency matrix A b uniformly into multiple sub - matrices, and calculate the Laplacian sub - matrices corresponding to each sub - matrix in parallel;

[0029] Combine the Laplacian sub - matrices to obtain the global Laplacian matrix L b and perform eigenvalue decomposition to calculate the first Kb The eigenvector corresponding to the smallest eigenvalue; combine the eigenvectors corresponding to the first K b smallest eigenvalues and perform normalization to obtain the eigenmatrix U b ;

[0030] Use the clustering analysis method to cluster the eigenmatrix U b and iteratively update the cluster centers until the distance between the cluster centers of two adjacent iterations is less than a predetermined threshold, or when the number of iterative updates reaches a predetermined number, obtain the lightweight particle cloud S b .

[0031] A further technical solution thereof is to determine the nearest neighbor K value K corresponding to the parallel thread b b including:

[0032] Determine the nearest neighbor K value K corresponding to the parallel thread b according to the thread number ID and the iteration count Bc of the parallel thread b b = 2*(Bc + ID)+3.

[0033] A further technical solution thereof is to evaluate the comprehensive error between the lightweight particle cloud S b and the original particle cloud, including:

[0034] Calculate the mean, variance, and entropy of the lightweight particle cloud S b and the original particle cloud respectively, and perform weighted fusion on the mean error, variance error, and entropy error between the lightweight particle cloud S b and the original particle cloud to obtain the comprehensive error.

[0035] A further technical solution thereof is to determine the optimal particle cloud, including:

[0036] When there is a comprehensive error less than the error threshold among the comprehensive errors calculated by all parallel threads, determine that the lightweight particle cloud calculated by the parallel thread with the smallest comprehensive error among the comprehensive errors calculated by all parallel threads is the optimal particle cloud;

[0037] When there is no comprehensive error less than the error threshold among the comprehensive errors calculated by all parallel threads and the maximum number of iterations is reached, determine that the lightweight particle cloud calculated by the parallel thread with the smallest comprehensive error among the comprehensive errors calculated by all parallel threads during all iterative processes is the optimal particle cloud.

[0038] The beneficial technical effects of this application are:

[0039] A SPH data lightweight processing method for simulating explosion shock waves proposed in this application can perceive the distribution characteristics of shock waves generated during the explosion process by constructing a characteristic distance matrix representing the spatial distribution of particles. By organically combining the K-nearest neighbor algorithm and the spectral clustering algorithm, it realizes the transformation of high-dimensional data in the characteristic distance matrix into a low-dimensional feature space, can effectively extract the key features affecting explosion dynamics while significantly reducing the data calculation amount and lowering the complexity of data processing. At the same time, using the parallel computing mechanism, multiple threads are used to perform data dimensionality reduction processing simultaneously to extract key features at different scales, realizing the adaptive capture of multi-scale features of the explosion field and ensuring that key features can be accurately extracted. Data dimensionality reduction is achieved while maintaining the main features, removing unnecessary redundant features. This selective processing method can focus on the crucial features during the explosion process and ignore the parts with less impact on the results, enabling high accuracy and reliability to be maintained during large-scale explosion shock wave simulations.

[0040] Calculate the position distance between particles using a propagation direction perception function introducing weight parameters, and dynamically adjust the weight parameters according to the propagation direction of the explosion shock wave to perceive the propagation characteristics of the shock wave and highlight the shock wave front. Calculate the pressure change gradient between particles using a pressure change perception function, and adjust the non-linear exponent according to the pressure difference to amplify the sensitivity of the high-pressure difference area, facilitating the intuitive perception of the pressure change of the explosion shock wave in subsequent visualization. Brief Description of the Drawings

[0041] Figure 1 It is a flowchart of the SPH data lightweight processing method.

[0042] Figure 2 It is a schematic diagram of the comprehensive error calculated at different iteration times.

[0043] Figure 3 It is the visualization effect diagram of the optimal particle cloud. Detailed Embodiments

[0044] The following further describes the detailed embodiments of this application with reference to the drawings.

[0045] A SPH data lightweight processing method for simulating explosion shock waves proposed in this application, please refer to Figure 1 the flowchart shown, and the specific steps are as follows:

[0046] Step 1, obtain the original particle cloud data and construct a characteristic distance matrix, and the characteristic distance matrix indicates the spatial relationship between particles.

[0047] Use existing SPH software to simulate explosion shock waves and obtain SPH particle analysis result data, and read the SPH particle analysis result data to obtain the original particle cloud data. Since the particle distribution in the explosion shock problem is highly non-uniform, the number of particles in the original particle cloud data obtained each time varies greatly. Therefore, in order to ensure that the effect of the simulated explosion shock wave can be better displayed during visualization, it is necessary to perform visualization according to the optimal number of particles displayed on the screen. As Figure 1 shown, Lmax is the optimal number of particles displayed on the screen, and N is the total number of particles in the original particle cloud data. When the total number of particles in the original particle cloud data obtained by simulation does not exceed the optimal number of particles displayed on the screen, the original pressure field can be directly visualized and rendered. When the total number of particles in the original particle cloud data obtained by simulation exceeds the optimal number of particles displayed on the screen, due to the large number of particles, direct visualization will result in poor visual display effects, heavy computational burden, low computational efficiency, and poor real-time performance. Therefore, it is necessary to use the method of this application to perform lightweight processing on the original particle cloud data.

[0048] The particle information contained in the original particle cloud data can reflect the distribution characteristics of the explosion shock wave. Therefore, first, determine the spatial relationship between the examples according to the particle information to obtain the characteristic distance matrix.

[0049] In one embodiment, the original particle cloud data includes the position information and pressure information of each particle. The specific method for constructing the characteristic distance matrix is as follows: Parallelly calculate the characteristic distance between any two particles according to the position information and pressure information of the particles. The characteristic distance is related to the position distance and pressure change gradient between the particles. The closer the position distance between the particles, the greater the pressure change gradient, and the greater the characteristic distance; Use the characteristic distance between each particle and all the other particles as a row to construct the characteristic distance matrix.

[0050] Since the number of particles in the original particle cloud data is huge, the computational cost of calculating the characteristic distance between particles one by one according to the conventional data processing method is relatively high and time-consuming. In order to effectively improve the computational efficiency, this application adopts a CPU-GPU collaborative architecture to offload the computationally intensive task of characteristic distance calculation to the GPU for acceleration, and at the same time, a parallel computing mechanism of the MPI-OpenMP hybrid programming model is adopted in the code implementation. Open multiple threads for parallel computing of the characteristic distance between particles according to the number of parallel threads supported by the hardware, and evenly distribute the characteristic distance calculation task between particles to each parallel thread for simultaneous calculation, which can significantly reduce the computational time. Then, use the characteristic distance between each particle and all the other particles obtained by calculation as a row to combine and obtain the characteristic distance matrix. For the total number of particles in the original particle cloud data being N, the size of the constructed characteristic distance matrix is N×(N - 1).

[0051] The position information of the particles can characterize the positional relationship of the particle distribution, and the pressure information of the particles can characterize the pressure change. The positional relationship of the particle distribution and the pressure change reflect the spatial distribution of the explosion shock wave. Therefore, this application focuses on the positional relationship of the particles and the pressure change. The characteristic distance between any two particles can be calculated through the position information and pressure information of the particles. The specific calculation method is as follows:

[0052] According to the position information of particle i and particle j, the position distance D between particle i and particle j is calculated using the propagation direction perception function g(i,j) with the introduced weight parameter ij = g(i,j);

[0053] According to the pressure information of particle i and particle j, the pressure change gradient P between particle i and particle j is calculated using the pressure change perception function f(i,j) ij = f(i,j);

[0054] The position distance D between particle i and particle j ij and the pressure change gradient P ij are summed to obtain the characteristic distance between particle i and particle j

[0055] This application takes into account that the weight parameter is related to the propagation direction of the explosion shock wave. The energy of the explosion shock wave gradually weakens along the propagation direction. Therefore, the weight parameter of the propagation direction perception function can be dynamically adjusted according to the propagation direction of the explosion shock wave. The farther the propagation direction of the explosion shock wave, the smaller the weight parameter, that is, the weight decreases along the wave front direction. In one embodiment, the specific expression of the propagation direction perception function is:

[0056] g(i,j) = wx(x i - x j ) 2 + wy(y i - y j ) 2 + wz(z i - z j ) 2

[0057] where, (x i , y i , z i ) is the position of particle i, (x j , y j , z j ) is the position of particle j, and wx, wy, wz are weight parameters.

[0058] Considering that the pressure change gradient of the explosion shock wave can reflect the energy transfer of the explosion shock wave, the greater the pressure change gradient, the greater the energy fluctuation of the explosion shock wave. Correspondingly, if the pressure is represented by different shades of color, the greater the pressure change gradient, the more obvious the visual effect after visualization. In one embodiment, the specific expression of the pressure change perception function is:

[0059]

[0060] where p i is the pressure of particle i, p j is the pressure of particle j, σ is the non - linear exponent used to amplify the sensitivity of the high - pressure difference region. The greater the pressure difference between particle i and particle j, the greater the non - linear exponent σ. The typical value of σ is 1.5 - 3.0.

[0061] Step 2, initialize the integer parameter Bc = 0, start multiple parallel threads and determine the corresponding nearest neighbor K value for each parallel thread. The integer parameter Bc≥0.

[0062] Since the feature distance matrix contains the feature information of all particles and contains a large number of features that have little impact on the explosion analysis results, data dimensionality reduction is required to improve the calculation efficiency, enhance the real - time performance of visualization, and improve the visualization effect. To improve the accuracy of the calculation results, a cyclic iteration method is used for calculation, and at the same time, a parallel computing mechanism is utilized to obtain multiple effective features at different scales to further ensure accuracy.

[0063] Among them, the number of parallel threads B is determined according to the maximum number of parallel threads B m supported by the hardware and the total number of particles N in the original particle cloud data, the maximum number of parallel threads B m is determined according to the used hardware device, and the default value is 10.

[0064] At the Bc - th iteration, for any parallel thread b, based on the feature distance matrix and the nearest neighbor K value K b corresponding to the parallel thread b, an adjacency matrix A b is constructed based on the K - nearest neighbor algorithm; the adjacency matrix characterizes the connection relationship between particles.

[0065] Considering that the spectral theory method can transform complex spatial correlation relationships into a spectral feature space to achieve data dimensionality reduction while extracting key features. To apply the spectral clustering method for data dimensionality reduction, the feature distance matrix needs to be first transformed into an adjacency matrix. The adjacency matrix is used to represent the connection relationships between particles, and in this application, the connection relationships between particles are determined based on the feature distances between particles. Since there is no definite corresponding relationship between the connection relationships between particles and the feature distances, in order to ensure that key features can be accurately extracted, the accuracy of the adjacency matrix needs to be guaranteed. This application adopts a dynamic K-nearest neighbor selection mechanism to construct multi-scale adjacency matrices with different nearest neighbor K values to improve the accuracy of the results.

[0066] To improve the computational efficiency, B parallel threads are started to construct the adjacency matrix simultaneously. Each parallel thread constructs a different adjacency matrix, and the different scales of the adjacency matrix are determined by the nearest neighbor K value of the K-nearest neighbor algorithm. In one embodiment, the nearest neighbor K value K corresponding to the parallel thread b is determined b including: determining the nearest neighbor K value K corresponding to the parallel thread b according to the thread ID of the parallel thread b and the number of iterations Bc b = 2 * (Bc + ID) + 3.

[0067] The adjacency matrix A is constructed based on the K-nearest neighbor algorithm b The specific steps are as follows:

[0068] (1) The matrix elements of the feature distance matrix are divided into multiple data groups, and the data of each data group are assigned to a parallel thread.

[0069] To further improve the computational efficiency, multiple small parallel threads are dynamically created on the parallel thread b to perform parallel calculations of the K-nearest neighbors. The method of dividing the data groups can adopt the conventional method of dividing into multiple regions according to the positions of the matrix elements, and the matrix elements within each region form a data group. In this application, to improve the accuracy, the data of the feature distance matrix are pre-clustered using the LSH algorithm according to the data characteristics of the feature distance matrix into data groups with different data characteristics, and the data of each data group have the same characteristics. The LSH algorithm is a prior art, and the specific calculation process is not elaborated in this application.

[0070] (2) Parallelly calculate the matrix elements with the smallest K b values in each data group of the feature distance matrix, and set the values of the matrix elements with the smallest K b values to 1, and set the values of the remaining matrix elements to 0.

[0071] On each small parallel thread, the matrix elements in a divided data group are sorted, and the first K bThe positions corresponding to the matrix elements with the smallest values are used to set the values of the matrix elements at these positions to 1 in the feature distance matrix through atomic operations to indicate that the particles have connection relationships, and the values of the matrix elements at the remaining positions are set to 0 to indicate that the particles have no connection relationships.

[0072] (3) After each small parallel thread finishes updating the values of the matrix elements, the data groups with the updated values of the matrix elements are combined to obtain the adjacency matrix A b . This adjacency matrix A b is a sparse adjacency matrix with clear binary connection relationships.

[0073] After completing the construction of the adjacency matrix, the spectral clustering algorithm can be used to perform dimensionality reduction on the adjacency matrix A b to convert and obtain the lightweight particle cloud S b .

[0074] Similarly, a parallel computing mechanism is used to perform the specific calculation process of spectral clustering to improve the calculation efficiency, and multiple small parallel threads are recreated on the parallel thread b. In one embodiment, the spectral clustering algorithm is used to perform dimensionality reduction on the adjacency matrix A b to convert and obtain the lightweight particle cloud S b The specific steps are as follows:

[0075] (1) The adjacency matrix A b is evenly divided into multiple sub-matrices, and the Laplace sub-matrix corresponding to each sub-matrix is calculated in parallel.

[0076] To ensure that the time required for each small parallel thread to complete the calculation is consistent to reduce the waiting time and thus ensure the maximum improvement of the calculation efficiency, this application evenly divides the adjacency matrix A b into sub-matrices of equal size Each small parallel thread independently calculates the degree matrix of the corresponding sub-matrix The degree matrix is a diagonal matrix, and its diagonal elements represent the connection degrees of each node in the adjacency matrix A b . Then the Laplace sub-matrix corresponding to the sub-matrix is calculated

[0077] (2) The Laplace sub-matrices are combined to obtain the global Laplace matrix L b and eigenvalue decomposition is performed to calculate the eigenvectors corresponding to the first K b smallest eigenvalues; the eigenvectors corresponding to the first K b smallest eigenvalues are combined and normalized to obtain the eigenmatrix U b .

[0078] After each small parallel thread finishes calculating the Laplacian sub-matrix, the thread synchronization mechanism is used to combine all the Laplacian sub-matrices according to the original positions of the sub-matrices divided by the adjacency matrix to obtain the global Laplacian matrix L b Then, on parallel thread b, the truncated singular value decomposition algorithm is used to perform eigenvalue decomposition on the global Laplacian matrix L b to efficiently calculate the first K b smallest eigenvalues and their corresponding eigenvectors. These K b eigenvectors are the key features of the explosion shock wave particle system in the spectral feature space, reflecting the essential state of the particle system. The eigenvectors corresponding to the first K b smallest eigenvalues are combined by columns to construct a K b -dimensional feature matrix, and the feature matrix is normalized to obtain the normalized feature matrix U b . The L2 norm of each row vector of the feature matrix U b is 1.

[0079] By using the method of this application to perform dimensionality reduction on the original particle cloud data, it can be effectively verified through multiple experiments that the data volume can be reduced. In typical cases, the data scale can be compressed to 5% to 10% of the original data volume, effectively improving the calculation efficiency, and also ensuring the real-time performance and good visual effects of subsequent visualization.

[0080] (3) Use the clustering analysis method to cluster the feature matrix U b and iteratively update the cluster centers until the distance between the cluster centers of two adjacent iterations is less than a predetermined threshold, or when the number of iterative updates reaches a predetermined number, the lightweight particle cloud S b is obtained.

[0081] Perform clustering analysis on the dimensionality-reduced feature matrix U b . The pressures of the particle groups in each class are close, and the energies are close. The pressure differences between the particle groups of different classes are large, and the energies are different. Therefore, the particle cloud after clustering processing can show different energy distributions.

[0082] Specifically, the clustering analysis method is as follows: First, select the feature matrix U bUse the first specified number of rows as the initial clustering centers. To ensure the visual effect of subsequent visualization in this application, select the first Lmax rows as the initial clustering centers according to the optimal number of particles for screen display. Then, dynamically create multiple small parallel threads to calculate the Euclidean distances from each data row to the clustering centers in parallel and assign them to the categories of the nearest clustering centers. After completing the clustering assignment of all data rows, use the average value of all data rows in each category as the new clustering center and synchronously update the positions of the clustering centers in parallel thread b. Continuously repeat this process until the distance between the clustering centers in two adjacent iterations is less than a predetermined threshold, or when the number of iterative updates reaches a predetermined number, obtain the lightweight particle cloud S b The predetermined threshold for the distance between the clustering centers in two adjacent iterations is custom-set according to actual needs, and the predetermined number of iterative updates can also be custom-set. In this application, it is set to 10 times.

[0083] Step 3, evaluate the lightweight particle cloud S b Calculate the comprehensive error with the original particle cloud and update the nearest neighbor K value K corresponding to parallel thread b b and enter the (Bc + 1)-th iteration until the comprehensive error is less than the error threshold, or when the maximum number of iterations is reached, obtain the optimal particle cloud.

[0084] According to the calculation process in Step 2, each parallel thread calculates a reduced-dimensional lightweight particle cloud. Evaluate the comprehensive error between the lightweight particle clouds calculated by all B parallel threads and the original particle cloud. This application uses 3 evaluation metrics to obtain the comprehensive error. For any parallel thread b, evaluate the comprehensive error between the lightweight particle cloud S b and the original particle cloud, including: calculate the mean, variance, and entropy of the lightweight particle cloud S b and the original particle cloud respectively, and fuse the mean error, variance error, and entropy error between the lightweight particle cloud S b and the original particle cloud with weights to obtain the comprehensive error. Among them, the weight of each evaluation metric is custom-set according to the actual application situation, with an average weighted default, and the weights of each evaluation metric are equal.

[0085] After calculating the comprehensive errors of all B parallel threads, select the optimal particle cloud in the main thread according to the error calculation results of each parallel thread. In one embodiment, the specific method for determining the optimal particle cloud is as follows:

[0086] When there is a comprehensive error less than the error threshold among the comprehensive errors calculated by all parallel threads, determine that the lightweight particle cloud calculated by the parallel thread with the smallest comprehensive error among the comprehensive errors calculated by all parallel threads is the optimal particle cloud, directly output the lightweight particle cloud calculated by the parallel thread with the smallest comprehensive error, and end the iterative process;

[0087] When there is no comprehensive error less than the error threshold among the comprehensive errors calculated by all parallel threads, a new round of calculation is triggered to re-evaluate the comprehensive error. If there is still no comprehensive error less than the error threshold when the number of iterative calculations reaches the maximum number of iterations BcMax, the lightweight particle cloud calculated by the parallel thread with the smallest comprehensive error among the comprehensive errors calculated by all parallel threads in all iterative processes is determined to be the optimal particle cloud, and the lightweight particle cloud calculated by the parallel thread with the historical optimal comprehensive error is output and the iterative process ends.

[0088] Figure 2 The maximum number of iterations BcMax = 20 is shown, and the comprehensive error is calculated by 20 iterations. The comprehensive error of each iteration is the minimum comprehensive error calculated by all parallel threads. Among them, the comprehensive error calculated by the 13th iteration is the smallest, and the lightweight particle cloud corresponding to the comprehensive error is determined to be the optimal particle cloud.

[0089] The particle cloud image visualization effect of the optimal particle cloud obtained by simulating the explosion shock wave of the hull equipment in this application is as follows Figure 3 As shown in the figure, the warmer the color, the higher the pressure and the greater the energy at that location.

[0090] The above is only a preferred embodiment of the present application, and the present application is not limited to the above embodiments. It is understood that other improvements and changes directly derived or associated by those skilled in the art without departing from the spirit and concept of the present application should be considered to be included in the protection scope of the present application.

Claims

1. A method for lightweight processing of SPH data in explosion shock wave simulation, characterized in that, The SPH data lightweight processing method includes: Obtaining the original particle cloud data and constructing a feature distance matrix, where the feature distance matrix indicates the spatial relationship between particles; Initializing the integer parameter Bc = 0, starting multiple parallel threads and determining the nearest neighbor K value corresponding to each parallel thread, where the integer parameter Bc ≥ 0; At the Bc-th iteration, for any parallel thread b, based on the characteristic distance matrix and the nearest neighbor K value K corresponding to the parallel thread b b , an adjacency matrix A is constructed based on the K-nearest neighbor algorithm b ; the adjacency matrix characterizes the connection relationship between particles; Use the spectral clustering algorithm for the adjacency matrix A b Perform dimensionality reduction processing to transform and obtain the lightweight particle cloud S b ; Evaluate the lightweight particle cloud S b The comprehensive error with the original particle cloud and update the K value K of the nearest neighbor K corresponding to the parallel thread b b , and enter the (Bc + 1)-th iteration until the comprehensive error is less than the error threshold or the optimal particle cloud is obtained when the maximum number of iterations is reached.

2. The SPH data lightweight processing method according to claim 1, wherein The adjacency matrix A is constructed based on the K-nearest neighbor algorithm b including: Dividing the matrix elements of the feature distance matrix into multiple data groups, and allocating the data of each data group to a parallel thread; For each data group of the parallel computing feature distance matrix, select the first K matrix elements with the smallest values, set the values of the first K matrix elements with the smallest values to 1, and set the values of the remaining matrix elements to 0; b For the first K b matrix elements with the smallest values, set their values to 1, and set the values of the remaining matrix elements to 0; The updated values of the matrix elements are combined to obtain the adjacency matrix A for each data group b , where a value of 1 for a matrix element indicates a connection relationship between particles, and a value of 0 indicates no connection relationship between particles 3. The SPH data lightweight processing method according to claim 1, wherein The original particle cloud data includes the position information and pressure information of each particle, and constructing the feature distance matrix includes: Parallelly calculating the feature distance between any two particles according to the position information and pressure information of the particles. The feature distance is related to the position distance and the pressure change gradient between the particles. The closer the position distance between the particles, the greater the pressure change gradient, and the greater the feature distance; Taking the feature distance between each particle and all other particles as a row to construct the feature distance matrix.

4. The SPH data lightweight processing method according to claim 3, wherein The parallel calculation of the feature distance between any two particles according to the position information and pressure information of the particles includes: According to the position information of particle i and particle j, the position distance D between particle i and particle j is calculated using the propagation direction perception function g(i,j) introducing a weight parameter ij = g(i,j); the weight parameter is related to the propagation direction of the explosion shock wave, and the farther the propagation direction of the explosion shock wave is, the smaller the weight parameter is; According to the pressure information of particle i and particle j, the pressure change gradient P of particle i and particle j is calculated using the pressure change perception function f(i, j) ij = f(i, j); The positional distance D between particle i and particle j ij and the pressure change gradient P ij are summed to obtain the characteristic distance between particle i and particle j 5. The SPH data lightweight processing method according to claim 4, characterized in that The propagation direction perception function g(i,j) = wx(x i -x j ) 2 +wy(y i -y j ) 2 +wz(z i -z j ) 2 ; where (x i , y i , z i ) is the position of particle i, (x j , y j , z j ) is the position of particle j, and wx, wy, wz are weight parameters.

6. The SPH data lightweight processing method according to claim 4, characterized in that, The pressure change sensing function where p i is the pressure of particle i, p j is the pressure of particle j, σ is the non-linear exponent, and the greater the pressure difference between particle i and particle j and the greater the non-linear exponent σ.

7. The SPH data lightweight processing method according to claim 1, wherein The use of the spectral clustering algorithm for the adjacency matrix A b is subjected to dimensionality reduction processing to convert and obtain a lightweight particle cloud S b including: Partition the adjacency matrix A b evenly into multiple submatrices, and calculate the Laplacian submatrices corresponding to each submatrix in parallel; Combine each Laplacian sub-matrix to obtain the global Laplacian matrix L b And perform eigenvalue decomposition to calculate the eigenvectors corresponding to the first K b smallest eigenvalues; Combine the eigenvectors corresponding to the first K b smallest eigenvalues and perform normalization to obtain the eigenmatrix U b ; Using the clustering analysis method for the feature matrix U b Perform clustering and iteratively update the cluster centers until the distance between the cluster centers of two adjacent iterations is less than a predetermined threshold, or when the number of iterative updates reaches a predetermined number, the lightweight particle cloud S is obtained b .

8. The SPH data lightweight processing method according to claim 1, characterized in that Determine the nearest neighbor K value K corresponding to the parallel thread b b Including: Determine the nearest neighbor K value K corresponding to the parallel thread b according to the thread number ID and the number of iterations Bc of the parallel thread b b = 2 * (Bc + ID) + 3.

9. The SPH data lightweight processing method according to claim 1, wherein The evaluated lightweight particle cloud S b The comprehensive error from the original particle cloud includes: Calculate the lightweight particle cloud S separately b and the mean, variance, and entropy of the original particle cloud, and weight and fuse the mean error, variance error, and entropy error between the lightweight particle cloud S b and the original particle cloud to obtain the comprehensive error.

10. The SPH data lightweight processing method according to claim 1, wherein Determining the optimal particle cloud includes: When there is a comprehensive error smaller than the error threshold among the comprehensive errors calculated by all parallel threads, determining the lightweight particle cloud calculated by the parallel thread with the smallest comprehensive error among the comprehensive errors calculated by all parallel threads as the optimal particle cloud; When there is no comprehensive error smaller than the error threshold among the comprehensive errors calculated by all parallel threads and the maximum number of iterations is reached, determining the lightweight particle cloud calculated by the parallel thread with the smallest comprehensive error among the comprehensive errors calculated by all parallel threads during all iteration processes as the optimal particle cloud.