Stiffness matrix compression storage method and system based on block symmetry characteristic and medium
By compressing the storage of the storage finite element equation, the use of its symmetry and block characteristics is used to solve the problem of redundant data storage, which improves the efficiency of the solution of the finite element equation.
Patent Information
- Application Number
- CN202411448925.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-17
AI Technical Summary
The prior art fails to fully utilize its blocking and symmetry characteristics when storing the global stiffness matrix in finite element equations, resulting in redundant data storage and affecting computing efficiency.
By using the symmetrical characteristics of the rigidity matrix, only the value of the upper triangle part is stored, and only the partial location information is stored in combination with the block characteristics, and the efficient compression storage of the stiffen matrix is achieved.
Reduce the redundant information of the stiffness matrix storage, reduce the time complexity of matrix and vector multiplication and other matrix operations, thereby improving the performance of the linear equation group solution.
Smart Images

Figure CN119358329A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of stiffness matrix data compression storage, and in particular to a stiffness matrix compression storage method, system and medium based on block symmetry characteristics. Background Art
[0002] Finite element analysis approximates the solution of the original partial differential equation by dividing the continuous domain into a finite number of elements and establishing a set of discrete algebraic equations. This method is a numerical calculation technique used to solve boundary problems in complex structures and physical phenomena. However, as the size of the finite element mesh increases, the computer's memory requirements increase dramatically, and the size of the finite element equations also increases sharply, resulting in a decrease in the efficiency of solving the system of equations. Therefore, how to efficiently store sparse matrices and process finite element equations is crucial to solving large-scale problems.
[0003] Existing sparse matrix storage formats (such as coordinate list COO, column-by-column compressed storage CSC, row-by-row compressed storage CSR, etc.) have achieved certain results in reducing memory requirements and improving computational efficiency. However, when storing the global stiffness matrix in the finite element equation, these methods do not fully utilize the block and symmetric characteristics of the stiffness matrix and still store a large amount of redundant data. Therefore, how to further improve the efficiency of solving finite element equations while saving memory space has become a difficult problem that needs to be solved urgently in the current technical field. Summary of the invention
[0004] In order to overcome the defects and shortcomings of the prior art, the present invention provides a stiffness matrix compression storage method, system and medium based on block symmetry characteristics. When storing the stiffness matrix, the present invention utilizes the symmetry characteristics of the stiffness matrix to only store the values of the upper triangle of the matrix, and at the same time utilizes the block characteristics to only store part of the position information, which not only maintains the reducibility of the stiffness matrix, but also reduces the redundant information stored in the stiffness matrix. In addition, it also reduces the time complexity of stiffness matrix and vector multiplication and other matrix operations, thereby effectively improving the performance of solving linear equations.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] The present invention provides a stiffness matrix compression storage method based on block symmetry characteristics, comprising the following steps:
[0007] Build geometric models and obtain material property parameters;
[0008] Divide the finite element analysis grid according to the geometric model and number the elements, nodes, and degrees of freedom;
[0009] Set boundary conditions and apply load cases;
[0010] Apply for storage space based on the block symmetry characteristics of the global stiffness matrix;
[0011] Calculate the element stiffness matrix, assemble the element stiffness matrix information into the global stiffness matrix, and apply boundary conditions;
[0012] The numerical solution method is used to solve the corresponding finite element equations after the compressed and stored global stiffness matrix.
[0013] As a preferred technical solution, the geometric model adopts a two-dimensional finite element model or a three-dimensional finite element model, and the material property parameters include elastic modulus and Poisson's ratio.
[0014] As a preferred technical solution, numbering the elements, nodes, and degrees of freedom includes:
[0015] The unit numbers and node numbers are numbered from left to right and from bottom to top;
[0016] All degrees of freedom in the set first direction are initially numbered, and then all degrees of freedom in the set second direction are numbered.
[0017] As a preferred technical solution, the application for storage space based on the block symmetry characteristics of the global stiffness matrix specifically includes:
[0018] According to the mutual stiffness relationship of each node in the unit, the number of non-zero elements in the global stiffness matrix is calculated;
[0019] The global stiffness matrix is decomposed into several sub-matrices, expressed as:
[0020]
[0021]
[0022] Among them, K 2d is the global stiffness matrix of the two-dimensional finite element model, K 3d is the global stiffness matrix of the three-dimensional finite element model, K i,j are several sub-matrices of the global stiffness matrix. When i=j, they are diagonal sub-matrices, and when i≠j, they are non-diagonal sub-matrices. The number and position of non-zero elements in each sub-matrix are the same.
[0023] As a preferred technical solution, the global stiffness matrix is decomposed into several sub-matrices, and the diagonal sub-matrices and non-diagonal sub-matrices are stored in three vectors respectively, represented as: vector col_ptr d , vector col_ptr nd , vector row d , vector row nd , vector val d , vector val nd;
[0024] Among them, the vector col_ptr d Used to store the K in the diagonal submatrix 1,1 The number of non-zero elements in each column of the upper triangular part of d Used to store the K in the diagonal submatrix 1,1 The row number of the non-zero elements in the upper triangular part of , vector val d Used to store all diagonal submatrices K i,i The stiffness values of the non-zero elements in the upper triangular part of ;
[0025] vector col_ptr nd Used to store K in the non-diagonal submatrix 1,2 The number of non-zero elements in each column, vector row nd Used to store K in the non-diagonal submatrix 1,2 The row numbers of the non-zero elements of the vector val nd Used to store all non-diagonal submatrices K i,j The non-zero element stiffness values of , i≠j.
[0026] As a preferred technical solution, the storage space is applied for based on the block symmetry characteristics of the global stiffness matrix, and the order of applying for the storage space includes:
[0027] According to the node number, apply for a vector col_ptr of type int and length n+1 d and vector col_ptr nd , the number of non-zero elements of the global stiffness matrix used for recording;
[0028] Based on the number of non-zero elements in the diagonal submatrix and the non-diagonal submatrix, apply for an int type and length of col_ptr d [n+1] and col_ptr nd [n+1] vector row d With vector row nd , used to record the row numbers of non-zero elements of the global stiffness matrix;
[0029] Apply for double type and length col_ptr d [n+1]×dim and col_ptr nd [n+1]×dim vector val d and val nd , used to record the values of non-zero elements of the global stiffness matrix, where n is the node number and dim is the number of degrees of freedom.
[0030] As a preferred technical solution, the step of assembling the unit stiffness matrix information into the global stiffness matrix specifically includes:
[0031] Store the distribution of non-zero elements in each column of the upper triangular part of the global stiffness matrix into the vector col_ptr d and vector col_ptr nd ;
[0032] Assemble the stiffness values of the element stiffness matrix into the vector val d and vector val nd , store the row numbers of non-zero elements in the vector row d With vector row nd .
[0033] As a preferred technical solution, the numerical solution method adopts any one of the conjugate gradient method, the preconditioned conjugate gradient method or the multi-grid method.
[0034] The present invention also provides a stiffness matrix compression storage system based on block symmetry characteristics, comprising: a geometric model building module, a parameter acquisition module, a mesh division module, a numbering module, a condition setting module, a storage space application module, a unit stiffness matrix calculation module, an information assembly module, and a solution module;
[0035] The geometric model building module is used to build a geometric model;
[0036] The parameter acquisition module is used to acquire material property parameters;
[0037] The meshing module is used to divide the finite element analysis mesh according to the geometric model;
[0038] The numbering module is used to number the units, nodes, and degrees of freedom;
[0039] The condition setting module is used to set boundary conditions and apply load conditions;
[0040] The storage space application module is used to apply for storage space based on the block symmetry characteristics of the global stiffness matrix;
[0041] The unit stiffness matrix calculation module is used to calculate the unit stiffness matrix;
[0042] The information assembly module is used to assemble the unit stiffness matrix information into the global stiffness matrix and apply boundary conditions;
[0043] The solution module is used to solve the corresponding finite element equation after compressing and storing the global stiffness matrix by using a numerical solution method.
[0044] The present invention also provides a computer-readable storage medium storing a program, wherein when the program is executed by a processor, the program implements the stiffness matrix compression storage method based on block symmetry characteristics as described above.
[0045] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0046] When storing the stiffness matrix, the present invention utilizes the symmetric characteristics of the stiffness matrix to only store the values of the upper triangle of the matrix, and utilizes the block characteristics to only store part of the position information, which not only maintains the reducibility of the stiffness matrix, but also reduces the redundant information stored in the stiffness matrix. In addition, it also reduces the time complexity of the stiffness matrix and vector multiplication and other matrix operations, thereby effectively improving the performance of solving the linear equation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a flow chart of the stiffness matrix compression storage method based on block symmetry characteristics of the present invention;
[0048] Figure 2 It is a schematic diagram of a two-dimensional cantilever beam model of the present invention;
[0049] Figure 3 It is a schematic diagram of the engine connecting rod model of the present invention;
[0050] Figure 4 Schematic diagram of non-zero elements of the global stiffness matrix of the two-dimensional cantilever beam model of the present invention;
[0051] Figure 5 Schematic diagram of non-zero elements of the global stiffness matrix of the engine connecting rod model of the present invention;
[0052] Figure 6 It is a displacement schematic diagram of the finite element solution of the two-dimensional cantilever beam model of the present invention;
[0053] Figure 7 It is a displacement schematic diagram of the finite element solution of the engine connecting rod model of the present invention;
[0054] Figure 8 This is a comparison diagram of the effects of the present invention and the traditional method in solving a two-dimensional cantilever beam model;
[0055] Fig. 9 This is a comparison chart of the effects of the present invention and the traditional method in solving the engine connecting rod model. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0057] Example 1
[0058] like Figure 1As shown, this embodiment provides a stiffness matrix compression storage method based on block symmetry characteristics. The method can be used to accelerate the solution of finite element equations of two-dimensional and three-dimensional engine connecting rod models. The symmetry and block characteristics of the global stiffness matrix are used to decompose the matrix into several sub-matrices. By reducing the storage of redundant information, high-performance storage and solution of finite element equations are achieved. The method can be directly used to analyze the situation where a complex model has a variety of different unit types. The method specifically includes the following steps:
[0059] S1: Figure 2 and Figure 3 As shown, a geometric model is constructed and material property parameters are obtained;
[0060] In this embodiment, the geometric model may adopt a two-dimensional cantilever beam or a three-dimensional engine connecting rod model, and the material property parameters include elastic modulus and Poisson's ratio;
[0061] S2: According to the geometric model, the finite element analysis grid is divided and the units, nodes, and degrees of freedom are numbered. The grid size of the two-dimensional cantilever beam is 40602×40602, and the number of non-zero elements N z is 524210, the grid size of the engine connecting rod is 56019×56019, and the number of non-zero elements N z The unit number and node number are numbered from left to right and from bottom to top. To write the degree of freedom number, first, all degrees of freedom are initially numbered in one direction (such as the x direction), and then numbered in another direction (such as the y direction).
[0062] S3: Combination Figure 2 and Figure 3 As shown, define boundary conditions and apply load conditions;
[0063] S4: Apply for storage space based on the block symmetry characteristics of the global stiffness matrix;
[0064] According to the mutual stiffness relationship of each node in the unit, the number of non-zero elements of the global stiffness matrix is calculated. Since the degrees of freedom are numbered according to step S2, the global stiffness matrix can be decomposed into several sub-matrices, which are specifically expressed as follows:
[0065]
[0066] Among them, K 2d is the global stiffness matrix of the two-dimensional finite element model (such as a two-dimensional cantilever beam), K 3d is the global stiffness matrix of the three-dimensional finite element model (such as the engine connecting rod model), K i,j are several sub-matrices of the global stiffness matrix. When i=j, they are diagonal sub-matrices, and when i≠j, they are non-diagonal sub-matrices. The number and position of non-zero elements in each sub-matrix are the same, such as Figure 4 and Figure 5 As shown, the non-zero elements of the global stiffness matrix of the two-dimensional cantilever beam and the engine connecting rod are obtained.
[0067] The global stiffness matrix is decomposed into several sub-matrices, where the diagonal sub-matrices and non-diagonal sub-matrices are stored in three vectors respectively, specifically represented as: col_ptr d , col_ptr nd , row d , row nd ,val d ,val nd , where col_ptr d Used to store the K in the diagonal submatrix 1,1 The number of non-zero elements in each column of the upper triangular part, row d Used to store the K in the diagonal submatrix 1,1 The row number of the non-zero elements in the upper triangular part of , val d Used to store all diagonal submatrices K i,i The stiffness value of the non-zero elements in the upper triangular part of col_ptr; nd Used to store K in the non-diagonal submatrix 1,2 The number of non-zero elements in each column, row nd Used to store K in the non-diagonal submatrix 1,2 The non-zero element row number of , val nd Used to store all non-diagonal submatrices K i,j Non-zero element stiffness values (i≠j).
[0068] In this embodiment, the sequence of applying for storage space of the global stiffness matrix includes the following sub-steps:
[0069] a. According to the node number, apply for a vector col_ptr of type int and length n+1 d and col_ptr nd , the number of non-zero elements of the global stiffness matrix used for recording;
[0070] b. Based on the number of non-zero elements in the diagonal submatrix and the non-diagonal submatrix, apply for an int type and length of col_ptr d [n+1] and col_ptr nd [n+1] vector row d with row nd , used to record the row numbers of non-zero elements of the global stiffness matrix;
[0071] c. Apply for double type and length of col_ptr d [n+1]×dim and col_ptr nd[n+1]×dim vector val d and val nd , used to record the values of non-zero elements of the global stiffness matrix, where n is the node number and dim is the number of degrees of freedom.
[0072] S5: Calculate the unit stiffness matrix and assemble the unit stiffness matrix information into the corresponding global stiffness matrix val d ,val nd and row d ,row nd and impose boundary conditions, including:
[0073] a. Record the distribution of non-zero elements in each column of the upper triangular part of the global stiffness matrix in the vector col_ptr d and col_ptr nd ;
[0074] b. Assemble the stiffness values of the element stiffness matrix into the vector val d and val nd , record the row number of non-zero elements in the vector row d with row nd ;
[0075] c. Apply boundary conditions according to actual conditions. When the global stiffness matrix needs to be modified (such as applying Dirichlet boundary conditions), only the stiffness value of the corresponding position is found and modified, and no additional memory space needs to be opened.
[0076] S6: A numerical solution method is used to solve the corresponding finite element equation after the compressed and stored global stiffness matrix.
[0077] In this embodiment, the numerical solution method may use any of the following numerical algorithms: Conjugate Gradient Method; Preconditioned Conjugate Gradient Method; Multigrid Method;
[0078] In this embodiment, the data outputted in step S6 includes the solved displacement distribution diagram and the solved effect diagram, such as Figure 6 , Figure 7 As shown in the figure, the displacement distribution diagram can be obtained by performing finite element analysis on the two-dimensional cantilever beam and the engine connecting rod. When the conjugate gradient method is used for solution, the compressed storage format saves 59.95% of the memory in the two-dimensional cantilever beam and improves the solution efficiency by 62.84%, and saves 65.58% of the memory in the engine connecting rod and improves the solution efficiency by 68.64%. Figure 8 and Fig. 9 As shown, the solution effect is obtained. The present invention can improve the efficiency of solving finite element equations while saving memory. It can be widely used in engineering practice and has good engineering application value.
[0079] Example 2
[0080] This embodiment provides a stiffness matrix compression storage system based on block symmetry characteristics, including: a geometric model construction module, a parameter acquisition module, a mesh division module, a numbering module, a condition setting module, a storage space application module, a unit stiffness matrix calculation module, an information assembly module, and a solution module;
[0081] In this embodiment, the geometric model building module is used to build a geometric model;
[0082] In this embodiment, the parameter acquisition module is used to obtain material property parameters;
[0083] In this embodiment, the meshing module is used to divide the finite element analysis mesh according to the geometric model;
[0084] In this embodiment, the numbering module is used to number the elements, nodes, and degrees of freedom;
[0085] In this embodiment, the condition setting module is used to set boundary conditions and apply load conditions;
[0086] In this embodiment, the storage space application module is used to apply for storage space based on the block symmetry characteristics of the global stiffness matrix;
[0087] In this embodiment, the unit stiffness matrix calculation module is used to calculate the unit stiffness matrix;
[0088] In this embodiment, the information assembly module is used to assemble the unit stiffness matrix information into the global stiffness matrix and apply boundary conditions;
[0089] In this embodiment, the solution module is used to solve the corresponding finite element equation after the global stiffness matrix is compressed and stored by using a numerical solution method.
[0090] Example 3
[0091] This embodiment provides a storage medium, which may be a storage medium such as ROM, RAM, disk, or CD. The storage medium stores one or more programs. When the program is executed by a processor, the stiffness matrix compression storage method based on block symmetry characteristics of Embodiment 1 is implemented.
[0092] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A stiffness matrix compression storage method based on block symmetry characteristics, characterized in that: The steps include: Build geometric models and obtain material property parameters; Divide the finite element analysis grid according to the geometric model and number the elements, nodes, and degrees of freedom; Set boundary conditions and apply load cases; Apply for storage space based on the block symmetry characteristics of the global stiffness matrix; Calculate the element stiffness matrix, assemble the element stiffness matrix information into the global stiffness matrix, and apply boundary conditions; The numerical solution method is used to solve the corresponding finite element equations after the compressed and stored global stiffness matrix.
2. The method for compressing and storing stiffness matrix based on block symmetry characteristics according to claim 1 is characterized in that: The geometric model adopts a two-dimensional finite element model or a three-dimensional finite element model, and the material property parameters include elastic modulus and Poisson's ratio.
3. The method for compressing and storing stiffness matrix based on block symmetry characteristics according to claim 1, characterized in that: Numbering of elements, nodes, and degrees of freedom, including: The unit numbers and node numbers are numbered from left to right and from bottom to top; All degrees of freedom in the set first direction are initially numbered, and then all degrees of freedom in the set second direction are numbered.
4. The method for compressing and storing stiffness matrix based on block symmetry characteristics according to claim 1, characterized in that: The application for storage space based on the block symmetry characteristics of the global stiffness matrix specifically includes: According to the mutual stiffness relationship of each node in the unit, the number of non-zero elements in the global stiffness matrix is calculated; The global stiffness matrix is decomposed into several sub-matrices, expressed as: Among them, K 2d is the global stiffness matrix of the two-dimensional finite element model, K 3d is the global stiffness matrix of the three-dimensional finite element model, K i,j are several sub-matrices of the global stiffness matrix. When i=j, they are diagonal sub-matrices, and when i≠j, they are non-diagonal sub-matrices. The number and position of non-zero elements in each sub-matrix are the same.
5. The method for compressing and storing stiffness matrix based on block symmetry characteristics according to claim 4 is characterized in that: The global stiffness matrix is decomposed into several sub-matrices. The diagonal sub-matrices and non-diagonal sub-matrices are stored in three vectors respectively, represented as: vector col_ptr d , vector col_ptr nd , vector row d , vector row nd , vector val d , vector val nd ; Among them, the vector col_ptr d Used to store the K in the diagonal submatrix 1,1 The number of non-zero elements in each column of the upper triangular part of d Used to store the K in the diagonal submatrix 1,1 The row numbers of the non-zero elements in the upper triangular part of , vector val d Used to store all diagonal submatrices K i,i The stiffness values of the non-zero elements in the upper triangular part of ; vector col_ptr nd Used to store K in the non-diagonal submatrix 1,2 The number of non-zero elements in each column, vector row nd Used to store K in the non-diagonal submatrix 1,2 The row numbers of the non-zero elements of the vector val nd Used to store all non-diagonal submatrices K i,j The non-zero element stiffness values of , i≠j.
6. The method for compressing and storing stiffness matrix based on block symmetry characteristics according to claim 5 is characterized in that: The storage space is applied for based on the block symmetry characteristics of the global stiffness matrix, and the order of applying for the storage space includes: According to the node number, apply for a vector col_ptr of type int and length n+1 d and vector col_ptr nd , the number of non-zero elements of the global stiffness matrix used for recording; Based on the number of non-zero elements in the diagonal submatrix and the non-diagonal submatrix, apply for an int type and length of col_ptr d [n+1] and col_ptr nd [n+1] vector row d With vector row nd , used to record the row numbers of non-zero elements of the global stiffness matrix; Apply for double type and length col_ptr d [n+1]×dim and col_ptr nd [n+1]×dim vector val d and val nd , used to record the values of non-zero elements of the global stiffness matrix, where n is the node number and dim is the number of degrees of freedom.
7. The method for compressing and storing stiffness matrix based on block symmetry characteristics according to claim 5, characterized in that: The step of assembling the unit stiffness matrix information into the global stiffness matrix specifically includes: Store the distribution of non-zero elements in each column of the upper triangular part of the global stiffness matrix into the vector col_ptr d and vector col_ptr nd ; Assemble the stiffness values of the element stiffness matrix into the vector val d and vector val nd , store the row numbers of non-zero elements in the vector row d With vector row nd .
8. The method for compressing and storing stiffness matrix based on block symmetry characteristics according to claim 1, characterized in that: The numerical solution method adopts any one of the conjugate gradient method, the preconditioned conjugate gradient method or the multi-grid method.
9. A stiffness matrix compression storage system based on block symmetry characteristics, characterized in that: include: Geometric model building module, parameter acquisition module, meshing module, numbering module, condition setting module, storage space application module, unit stiffness matrix calculation module, information assembly module, solution module; The geometric model building module is used to build a geometric model; The parameter acquisition module is used to acquire material property parameters; The meshing module is used to divide the finite element analysis mesh according to the geometric model; The numbering module is used to number the units, nodes, and degrees of freedom; The condition setting module is used to set boundary conditions and apply load conditions; The storage space application module is used to apply for storage space based on the block symmetry characteristics of the global stiffness matrix; The unit stiffness matrix calculation module is used to calculate the unit stiffness matrix; The information assembly module is used to assemble the unit stiffness matrix information into the global stiffness matrix and apply boundary conditions; The solution module is used to solve the corresponding finite element equation after compressing and storing the global stiffness matrix by using a numerical solution method.
10. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the stiffness matrix compression storage method based on block symmetry characteristics as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method for storing and generating stiffness matrix for finite-element analysis in metal bulk plastic forming
CN102184298A
GPU acceleration method for dynamic response analysis of thin-plate gridless Galerkin structure
CN109960865A
Total stiffness matrix solving method in composite material plane elasticity finite element analysis
CN115081297A
Finite element assembly matrix compression storage method and device for process simulation
CN115618689A
Sparse matrix storage method and device, equipment and storage medium
CN117171497A
Cited By
Structural finite element stiffness matrix super-node parallel Cholesky numerical decomposition method
CN119918368A
A Supernode Parallel Cholesky Numerical Decomposition Method for the Structural Finite Element Stiffness Matrix
CN119918368B