Finite element simulation method based on multi-level neural network

Through the finite element simulation method based on multi-level neural network, the high iteration cost problem of Newton's method in high-resolution object processing is solved, efficient fabric simulation is achieved, and real-time interactive feedback needs are met.

CN118965891AActive Publication Date: 2024-11-15ZHEJIANG UNIV

Patent Information

Application Number
CN202411040295.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-15
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

When the prior art realizes real-time simulation of deformable objects, the high iteration cost of Newton's method limits the processing of high-resolution objects. Traditional methods are difficult to meet the needs of real-time interactive feedback, especially in high-resolution and rigid object simulations. good.

Method used

Using a finite element simulation method based on multi-level neural networks, the dynamic energy expression is constructed, and the solution is solved using Newton's iterative method and line search method, combined with multi-level neural network training and graph convolution network processing, a multi-level thickness grid structure is constructed. Solve nonlinear equations to accelerate.

Benefits of technology

The speed of solving nonlinear equations is improved, so that the simulation scenarios are real-time, can handle high-resolution objects and reduce memory requirements, achieving more efficient fabric simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965891A_ABST
    Figure CN118965891A_ABST
Patent Text Reader

Abstract

The invention discloses a finite element simulation method based on a multi-level neural network, and the method comprises the specific steps: modeling to-be-predicted cloth into a cloth hyperelastic body model, dividing the cloth hyperelastic body model into a plurality of units, constructing a kinetic energy expression for each unit, and carrying out the solving, constructing a training data set of the multi-level neural network; constructing a multi-level coarse and fine grid structure by a farthest point sampling method, and constructing an interpolation matrix for each layer of coarse grid; the multi-level neural network is trained on the training data set, prediction at multiple moments is completed through the trained multi-level neural network, the multi-level neural network outputs a displacement matrix of a fine grid at each moment until the preset maximum inference frequency is reached, and the prediction is completed. And taking the displacement matrix of the fine grid at all moments output by the multi-level neural network as a position prediction result. According to the method, efficient solving of the nonlinear equation for finite element simulation is achieved, and the efficiency of finite element simulation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer graphics cloth simulation, and in particular relates to a finite element simulation method based on a multi-layer neural network. Background Art

[0002] Simulation of deformable objects plays an important role in various graphics applications to generate rich and vivid virtual content. Most of these applications, such as games, virtual reality, and fashion design, require not only visually pleasing deformation simulation, but more importantly, real-time interactive feedback. In real life, fashion designers often need to create a draft on a sketch, then have it produced by a factory, and then let the model wear it to feel the effect of the clothing on the body. This is time-consuming and labor-intensive, but through cloth simulation, we can put clothes on the virtual model on the computer, so that users can feel the effect of the designed clothing on the body on the computer, improving productivity. In the case of certain requirements for the iteration frame rate, to achieve stable large time step simulation of deformable objects, the implicit time integration scheme is generally considered to be the standard method. Newton's method is a classic numerical method for solving implicit integration problems. However, Newton iteration is costly because it requires constructing the Hessian matrix of the system, correcting its positive definiteness, and solving the corresponding linear system in each Newton iteration. A clever quasi-Newton descent direction combined with a line search strategy can help speed up the Newton method, but it is still not enough to meet real-time requirements. Therefore, the Newton method can only handle low-resolution objects under real-time conditions.

[0003] For decades, researchers have been working on fast numerical methods that allow us to handle larger and larger interactable meshes. These methods usually start from Newton methods and adopt different strategies: they either use quasi-Newton methods in the full space to approximate Newtonian directions, such as projected dynamics and position-based dynamics, or they simulate only a subset of degrees of freedom in subspaces, which can be created by domain decomposition or skinned space. However, the performance of projected dynamics relies on the pre-factorization of the direct solver, which is limited by high memory requirements for very high-resolution meshes. The convergence of position-based dynamics is not satisfactory because it uses Jacobi iterations or Gauss-Seidel iterations, which are not ideal for simulating high-resolution and rigid objects. Subspace methods perform well in the case of high resolution, but they cannot handle deformations that are not encoded in their subspaces. Multigrid methods are very attractive when dealing with large linear systems because they scale well with the size of the system matrix and usually use less memory overhead than the original system matrix. A well-designed multigrid method is able to simulate high-resolution objects in its full space while making very good use of its multiresolution hierarchy.

