A structural design optimization method, system, computer device and storage medium
By utilizing GPU for parallel computing and hybrid programming in topology optimization, the problem of computing resource requirements for topology optimization is solved, efficient structural design optimization is achieved, computing time is significantly reduced and computing efficiency is improved.
Patent Information
- Application Number
- CN202110211739.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-25
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-02-25
AI Technical Summary
Topology optimization has bottlenecks in computing resource requirements, especially the iterative calculations of finite element analysis and truss-like structural problems caused by rough finite element meshes, which increase calculation time and post-processing work in the manufacturing process.
By using GPU devices for parallel computing, allocating computing tasks, using unit coloring methods and symbolic assembly to perform linear system solving and sensitivity calculations, and combining hybrid programming of CPU and GPU for density updates, structural design optimization is achieved.
It greatly accelerates the calculation process, achieving an acceleration ratio of over 100 times, reducing the calculation time of finite element analysis, improving calculation efficiency, avoiding data communication overhead between the host and the device, and achieving high-precision calculations on ordinary personal computers. Topology optimization calculations.
Smart Images

Figure CN114969857B
Abstract
Description
Technical Field
[0001] The present application relates to the field of engineering design, and in particular to a structural design optimization method, system, computer equipment and storage medium. Background Art
[0002] Structural design optimization originated in the early twentieth century and attracted widespread attention from researchers in the mid-twentieth century. It combines numerical analysis technology with computer analysis and is widely used in structural design in practical engineering. The detailed design stage of the structure mainly adopts size optimization to improve the performance of the structure by changing the length, width, cross-sectional area and other properties of the structure. The basic design stage of the structure mainly adopts shape optimization to improve the performance of the structure by changing the geometric boundary shape of the structure. These two types of optimization are mainly used in the later stage of structural design. They are local optimization techniques after determining the material layout and cannot fundamentally improve the performance of the structure. Topological optimization is mainly used in the conceptual design stage of the structure. Under given load and boundary conditions, it seeks the material distribution corresponding to the optimal performance index of the structure under certain constraints. Compared with the first two optimization methods, topological optimization has a complete theoretical foundation and a broad design space. Engineers can propose novel conceptual design schemes through topological optimization to improve structural performance while reducing manufacturing costs.
[0003] The theory of topology optimization has made great progress in the past few years, but the demand for computing resources is still a major problem. On the one hand, each iteration of topology optimization involves a finite element solution, which is the main computational bottleneck. On the other hand, Sigmund pointed out that coarse finite element meshes will lead to artificial length scale restrictions, resulting in many truss-like structures in the final optimization results. Therefore, the topology optimization process usually requires very fine mesh models to obtain high-quality structures and reduce post-processing work in the actual manufacturing process. Especially for three-dimensional (3D) problems, fine finite element meshes will further increase the calculation time for larger degrees of freedom. Summary of the invention
[0004] Based on this, it is necessary to provide a structural design optimization method, system, computer device and storage medium to address the above technical problems.
[0005] In a first aspect, an embodiment of the present invention provides a structural design optimization method, the method comprising:
[0006] Identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units;
[0007] Grouping the units in the finite element calculation model according to the unit coloring method, and allocating the calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0008] The sparse expression of the overall stiffness matrix is obtained by symbolically assembling the element stiffness matrix and the mapping relationship, and numerically assembling it according to the index array;
[0009] The linear system is solved by GPU devices, and data communication is performed between GPU devices in P2P mode. The objective function value is obtained by sensitivity calculation and summation according to thread specifications, and the structural design is optimized according to the objective function value.
[0010] Further, solving the linear system includes:
[0011] Perform data partitioning on the total stiffness matrix of the system, and divide a full-rank matrix linear system into multiple subsystems with the same columns but different rows;
[0012] Use GPU efficient linear iterative solver to solve the current subsystem according to the right-hand side load vector;
[0013] The complete displacement vector is obtained by synchronous data exchange of the GPU device.
[0014] Furthermore, the sensitivity calculation includes:
[0015] The finite element calculation model is divided into several sub-models according to the number of GPU devices and the computing power, and each device is responsible for the computing task of one sub-model;
[0016] GPU accelerated sensitivity calculation is performed in a unit-by-unit parallel manner, with one thread responsible for the calculation task of one unit;
[0017] The sensitivity value and flexible target value of each element are calculated, and finally the objective function value is obtained by summing them up through thread reduction.
[0018] Furthermore, the structural design optimization method also includes sensitivity filtering and density updating;
[0019] The sensitivity filter creates a new array to store the filtered data, and uses a GPU device to perform parallel calculations in a manner where one thread is responsible for one unit;
[0020] The density update adopts a hybrid programming method of CPU devices and GPU devices to update the unit density. The unit density update task is calculated by the GPU device, each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation; the convergence of the density update process is calculated and judged by the CPU device. In each iteration, the CPU device judges the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
[0021] On the other hand, an embodiment of the present invention further provides a structural design optimization system, including:
[0022] The model reading module is used to identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units;
[0023] A unit coloring module, used for grouping units in the finite element calculation model according to a unit coloring method, and allocating calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0024] The stiffness matrix assembly module is used to perform symbolic assembly based on the element stiffness matrix and mapping relationship, and to perform numerical assembly based on the index array to obtain the sparse expression of the overall stiffness matrix;
[0025] The target solving module is used to solve the linear system through the GPU device. The GPU devices use P2P mode for data communication. Through sensitivity calculation, the target function value is obtained by summing according to the thread specification, and the structural design is optimized according to the target function value.
[0026] Furthermore, the target solving module includes a linear system solving unit, and the linear system solving unit is used to:
[0027] Perform data partitioning on the total stiffness matrix of the system, and divide a full-rank matrix linear system into multiple subsystems with the same columns but different rows;
[0028] Use GPU efficient linear iterative solver to solve the current subsystem according to the right-hand side load vector;
[0029] The complete displacement vector is obtained by synchronous data exchange of the GPU device.
[0030] Furthermore, the target solution module further includes a sensitivity calculation unit, and the sensitivity calculation unit is used to:
[0031] The finite element calculation model is divided into several sub-models according to the number of GPU devices and the computing power, and each device is responsible for the computing task of one sub-model;
[0032] GPU accelerated sensitivity calculation is performed in a unit-by-unit parallel manner, with one thread responsible for the calculation task of one unit;
[0033] The sensitivity value and flexible target value of each element are calculated, and finally the objective function value is obtained by summing them up through thread reduction.
[0034] Furthermore, the structural design optimization system also includes a sensitivity filtering module and a density updating module;
[0035] The sensitivity filter module is used to store the filtered data by establishing a new array, and to perform parallel calculations by using a GPU device with one thread responsible for one unit;
[0036] The density update module adopts a hybrid programming method of CPU devices and GPU devices to update the unit density. The unit density update task is calculated by the GPU device. Each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation. The convergence of the density update process is calculated and judged by the CPU device. In each iteration, the CPU device judges the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
[0037] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0038] Identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units;
[0039] Grouping the units in the finite element calculation model according to the unit coloring method, and allocating the calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0040] The sparse expression of the overall stiffness matrix is obtained by symbolically assembling the element stiffness matrix and the mapping relationship, and numerically assembling it according to the index array;
[0041] The linear system is solved by GPU devices, and data communication is performed between GPU devices in P2P mode. The objective function value is obtained by sensitivity calculation and summation according to thread specifications, and the structural design is optimized according to the objective function value.
[0042] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0043] Identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units;
[0044] Grouping the units in the finite element calculation model according to the unit coloring method, and allocating the calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0045] The sparse expression of the overall stiffness matrix is obtained by symbolically assembling the element stiffness matrix and the mapping relationship, and numerically assembling it according to the index array;
[0046] The linear system is solved by GPU devices, and data communication is performed between GPU devices in P2P mode. The objective function value is obtained by sensitivity calculation and summation according to thread specifications, and the structural design is optimized according to the objective function value.
[0047] The beneficial effects of this application are: this application uses GPU devices to achieve the effect of greatly accelerating the calculation process, and can achieve a speedup ratio of more than 100 times on multi-GPU devices, greatly reducing the calculation time of the main task of finite element analysis, and improving the calculation scale and efficiency of parallel calculation of GPU devices. In addition, the entire topology optimization process realizes complete GPU device calculation, avoiding the time overhead caused by data communication between the host and the device; combined with asynchronous transmission, it realizes the maximum concealment of data communication between devices, improving the overall calculation efficiency; in addition, the topology optimization solver in this application has a low calculation cost, and can achieve high-precision and fast calculation of topology optimization of tens of millions of free-scale structures on ordinary personal computers, and is simple to use, achieving high versatility on different devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of a flow chart of a structural design optimization method in one embodiment;
[0049] Figure 2 A schematic diagram of a flow chart for solving a linear system in one embodiment;
[0050] Figure 3 A schematic diagram of a sensitivity calculation method in one embodiment;
[0051] Figure 4 A structural block diagram of a structural design optimization system in one embodiment;
[0052] Figure 5 It is a structural block diagram of a target solving module in one embodiment;
[0053] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0055] Topology optimization is a mathematical method that optimizes the material distribution in a given area according to given load conditions, constraints and performance indicators, and is also a structural optimization method. In the concept of lightweight automobiles, while ensuring the basic performance of the body structure components, redundant materials are reduced as much as possible to reduce the structural weight and improve the utilization rate of materials. This purpose coincides with the core idea of structural topology optimization. In other words, topology optimization aims to meet certain constraints and achieve the best use of materials and optimize certain performance by rationally arranging the positions of materials in a given area. Traditional automobile design is often based on engineering experience or trial and error, which takes a lot of time and effort. With the help of effective structural optimization technology, the design cycle can be greatly shortened and its lightweight design can be accurately guided.
[0056] In order to overcome the above problems, parallel computing technology can be used to solve the difficulties of large-scale computing. Parallelization can be performed by using traditional computer architectures such as multi-core processors, CPUs (central processing units) and novel multi-core architectures. However, the best choice for current computers is to use heterogeneous computing, in which the CPU works with a large number of new architectures that exploit the parallelism of applications. Compared with traditional symmetric CPUs, GPUs can provide higher peak performance, energy and cost-effectiveness. It gets rid of the problems of high hardware cost, complex use and maintenance of traditional parallel computing methods, so it quickly attracted the attention of scientific research and engineering personnel. After nearly 10 years of development, it has formed a relatively mature programming language and programming architecture. The use of multiple GPUs can further improve the computing scale and computing efficiency of GPU parallel computing. Therefore, it is of great significance to use multi-GPU parallel computing technology to improve the computational efficiency of large-scale structural topology optimization.
[0057] In one embodiment, Figure 1 As shown, a structural design optimization method is provided, comprising the following steps:
[0058] Step 101, identifying the finite element calculation model loaded into the host through the CPU device of the host, reading the nodes and units in the finite element calculation model, recording the unit to which each node belongs and saving the belonging relationship between the nodes and the units;
[0059] Step 102, grouping the units in the finite element calculation model according to the unit coloring method, and allocating the calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0060] Step 103, symbolically assembling the element stiffness matrix and the mapping relationship, and numerically assembling the index array to obtain a sparse expression of the overall stiffness matrix;
[0061] Step 104, solving the linear system through GPU devices, using P2P mode for data communication between GPU devices, calculating the sensitivity, and obtaining the objective function value according to the thread specification summation, and completing the optimization of the structural design according to the objective function value.
[0062] Specifically, this embodiment first loads the finite element calculation model data into the host memory. For the overall model, the host CPU identifies the nodes and units in the finite element calculation model data, records the unit to which each node belongs, and saves the relationship between the nodes and units; the units in the model are grouped by the unit coloring method. Units of the same "color" do not have common nodes, so they can be assembled and calculated in parallel without causing write conflicts. Then, according to the number of GPUs and their computing power, appropriate computing tasks are assigned to each device to minimize waiting between devices; according to the efficient stiffness matrix assembly algorithm proposed in this embodiment, it is divided into two parts: symbolic assembly and numerical assembly. First, symbolic assembly is performed by the unit stiffness matrix and mapping relationship. Because the non-zero pattern of the total stiffness matrix in the entire topology optimization is the same, this part is only performed in the first iteration; then, numerical assembly is performed according to the index array to obtain a sparse expression of the overall stiffness matrix. In this embodiment, the row compression (CSR) format is used for storage.
[0063] By using GPU devices, the calculation process is greatly accelerated. On multi-GPU devices, a speedup ratio of more than 100 times can be achieved, which greatly reduces the calculation time of the main task of finite element analysis and improves the calculation scale and efficiency of parallel calculation of GPU devices. In addition, the entire topology optimization process realizes complete GPU device calculation, avoiding the time overhead caused by data communication between the host and the device; combined with asynchronous transmission, it realizes the maximum concealment of data communication between devices and improves the overall calculation efficiency; in addition, the topology optimization solver in this application has a low calculation cost, and can realize high-precision and fast calculation of topology optimization of tens of millions of free-scale structures on ordinary personal computers, and it is simple to use and has high versatility on different devices.
[0064] In one embodiment, Figure 2 As shown in Figure 2, the process of solving a linear system includes:
[0065] Step 201, partitioning the total stiffness matrix of the system, dividing a full-rank matrix linear system into multiple subsystems with the same columns but different rows;
[0066] Step 202, using a GPU efficient linear iterative solver to solve the current subsystem according to the right-hand load vector;
[0067] Step 203: The GPU device synchronizes data exchange to obtain a complete displacement vector.
[0068] Specifically, the system's total stiffness matrix is first partitioned, and a full-rank matrix linear system is divided into multiple subsystems with the same columns but different rows, each of which is calculated by a GPU device; then, the self-developed GPU high-efficiency linear iterative solver is used to quickly solve the current system according to the right-hand load vector, during which data communication is carried out between devices in a P2P manner; finally, the complete displacement vector is obtained by synchronous data exchange between devices.
[0069] In one embodiment, Figure 3 As shown, the sensitivity calculation method includes:
[0070] Step 301, dividing the finite element calculation model into a plurality of sub-models according to the number of GPU devices and the computing power, and each device is responsible for the calculation task of a sub-model;
[0071] Step 302, performing GPU accelerated sensitivity calculation in a unit-expanding parallel manner, with one thread being responsible for the calculation task of one unit;
[0072] Step 303, calculate the sensitivity value and flexible target value of each element, and finally obtain the objective function value by summing them up through thread specification.
[0073] Specifically, in this embodiment, the sensitivity calculation first divides the model into several sub-models according to the number of GPUs and computing power, and each device is responsible for the computing task of a sub-model; secondly, the GPU accelerated sensitivity calculation adopts a parallel method of unit expansion, that is, one thread is responsible for the computing task of one unit; the index array is stored in the register, and the public data is stored in the constant memory. Then the sensitivity value and flexible target value of each element are calculated, and finally the objective function value is obtained by summing the thread specification.
[0074] In one embodiment, the structural design optimization also includes sensitivity filtering and density updating; the sensitivity filtering is performed by establishing a new array to store the filtered data, and is calculated in parallel by a GPU device using one thread responsible for one unit; the density update is performed by a mixed programming method of a CPU device and a GPU device to update the unit density, the density update task of the unit is calculated by the GPU device, each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation; the convergence of the density update process is calculated and judged by the CPU device, and in each iteration, the CPU device judges the convergence of the density update process, and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
[0075] Specifically, topology optimization sometimes leads to numerical instability such as checkerboard phenomenon, and filtering sensitivity is currently the most commonly used method to avoid checkerboard phenomenon. The sensitivity filtering GPU parallel computing also adopts the method of one thread being responsible for one unit, but it is necessary to establish a new array to store the filtered data, because the calculation process will update the unit sensitivity, and the calculation progress of each thread is not exactly the same. Therefore, if the original array is directly updated, some erroneous results will be generated due to the asynchronous calculation between threads. This embodiment adopts the method of CPU and GPU hybrid programming to update the unit density, in which the density update task of the unit is calculated by the GPU, and the TFE method is used. Each thread calculates the new density of a unit, and then reduces and sums to obtain the volume fraction. The convergence of the density update process is determined by the CPU calculation. In each iteration, the CPU determines the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
[0076] It should be understood that, although the various steps in the above-mentioned flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0077] In one embodiment, Figure 4 As shown, a structural design optimization system is provided, comprising:
[0078] The model reading module 401 is used to identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units;
[0079] A unit coloring module 402 is used to group the units in the finite element calculation model according to the unit coloring method, and allocate calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0080] The stiffness matrix assembly module 403 is used to perform symbolic assembly based on the unit stiffness matrix and the mapping relationship, and perform numerical assembly based on the index array to obtain a sparse expression of the overall stiffness matrix;
[0081] The target solving module 404 is used to solve the linear system through the GPU device. The GPU devices use P2P mode to communicate data. Through sensitivity calculation, the target function value is obtained according to the thread specification summation, and the structural design is optimized according to the target function value.
[0082] In one embodiment, Figure 5 As shown, the target solving module 404 includes a linear system solving unit 4041, and the linear system solving unit is used to:
[0083] Perform data partitioning on the total stiffness matrix of the system, and divide a full-rank matrix linear system into multiple subsystems with the same columns but different rows;
[0084] Use GPU efficient linear iterative solver to solve the current subsystem according to the right-hand side load vector;
[0085] The complete displacement vector is obtained by synchronous data exchange of the GPU device.
[0086] In one embodiment, Figure 5 As shown, the target solution module 404 further includes a sensitivity calculation unit 4042, and the sensitivity calculation unit 4042 is used to:
[0087] The finite element calculation model is divided into several sub-models according to the number of GPU devices and the computing power, and each device is responsible for the computing task of one sub-model;
[0088] GPU accelerated sensitivity calculation is performed in a unit-by-unit parallel manner, with one thread responsible for the calculation task of one unit;
[0089] The sensitivity value and flexible target value of each element are calculated, and finally the objective function value is obtained by summing them up through thread reduction.
[0090] In one embodiment, the structural design optimization system further includes a sensitivity filtering module and a density updating module;
[0091] The sensitivity filter module is used to store the filtered data by establishing a new array, and to perform parallel calculations by using a GPU device with one thread responsible for one unit;
[0092] The density update module adopts a hybrid programming method of CPU devices and GPU devices to update the unit density. The unit density update task is calculated by the GPU device. Each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation. The convergence of the density update process is calculated and judged by the CPU device. In each iteration, the CPU device judges the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
[0093] For the specific definition of the structural design optimization system, please refer to the definition of the structural design optimization method above, which will not be repeated here. Each module in the above structural design optimization system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0094] Figure 6 FIG. 2 shows an internal structure diagram of a computer device in one embodiment. Figure 6 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the permission anomaly detection method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the permission anomaly detection method. The display screen of the computer device may be a liquid crystal display or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0095] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0096] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0097] Identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units;
[0098] Grouping the units in the finite element calculation model according to the unit coloring method, and allocating the calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0099] The sparse expression of the overall stiffness matrix is obtained by symbolically assembling the element stiffness matrix and the mapping relationship, and numerically assembling it according to the index array;
[0100] The linear system is solved by GPU devices, and data communication is performed between GPU devices in P2P mode. The objective function value is obtained by sensitivity calculation and summation according to thread specifications, and the structural design is optimized according to the objective function value.
[0101] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0102] Perform data partitioning on the total stiffness matrix of the system, and divide a full-rank matrix linear system into multiple subsystems with the same columns but different rows;
[0103] Use GPU efficient linear iterative solver to solve the current subsystem according to the right-hand side load vector;
[0104] The complete displacement vector is obtained by synchronous data exchange of the GPU device.
[0105] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0106] The finite element calculation model is divided into several sub-models according to the number of GPU devices and the computing power, and each device is responsible for the computing task of one sub-model;
[0107] GPU accelerated sensitivity calculation is performed in a unit-by-unit parallel manner, with one thread responsible for the calculation task of one unit;
[0108] The sensitivity value and flexible target value of each element are calculated, and finally the objective function value is obtained by summing them up through thread reduction.
[0109] The sensitivity filter creates a new array to store the filtered data, and uses a GPU device to perform parallel calculations in a manner where one thread is responsible for one unit;
[0110] The density update adopts a hybrid programming method of CPU devices and GPU devices to update the unit density. The unit density update task is calculated by the GPU device, each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation; the convergence of the density update process is calculated and judged by the CPU device. In each iteration, the CPU device judges the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
[0111] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0112] Identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units;
[0113] Grouping the units in the finite element calculation model according to the unit coloring method, and allocating the calculation tasks according to the number of GPU devices combined with the calculation capacity;
[0114] The sparse expression of the overall stiffness matrix is obtained by symbolically assembling the element stiffness matrix and the mapping relationship, and numerically assembling it according to the index array;
[0115] The linear system is solved by GPU devices, and data communication is performed between GPU devices in P2P mode. The objective function value is obtained by sensitivity calculation and summation according to thread specifications, and the structural design is optimized according to the objective function value.
[0116] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0117] Perform data partitioning on the total stiffness matrix of the system, and divide a full-rank matrix linear system into multiple subsystems with the same columns but different rows;
[0118] Use GPU efficient linear iterative solver to solve the current subsystem according to the right-hand side load vector;
[0119] The complete displacement vector is obtained by synchronous data exchange of the GPU device.
[0120] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0121] The finite element calculation model is divided into several sub-models according to the number of GPU devices and the computing power, and each device is responsible for the computing task of one sub-model;
[0122] GPU accelerated sensitivity calculation is performed in a unit-by-unit parallel manner, with one thread responsible for the calculation task of one unit;
[0123] The sensitivity value and flexible target value of each element are calculated, and finally the objective function value is obtained by summing them up through thread reduction.
[0124] The sensitivity filter creates a new array to store the filtered data, and uses a GPU device to perform parallel calculations in a manner where one thread is responsible for one unit;
[0125] The density update adopts a hybrid programming method of CPU devices and GPU devices to update the unit density. The unit density update task is calculated by the GPU device, each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation; the convergence of the density update process is calculated and judged by the CPU device. In each iteration, the CPU device judges the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
[0126] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0128] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A structural design optimization method, characterized in that: The following steps are involved: Identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units; Grouping the units in the finite element calculation model according to the unit coloring method, and allocating the calculation tasks according to the number of GPU devices combined with the calculation capacity; The sparse expression of the overall stiffness matrix is obtained by symbolically assembling the element stiffness matrix and the mapping relationship, and numerically assembling it according to the index array; The linear system is solved by GPU devices, and data communication is performed between GPU devices in a P2P manner. The objective function value is obtained by sensitivity calculation and summation according to thread specifications, and the structural design is optimized according to the objective function value. The linear system solving method includes: partitioning the total stiffness matrix of the system into data, dividing a full-rank matrix linear system into multiple subsystems with the same column but different rows; using a GPU efficient linear iterative solver to solve the current subsystem according to the right-hand load vector; and obtaining a complete displacement vector by synchronous data exchange of the GPU device; The sensitivity calculation includes: dividing the finite element calculation model into several sub-models according to the number of GPU devices and computing power, with each device being responsible for the computing task of one sub-model; performing GPU accelerated sensitivity calculation in a parallel manner by unit expansion, with one thread being responsible for the computing task of one unit; calculating the sensitivity value and flexible target value of each element, and finally obtaining the objective function value by summing up through thread specification.
2. The structural design optimization method according to claim 1, characterized in that: Also includes sensitivity filtering and density updating; The sensitivity filter creates a new array to store the filtered data, and uses a GPU device to perform parallel calculations in a manner where one thread is responsible for one unit; The density update adopts a hybrid programming method of CPU devices and GPU devices to update the unit density. The unit density update task is calculated by the GPU device, each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation; the convergence of the density update process is calculated and judged by the CPU device. In each iteration, the CPU device judges the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
3. A structural design optimization system, characterized in that: include: The model reading module is used to identify the finite element calculation model loaded into the host through the CPU device of the host, read the nodes and units in the finite element calculation model, record the unit to which each node belongs and save the belonging relationship between the nodes and the units; A unit coloring module, used for grouping units in the finite element calculation model according to a unit coloring method, and allocating calculation tasks according to the number of GPU devices combined with the calculation capacity; The stiffness matrix assembly module is used to perform symbolic assembly based on the element stiffness matrix and mapping relationship, and to perform numerical assembly based on the index array to obtain the sparse expression of the overall stiffness matrix; The target solving module is used to solve the linear system through the GPU device. The GPU devices use P2P mode to communicate data. The target function value is obtained by sensitivity calculation and summation according to the thread specification. The structural design is optimized according to the target function value. The target solution module includes a linear system solution unit, which is used to: partition the total stiffness matrix of the system, and divide a full-rank matrix linear system into multiple subsystems with the same column but different rows; use a GPU efficient linear iterative solver to solve the current subsystem according to the right-hand load vector; and obtain a complete displacement vector by synchronous data exchange of the GPU device; The target solution module also includes a sensitivity calculation unit, which is used to: divide the finite element calculation model into several sub-models according to the number of GPU devices and the computing power, and each device is responsible for the calculation task of one sub-model; perform GPU accelerated sensitivity calculation in a parallel manner of unit expansion, and use one thread to be responsible for the calculation task of one unit; The sensitivity value and flexible target value of each element are calculated, and finally the objective function value is obtained by summing them up through thread reduction.
4. The structural design optimization system according to claim 3, characterized in that: It also includes a sensitivity filtering module and a density updating module; The sensitivity filter module is used to establish a new array to store the filtered data, and to perform parallel calculations using a GPU device with one thread responsible for one unit; The density update module adopts a hybrid programming method of CPU devices and GPU devices to update the unit density. The unit density update task is calculated by the GPU device. Each thread calculates a new density of a unit, and the volume fraction is obtained by reduction and summation. The convergence of the density update process is calculated and judged by the CPU device. In each iteration, the CPU device judges the convergence of the density update process and changes the lower threshold and the upper threshold according to the optimal criterion update scheme.
5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
