Stiffness matrix compression storage method, system and medium based on block symmetry characteristics
By compressing and storing the stiffness matrix using block symmetry, the problem of redundant data in sparse matrix storage is solved, efficient memory utilization and improved solution performance are achieved, and it is suitable for finite element analysis of complex structures.
Patent Information
- Application Number
- CN202411448925.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-10-17
AI Technical Summary
The existing sparse matrix storage format does not fully utilize the block and symmetry properties of the stiffness matrix, resulting in the storage of a large amount of redundant data, increasing memory requirements and reducing the efficiency of solving finite element equations.
A stiffness matrix compression storage method based on block symmetry characteristics is adopted. Only the values of the upper triangle of the matrix are stored. The block characteristics are utilized to decompose the global stiffness matrix into several sub-matrices to reduce the storage of redundant information. The finite element equations are solved using a numerical solution method.
It effectively reduces the redundant information stored in the stiffness matrix, reduces the time complexity of matrix operations, improves the solution performance of linear equations, saves memory and improves solution efficiency.
Smart Images

Figure CN119358329B_ABST
Abstract
Description
Technical Field
[0001] The present 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 (FEA) approximates the solution to the original partial differential equation by partitioning a continuous domain into a finite number of elements and establishing a set of discrete algebraic equations. This method is a numerical computational technique used to solve boundary problems in complex structures and physical phenomena. However, as the size of the finite element mesh increases, the computer memory requirements and the size of the finite element equations also increase dramatically, resulting in a decrease in the efficiency of solving the system of equations. Therefore, efficiently storing sparse matrices and processing finite element equations is crucial for solving large-scale problems.
[0003] Existing sparse matrix storage formats (such as coordinate lists (COO), column-based compressed storage (CSC), and row-based compressed storage (CSR)) have achieved some success in reducing memory requirements and improving computational efficiency. However, when storing the global stiffness matrix in finite element equations, these methods fail to fully exploit the block-based and symmetric nature of the stiffness matrix, and still store a large amount of redundant data. Therefore, how to further improve the efficiency of finite element solution while saving memory space has become a pressing technical challenge. Summary of the Invention
[0004] In order to overcome the defects and shortcomings of the existing technology, 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. At the same time, it utilizes the block characteristics to only store part of the position information. This 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 equation 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 of elements, nodes, and degrees of freedom is performed, specifically including:
[0015] The unit number and node number are numbered from left to right and from bottom to top;
[0016] All degrees of freedom in the first direction are initially numbered, and then all degrees of freedom in the 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 submatrices of the global stiffness matrix. When i=j, they are diagonal submatrices, and when i≠j, they are non-diagonal submatrices. The number and position of non-zero elements in each submatrix are the same.
[0023] As an optimal 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, which are expressed 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 K in the diagonal submatrix 1,1 The number of non-zero elements in each column of the upper triangular part, vector row d Used to store 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 triangle 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 stiffness values of the non-zero elements of , i≠j.
[0026] As a preferred technical solution, the application for storage space based on the block symmetry characteristics of the global stiffness matrix includes the following order:
[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 in 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 directions.
[0030] As a preferred technical solution, the step of assembling the element 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 number 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 construction module, a parameter acquisition module, a grid 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 obtain 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 elements, 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 the global stiffness matrix is compressed and stored 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 above-mentioned stiffness matrix compression storage method based on block symmetry characteristics.
[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. At the same time, it utilizes the block characteristics to only store part of the position information. This 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 Schematic diagram of the flow of the stiffness matrix compression storage method based on block symmetry characteristics of the present invention;
[0048] Figure 2 Schematic diagram of a two-dimensional cantilever beam model of the present invention;
[0049] Figure 3 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 Schematic diagram of displacement obtained by finite element method for the two-dimensional cantilever beam model of the present invention;
[0053] Figure 7 This is a displacement 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 the two-dimensional cantilever beam model;
[0055] Figure 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 solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to 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. This method can be used to accelerate the solution of finite element equations for two-dimensional and three-dimensional engine connecting rod models. The symmetry and block characteristics of the global stiffness matrix are utilized 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. This method can be directly used to analyze complex models with multiple different unit types. The method specifically includes the following steps:
[0059] S1: If Figure 2 and Figure 3 As shown, build a geometric model and obtain material property parameters;
[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 The grid size of the engine connecting rod is 56019×56019, and the number of non-zero elements N z The number of the element and node is 2008791. The element and node numbers 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 according to one direction (such as the x direction), and then numbered according to the other direction (such as the y direction).
[0062] S3: Combine Figure 2 and Figure 3 As shown, define the boundary conditions and apply the load conditions;
[0063] S4: Apply for storage space based on the block symmetry of the global stiffness matrix;
[0064] 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. Since the degrees of freedom are numbered according to step S2, the global stiffness matrix can be decomposed into several sub-matrices, which can be 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 submatrices of the global stiffness matrix. When i=j, they are diagonal submatrices, and when i≠j, they are non-diagonal submatrices. The number and position of non-zero elements in each submatrix 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 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 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; 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 in 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 directions.
[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 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, without the need to open up additional memory space.
[0076] S6: Use numerical solution method to solve the corresponding finite element equation after compressing and storing the 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 using the conjugate gradient method to solve, the compressed storage format saves 59.95% of memory and improves the solution efficiency by 62.84% in the two-dimensional cantilever beam, and saves 65.58% of memory and improves the solution efficiency by 68.64% in the engine connecting rod. Figure 8 and Figure 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 element stiffness matrix calculation module is used to calculate the element stiffness matrix;
[0088] In this embodiment, the information assembly module is used to assemble the element 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 using a numerical solution method.
[0090] Example 3
[0091] This embodiment provides a storage medium, which may be a ROM, RAM, disk, optical disk, or other storage medium. 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 considered as equivalent replacement methods and are included in the scope of protection 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 of the global stiffness matrix, including: 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 submatrices of the global stiffness matrix. When i = j, they are diagonal submatrices, and when i ≠ j, they are non-diagonal submatrices. The number and position of non-zero elements in each submatrix are the same. Decompose the global stiffness matrix into several sub-matrices. The diagonal sub-matrices and non-diagonal sub-matrices are stored in three vectors respectively, which are expressed 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 K in the diagonal submatrix 1,1 The number of non-zero elements in each column of the upper triangular part, vector row d Used to store 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 triangle 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 value of , i≠j; The order of applying for storage space based on the block symmetry characteristics of the global stiffness matrix 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 in 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 directions; 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 equation after the compressed and stored global stiffness matrix.
2. The stiffness matrix compression storage method based on block symmetry 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 matrices based on block symmetry according to claim 1, characterized in that: Numbering of elements, nodes, and degrees of freedom, including: The unit number and node number are numbered from left to right and from bottom to top; All degrees of freedom in the first direction are initially numbered, and then all degrees of freedom in the second direction are numbered.
4. The method for compressing and storing stiffness matrices based on block symmetry according to claim 1, characterized in that: The step of assembling the element 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 number of non-zero elements in the vector row d With vector row nd .
5. The method for compressing and storing stiffness matrices based on block symmetry 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 multigrid method.
6. A stiffness matrix compression storage system based on block symmetry, characterized in that: A stiffness matrix compression storage method based on block symmetry characteristics for implementing any one of claims 1 to 5, comprising: a geometric model construction module, a parameter acquisition module, a meshing 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; The geometric model building module is used to build a geometric model; The parameter acquisition module is used to obtain 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 elements, 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 the global stiffness matrix is compressed and stored using a numerical solution method.
7. 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 5 is implemented.
Citation Information
Patent Citations
Finite element assembly matrix compression storage method and device for process simulation
CN115618689A
Rigidity matrix storage method and device, computer equipment and storage medium
CN117972905A