[0004] Another interpretation of projected dynamics is to view it as a special case of the alternating direction method of multipliers (ADMM), providing a way to support more general materials. The key advantage of projected dynamics and its extensions is the pre-factorization of the system matrix, which makes the linear solution at runtime only require forward / backward substitution. However, such a substitution step is not friendly to parallel computing. In order to maximize the computing power of GPUs, iterative solvers such as Jacobi or Gauss-Seidel methods are more popular approaches. The researchers accelerated the iterative solver of projected dynamics using the Chebyshev method and improved the parallelism of the Gauss-Seidel iteration through a novel coloring technique, making the algorithm more GPU-friendly. Summary of the invention

[0005] The purpose of the present invention is to solve the problems existing in the prior art and provide a finite element simulation method based on a multi-layer neural network.

[0006] In order to achieve the above-mentioned invention object, the present invention specifically adopts the following technical solutions:

[0007] A finite element simulation method based on a multi-layer neural network comprises the following steps:

[0008] S1. In cloth simulation, the cloth to be predicted is modeled as a cloth hyperelastic body model, and the cloth hyperelastic body model is divided into a number of units using a cloth finite element method. A dynamic energy expression is constructed for each unit, and the energy expression includes three parts: a kinetic energy term, a potential energy term, and an additional external force work term;

[0009] S2. Using Newton iteration method and line search method to solve the solution of the energy expression when the energy expression reaches the minimum value, taking the solution of the energy expression as the position of each point in the unit at the next moment and constructing a training data set of a multi-layer neural network;

[0010] S3. A fine grid is obtained in advance, and a multi-level coarse-fine grid structure is constructed by the farthest point sampling method, wherein the multi-level coarse-fine grid structure is composed of the fine grid and multiple layers of coarse grids, and each layer of coarse grid corresponds to a constructed interpolation matrix;

[0011] S4. A multi-layer neural network is trained on the training data set, and the trained multi-layer neural network completes the prediction at multiple moments, and the multi-layer neural network outputs a displacement matrix of a fine grid at each moment until a preset maximum number of inferences is reached, and the displacement matrices of the fine grids at all moments output by the multi-layer neural network are used as the position prediction results of the cloth to be predicted;

[0012] In the prediction process of the multi-layer neural network at each moment, the displacement matrix of the fine grid at the previous moment is multiplied with the interpolation matrix of each layer obtained by S3 in turn to obtain the displacement matrix of the coarse grid of each layer, and the displacement matrix of the fine grid at the previous moment and the displacement matrix of each coarse grid are input into the trained multi-layer neural network. Each displacement matrix of the coarse grid or fine grid is processed by a graph convolution network to obtain the feature matrix of each level, and the feature matrix of each coarse grid is multiplied with the corresponding displacement matrix to make the feature matrix of each coarse grid have the same dimension as the feature matrix of the fine grid, so as to obtain the new feature matrix of each coarse grid, and the new feature matrix of each coarse grid is spliced ​​with the feature matrix of the fine grid to obtain the spliced ​​feature matrix, which is input into the multi-layer perceptron to output the displacement matrix of the fine grid at the next moment.

[0013] Based on the above scheme, each step can be implemented in the following preferred specific manner.

[0014] Preferably, in step S1, the energy expression g(x) is in the following form:

[0015]

[0016] E(x)=E gravity (x)+E elastic (x)

[0017] E gravity (x) = mg′h′

[0018] in, represents the kinetic energy term; E(x) represents the potential energy term, including the gravitational potential energy term E gravity (x) and the elastic potential energy term E elastic (x); represents the additional external force work term; x is the displacement vector, h is the time step, and M is the mass matrix; represents the additional external force; T represents the transposition; m represents the mass of each unit; g′ represents the acceleration of gravity; h′ represents the height of each unit; y = x [0] +hv [0] is the current speed v [0] and the current displacement x [0] The calculated position at the next moment.

[0019] Preferably, in step S1, the elastic potential energy term adopts the stvk cloth hyperelastic body model energy model, and the calculation method is as follows:

[0020]

[0021] E=F T FI

[0022]

[0023] Among them, F represents the deformation gradient; X represents the position of each unit at the initial moment; E represents the Green stretch coefficient; I represents the unit matrix; ψ(E) represents the energy density function; μ and λ represent the two coefficients of Young's modulus respectively; : represents the Frobenius inner product; tr represents the trace of the matrix.

[0024] Preferably, the specific process of step S3 is: pre-acquire a fine grid and pre-specify the number of layers of the multi-level neural network, construct a first set from all points of the fine grid, select k1 points from the first set by the farthest geodesic distance method to form a second set, and form a coarse grid from all points of the second set. After the second set is generated by the first set, an interpolation matrix from a fine grid to a coarse grid is obtained by an interpolation matrix generation method; when the total number of sets is less than the number of layers of the multi-level neural network, the farthest geodesic distance method is used to continuously select new points from the previous set to form a new set, and a new coarse grid is generated from all points in the new set, and then an interpolation matrix from the fine grid to each layer of coarse grid is obtained by an interpolation matrix generation method, until the total number of sets is equal to the number of layers of the multi-level neural network, and multi-layer coarse grids and interpolation matrices corresponding to each layer of coarse grids are obtained.

[0025] Preferably, in step S3, the specific process of selecting points from the first set to form the second set by the farthest geodesic distance method is as follows: first, randomly select a point from the first set as an initial point for distance calculation, and add the initial point for distance calculation to the second set to initialize the second set; continuously iterate and update the second set, and in each iteration, use each remaining point in the first set except all points included in the second set as a reference point, and then use the Dijkstra algorithm to calculate the shortest geodesic distance from each reference point to each point in the second set in turn, and add the reference point with the largest shortest geodesic distance to the second set for updating the second set, and continuously iterate until the number of points included in the second set meets the requirement.

[0026] Preferably, in step S3, the specific process of obtaining an interpolation matrix from a fine grid to a coarse grid by the interpolation matrix generation method is as follows: when there are k0 points in the first set and there are k points in the set corresponding to a coarse grid i When there are points, an interpolation matrix with all elements being 0 is pre-constructed, and the size of the interpolation matrix is ​​k i *k0; if the i′th point in the first set has the smallest distance from the j′th point in the set corresponding to a coarse grid, then the element value at the i′th position in the j′th row of the interpolation matrix is ​​set to 1, until all points in the first set are processed to obtain an interpolation matrix from a fine grid to a coarse grid.

[0027] Preferably, in step S3, the loss function used in training the multi-layer neural network is mean square error loss.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] The present invention discloses a finite element simulation method based on a multi-layer neural network, and constructs a multi-layer neural network to accelerate the solution of nonlinear equations in cloth simulation. High-frequency information and low-frequency information are captured through a multi-layer grid structure, and each layer is processed using a graph convolutional network to accelerate the solution of the energy equation. Compared with the original traditional Newton method, the method of the present invention improves the speed of solving nonlinear equations under specific simulation problems, thereby making the simulation scene have superior properties such as real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the steps of the present invention;

[0031] Figure 2 The result diagram of applying the method of the present invention to finite element cloth simulation;

[0032] Figure 3 Schematic diagram of constructing a multi-level coarse and fine grid structure for the farthest point sampling method;

[0033] Figure 4 A schematic diagram of a multi-layer neural network of the present invention;

[0034] Figure 5 The present invention is a flow chart of solving the minimum value of the energy expression by using the Newton iteration method and the line search method. DETAILED DESCRIPTION

[0035] In order to make the above-mentioned purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation mode of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present invention can be combined accordingly without conflicting with each other.

[0036] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for the purpose of distinguishing descriptions, and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0037] The method of the present invention constructs a dynamic energy expression based on the STVK cloth hyperelastic body model energy model, and uses the classic Newton iteration method with the line search method to accurately solve the nonlinear equations. The solution of the energy expression when the energy expression reaches the minimum value is used as a training data set and recorded locally. Then, a multi-level neural network is constructed with a graph convolutional network as an encoder and a multi-layer perceptron as a decoder. The initial displacement before solving is input into the multi-level neural network, and the solved displacement is output. The difference between the displacement in the training data set and the displacement output by the multi-level neural network is used as a loss function to train the multi-level neural network. After the training is completed, the multi-level neural network can be used to efficiently solve the cloth hyperelastic body model equation.

[0038] like Figure 1 As shown, in a preferred implementation of the present invention, the above-mentioned finite element simulation method based on a multi-layer neural network includes the following steps S1 to S4. The specific implementation process is described in detail below.

[0039] S1. In cloth simulation, the cloth to be predicted is modeled as a cloth hyperelastic body model, and the cloth hyperelastic body model is divided into a number of units using the cloth finite element method. A dynamic energy expression is constructed for each unit, and the energy expression includes three parts: kinetic energy term, potential energy term and additional external force work term.

[0040] It should be noted that, in the present invention, Figure 2 As shown, Figure 2 The application of the present invention in cloth simulation is demonstrated. It can be seen that after the cloth to be predicted is modeled as a cloth hyperelastic body model, it is divided into many tiny units. Figure 2 In the figure, it is represented as a triangle. Through the expansion and contraction range of each triangle and the angle between adjacent triangles, the force applied to the vertices of the triangle can be calculated by the cloth finite element method, and the overall movement of the cloth can be displayed through the movement of the vertices.

[0041] In the present invention, the potential energy term is divided into the gravitational potential energy term E gravity (x) and the elastic potential energy term E elastic (x), where the elastic potential energy term is calculated using the stvk cloth finite element model. This is a scalar that measures the deformation of an object. For an operation without internal relative motion, such as translation and rotation, its elastic potential energy is 0.

[0042] The energy expression g(x) is in the form of:

[0043]

[0044] E(x)=E gravity (x)+E elastic(x)

[0045] E gravity (x) = mg′h′

[0046] Among them, the first represents the kinetic energy term; the second term E(x) represents the potential energy term, including the gravitational potential energy term E gravity (x) and the elastic potential energy term E elastic (x); Item 3 represents the additional external force work term; x is the displacement vector, h is the time step, and M is the mass matrix; represents additional external force; T represents transposition; y = x [0] +hv [0] is the current speed v [0] and the current displacement x [0] The calculated position at the next moment, which represents the change in displacement without external force; m represents the mass of each unit; g′ represents the acceleration of gravity; h′ represents the height of each unit.

[0047] In the potential energy term, the gravitational potential energy term E gravity (x) is related to the coordinate representing the direction of displacement height. The elastic potential energy term E elastic (x) uses the STVK cloth hyperelastic body model energy model, and the calculation method is as follows:

[0048]

[0049] E=F T FI

[0050]

[0051] Among them, F represents the deformation gradient, which is used to measure the deformation of a unit compared to its original shape; X represents the position of each unit at the initial moment; E represents the Green Strain coefficient, which eliminates the rotation-related quantity in the deformation gradient; I represents the unit matrix; ψ(E) represents the energy density function, through which the elastic potential energy at the current moment can be quickly calculated; μ and λ represent the two coefficients of Young's modulus respectively; : represents the Frobenius inner product; tr represents the trace of the matrix.

[0052] S2. Use Newton iteration method and line search method to solve the solution of the energy expression when the energy expression g(x) reaches the minimum value, use the solution of the energy expression as the position of each point in the unit at the next moment and construct a training data set of a multi-layer neural network.

[0053] The position of each point in the unit at the next moment is as follows:

[0054] x n+1 =argmin x g(x)

[0055] It should be noted that in the present invention, the solution of the energy expression g(x) can be obtained by finding the minimum value of the energy expression. Since g(x) is a nonlinear function, it is almost impossible to obtain an analytical solution, and an iterative method is generally used to find a numerical solution. In the present invention, the Newton iteration method is used in combination with the line search method to solve the minimum value of the energy expression g(x), such as Figure 5 As shown. Specifically, the nonlinear energy expression is converted into a linear energy expression for processing by the Newton iteration method. Because the Newton iteration method is most efficient when it is very close to the final solution, it is particularly important to select the position of the initial point. In the method of the present invention, when solving the minimum value of the linear energy expression, the position of the point at the previous moment is selected as the initial solution, and the number of iterations is reduced to accelerate convergence. In the case of strong nonlinearity, using the Newton iteration method once may not cause the objective function to decrease, but may increase. Therefore, the present invention uses a line search method to ensure that the result obtained by the Newton iteration method can reduce the energy expression g(x), especially in the case of strong nonlinearity. Finally, the position (grid position) of each point in each solved unit is made into a data set and saved locally.

[0056] The specific process of solving the minimum value of the energy expression g(x) is as follows: Figure 5 As shown:

[0057] 1) Initialize the position x of the cell midpoint (0) , which can generally be initialized to x [0] or x [0] +hv [0] .

[0058] 2) At the kth iteration, the position of the unit midpoint is used as the independent variable, and the first and second derivatives of the energy expression g(x) are calculated:

[0059]

[0060] in, Indicates the gradient; x (k) represents the position of the unit midpoint at the kth iteration; g(x (k) ) indicates that the independent variable is x (k) The energy expression of f(x (k) ) represents the derivative of the potential energy term; Indicates partial derivative; H(x (k) ) indicates that the independent variable is x (k) The Hessian matrix of the potential energy term.

[0061] 3) Solve the linear energy expression:

[0062]

[0063] x (k+1) =x (k) +αΔx

[0064] Where Δx represents the offset of the linear solution of the energy expression; α represents the parameter of the line search method, and the size of α requires the reverse line search method to ensure the decrease of the energy expression; x (k+1) The position of the unit midpoint at the k+1th iteration;

[0065] 4) After solving the minimum value of the energy expression g(x), the solution of the energy expression is saved as a training data set for the multi-layer neural network.

[0066] S3. A fine grid is obtained in advance, and a multi-level coarse-fine grid structure is constructed by the farthest point sampling method. The multi-level coarse-fine grid structure is composed of the fine grid and multiple layers of coarse grids, and each layer of coarse grid corresponds to a constructed interpolation matrix.

[0067] It should be noted that in the present invention, the farthest point sampling method is used. This method is a special case of the k-means algorithm. It uses an iterative algorithm to construct a mapping relationship from fine grid to coarse grid, which plays an important role in the construction of neural networks. Figure 3 As shown, a fine grid is obtained in advance and the number of layers of the multi-layer neural network is pre-specified. The first set Ω0 is constructed by all points (k0 points) of the fine grid. The farthest geodesic distance method is used to select k1 points from the first set Ω0 to form the second set Ω1. The second set Ω1 only contains a part of the points on the fine grid. A coarse grid is constructed by all points of the second set Ω1. After the second set Ω1 is generated by the first set Ω0, an interpolation matrix from a fine grid to a coarse grid is obtained by an interpolation matrix generation method. When the total number of sets is less than the number of layers of the multi-layer neural network, the farthest geodesic distance method is used to continuously select new points from the previous set to form a new set, and a new coarse grid is generated by all points in the new set. Then, the interpolation matrix from the fine grid to each layer of coarse grid is obtained by an interpolation matrix generation method until the total number of sets is equal to the number of layers of the multi-layer neural network. In this way, a mapping relationship from a fine grid to a coarse grid of the next layer is constructed, and a multi-layer coarse grid and an interpolation matrix corresponding to each layer of coarse grid are obtained.

[0068] In step S3 of this embodiment, the specific process of selecting points from the first set to form the second set by the farthest geodesic distance method is as follows:

[0069] First, a point is randomly selected from the first set Ω0 as the initial point for distance calculation, and the initial point for distance calculation is added to the second set Ω1 to initialize the second set Ω1; the second set is continuously updated iteratively, and in each iteration, each remaining point in the first set Ω0 except all the points included in the second set Ω1 is used as a reference point, and then the Dijkstra algorithm is used to calculate the shortest geodesic distance from each reference point to each point in the second set Ω1 in turn, and the reference point with the largest shortest geodesic distance is added to the second set Ω1 (then the point with the largest distance is selected in Ω0\Ω1 and added to Ω1) to update the second set, and the iteration is repeated until the number of points contained in the second set meets the requirement.

[0070] In step S3 of this embodiment, the specific process of obtaining an interpolation matrix from a fine grid to a coarse grid by the interpolation matrix generation method is as follows: when there are k0 points in the first set and there are k points in the set corresponding to a coarse grid i When there are points, an interpolation matrix with all elements being 0 is pre-constructed, and the size of the interpolation matrix is ​​k i *k0; if the i′th point in the first set has the smallest distance from the j′th point in the set corresponding to a coarse grid, then the element value at the i′th position in the j′th row of the interpolation matrix is ​​set to 1, until all points in the first set are processed to obtain an interpolation matrix from a fine grid to a coarse grid.

[0071] Taking the first set Ω0 and the second set Ω1 as examples, when there are k0 points in the first set Ω0 and k1 points in the second set Ω1, an interpolation matrix with all elements being 0 is pre-constructed, and the size of the interpolation matrix is ​​k1*k0; for all points in the first set Ω0, if the i′th point in the first set Ω0 has the smallest distance to the j′th point in the second set Ω1, the value of the element at the i′th position in the j′th row of the interpolation matrix is ​​set to 1. The same is true for the remaining sets corresponding to the coarse grids, and their distances to each point in the first set Ω0 are calculated respectively and the calculation is performed according to the above process.

[0072] Furthermore, a simple interpolation matrix Mc is shown below. It represents that the 0th, 1st, and 2nd points in the first set Ω0 are interpolated to the 0th point in the second set Ω1, the 3rd and 4th points in the first set Ω0 are interpolated to the 1st point in the second set Ω1, and the 5th, 6th, and 7th points in the first set Ω0 are interpolated to the 2nd point in the second set Ω1.

[0073]

[0074] S4. A multi-layer neural network is trained on the training data set, and the trained multi-layer neural network completes the prediction at multiple moments, and the multi-layer neural network outputs a displacement matrix of a fine grid at each moment until a preset maximum number of inferences is reached, and the displacement matrices of the fine grids at all moments output by the multi-layer neural network are used as the position prediction results of the cloth to be predicted.

[0075] In the prediction process of the multi-layer neural network at each moment, the displacement matrix of the fine grid at the previous moment is multiplied with the interpolation matrix of each layer obtained by S3 in turn to obtain the displacement matrix of the coarse grid of each layer, and the displacement matrix of the fine grid at the previous moment and the displacement matrix of each coarse grid are input into the trained multi-layer neural network. Each displacement matrix of the coarse grid or fine grid is processed by a graph convolution network to obtain the feature matrix of each level, and the feature matrix of each coarse grid is multiplied with the corresponding displacement matrix to make the feature matrix of each coarse grid have the same dimension as the feature matrix of the fine grid, so as to obtain the new feature matrix of each coarse grid, and the new feature matrix of each coarse grid is spliced ​​with the feature matrix of the fine grid to obtain the spliced ​​feature matrix, which is input into the multi-layer perceptron to output the displacement matrix of the fine grid at the next moment.

[0076] It should be noted that, in the present invention, Figure 4 As shown in the figure, a multi-layer neural network composed of an encoder and a decoder is constructed. In the encoder part, a graph convolutional network is used on the coarse and fine grids to aggregate the edge information of each input point to obtain the feature matrix of each layer. Then, the feature matrix on the coarse grid is mapped to the fine grid through the interpolation matrix, and the feature matrix of each layer of the coarse grid is spliced ​​with the feature matrix of the fine grid. Then, the decoder is used to restore the feature matrix calculated by the encoder decoder into the solution of the nonlinear equation (i.e., the displacement matrix of the fine grid). Specifically, the decoder is used to decode the spliced ​​feature matrix to obtain the displacement matrix of the fine grid at the next moment. In addition, in the prediction process of the first moment, the multi-layer neural network needs to obtain a displacement matrix of a fine grid in advance, and then use it to generate the displacement matrix of the fine grid at the next moment.

[0077] Furthermore, the processing process of the lth layer in the graph convolutional network is:

[0078]

[0079] Among them, X (l+1) and X (l) are the feature matrices of the l+1th layer and the lth layer respectively; σ represents the activation function; is the adjacency matrix of the lth layer; W represents the degree matrix of the adjacency matrix of the lth layer; (l) are the parameters used to train multi-layer neural networks.

[0080] It should be noted that in the present invention, when training a multi-level neural network, the multi-level neural network is trained on the aforementioned training data set. In the training data set of the multi-level neural network, each training sample is a solution of the energy expression, corresponding to the displacement matrix of the fine grid at each moment. p Perform back propagation to train the parameters of the multi-level neural network. After the multi-level neural network is trained, the displacement matrix of the fine grid at one moment can be input into the multi-level neural network, and the displacement matrix of the fine grid at the next moment can be output. The cycle can be repeated to achieve real-time simulation.

[0081] In this embodiment, the loss function used in the training of the multi-layer neural network is the mean square error loss, and its function form is specifically:

[0082]

[0083] Where N is the total number of elements in the displacement matrix of the fine grid, and Represents the displacement matrix of the fine grid at time t and time t+1 in the training data set; Represents the displacement matrix of the fine grid predicted by the multi-layer neural network at time t+1; Model represents the multi-layer neural network of the present invention.

[0084] In order to better demonstrate the specific implementation and technical effects of the present invention, a finite element simulation method based on a multi-layer neural network shown in steps S1 to S4 in the above preferred implementation is applied to a specific example.

[0085] Example

[0086] The specific implementation process of the finite element simulation method based on a multi-layer neural network used in this embodiment is as described above and will not be repeated here.

[0087] The present invention captures the high-frequency and low-frequency information of the fabric through a multi-layer neural network, processes it, and directly calculates the solution of the nonlinear equation. The method of the present invention improves the simulation efficiency of high-resolution grids. The experimental results are as follows: Figure 2 As shown, the real-time finite element simulation results of cloth are obtained.

[0088] In addition to the above simulation results, the present invention considers that the Newton method plus the multi-grid method is a very classic method in traditional simulation. Therefore, in this embodiment, the multi-grid method with a V-shaped iteration is used as the comparison method of the present invention. ∞(The infinity norm is the absolute maximum of all values ​​in F) as the error, and record the time required for the two methods and the speed at which the error decreases. Figure 2 The measured data in the illustrated scenario is shown in Table 1.

[0089] Table 1. Statistical results of different methods

[0090] Initial error One iteration error Usage time (ms) Multigrid Method 0.8157 0.3092 1.63 The present invention 0.8157 0.2134 0.52

[0091] In summary, in the same scenario, the method of the present invention achieves better speed and effect than the traditional method by training for the specific scenario in advance.

[0092] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A finite element simulation method based on a multi-layer neural network, characterized in that: The following steps are involved: S1. In cloth simulation, the cloth to be predicted is modeled as a cloth hyperelastic body model, and the cloth hyperelastic body model is divided into a number of units using a cloth finite element method. A dynamic energy expression is constructed for each unit, and the energy expression includes three parts: a kinetic energy term, a potential energy term, and an additional external force work term; S2. Using Newton iteration method and line search method to solve the solution of the energy expression when the energy expression reaches the minimum value, taking the solution of the energy expression as the position of each point in the unit at the next moment and constructing a training data set of a multi-layer neural network; S3. A fine grid is obtained in advance, and a multi-level coarse-fine grid structure is constructed by the farthest point sampling method, wherein the multi-level coarse-fine grid structure is composed of the fine grid and multiple layers of coarse grids, and each layer of coarse grid corresponds to a constructed interpolation matrix; S4. A multi-layer neural network is trained on the training data set, and the trained multi-layer neural network completes the prediction at multiple moments, and the multi-layer neural network outputs a displacement matrix of a fine grid at each moment until a preset maximum number of inferences is reached, and the displacement matrices of the fine grids at all moments output by the multi-layer neural network are used as the position prediction results of the cloth to be predicted; In the prediction process of the multi-layer neural network at each moment, the displacement matrix of the fine grid at the previous moment is multiplied with the interpolation matrix of each layer obtained by S3 in turn to obtain the displacement matrix of the coarse grid of each layer, and the displacement matrix of the fine grid at the previous moment and the displacement matrix of each coarse grid are input into the trained multi-layer neural network. Each displacement matrix of the coarse grid or fine grid is processed by a graph convolution network to obtain the feature matrix of each level, and the feature matrix of each coarse grid is multiplied with the corresponding displacement matrix to make the feature matrix of each coarse grid have the same dimension as the feature matrix of the fine grid, so as to obtain the new feature matrix of each coarse grid, and the new feature matrix of each coarse grid is spliced ​​with the feature matrix of the fine grid to obtain the spliced ​​feature matrix, which is input into the multi-layer perceptron to output the displacement matrix of the fine grid at the next moment.

2. A finite element simulation method based on a multi-layer neural network as claimed in claim 1, characterized in that: In step S1, the energy expression g(x) is in the form of: E(x)=Egravity(x)+EEelastic(x) Egravity(x)=mg'h′ in, represents the kinetic energy term; E(x) represents the potential energy term, including the gravitational potential energy term Egravity(x) and the elastic potential energy term Eelastic(x); represents the additional external force work term; x is the displacement vector, h is the time step, and M is the mass matrix; represents the additional external force; T represents the transposition; m represents the mass of each unit; g′ represents the acceleration of gravity; h′ represents the height of each unit; y = x [0] +hv [0] is the current speed v[ 0 ] and the current displacement x[ 0 ]Calculate the position at the next moment.

3. A finite element simulation method based on a multi-layer neural network as claimed in claim 2, characterized in that: In step S1, the elastic potential energy term adopts the stvk cloth hyperelastic body model energy model, and the calculation method is as follows: E=FTF- Among them, F represents the deformation gradient; X represents the position of each unit at the initial moment; E represents the Green stretch coefficient; I represents the unit matrix; ψ(E) represents the energy density function; μ and λ represent the two coefficients of Young's modulus respectively; : represents the Frobenius inner product; tr represents the trace of the matrix.

4. The finite element simulation method based on a multi-layer neural network as claimed in claim 1, characterized in that: The specific process of step S3 is as follows: a fine grid is acquired in advance and the number of layers of the multi-level neural network is pre-specified, a first set is constructed from all points of the fine grid, k1 points are selected from the first set by the farthest geodesic distance method to form a second set, a coarse grid is constructed from all points of the second set, and after the second set is generated by the first set, an interpolation matrix from a fine grid to a coarse grid is obtained by an interpolation matrix generation method; when the total number of sets is less than the number of layers of the multi-level neural network, new points are continuously selected from the previous set by the farthest geodesic distance method to form a new set, a new coarse grid is generated from all points in the new set, and then an interpolation matrix from a fine grid to each layer of coarse grid is obtained by an interpolation matrix generation method, until the total number of sets is equal to the number of layers of the multi-level neural network, and multi-layer coarse grids and interpolation matrices corresponding to each layer of coarse grids are obtained.

5. A finite element simulation method based on a multi-layer neural network as claimed in claim 4, characterized in that: In step S3, the specific process of selecting points from the first set to form the second set by the farthest geodesic distance method is as follows: first, randomly select a point from the first set as the initial point for distance calculation, add the initial point for distance calculation to the second set, and initialize the second set; continuously iterate and update the second set, in each iteration, use each remaining point in the first set except all the points included in the second set as a reference point, and then use the Dijkstra algorithm to calculate the shortest geodesic distance from each reference point to each point in the second set in turn, add the reference point with the largest shortest geodesic distance to the second set for updating the second set, and continuously iterate until the number of points included in the second set meets the requirement.

6. A finite element simulation method based on a multi-layer neural network as claimed in claim 4, characterized in that: In step S3, the specific process of obtaining an interpolation matrix from a fine grid to a coarse grid by the interpolation matrix generation method is as follows: when there are k0 points in the first set and there are k points in the set corresponding to a coarse grid i When there are points, an interpolation matrix with all elements being 0 is pre-constructed, and the size of the interpolation matrix is ​​k i *k0; if the i′th point in the first set has the smallest distance from the j′th point in the set corresponding to a coarse grid, then the element value at the i′th position in the j′th row of the interpolation matrix is ​​set to 1, until all points in the first set are processed to obtain an interpolation matrix from a fine grid to a coarse grid.

7. The finite element simulation method based on a multi-layer neural network as claimed in claim 1, characterized in that: In step S3, the loss function used in the training of the multi-layer neural network is the mean square error loss.

Citation Information

Patent Citations

  • Acceleration method and device for flow field prediction

    CN114218875A

  • Thermal stress prediction method and system based on neural network

    CN116451584A

  • Intelligent vehicle dynamics model based on physical information neural network, ILQR control algorithm and trajectory tracking controller

    CN116560223A

  • Simulation prediction method, simulation prediction system and simulation prediction equipment based on finite element parametric modeling and point cloud deep learning, and computer readable storage medium

    CN118070609A

  • Cloth simulation method and device, electronic equipment and storage medium

    CN118246294A

Cited By

  • Forging and pressing simulation method and related device

    CN119783488A