Oral biomechanical simulation method based on GPU parallel voxel finite element
By using the voxel finite element method of GPU parallel computing in finite element analysis, using regular hexahedral elements and CUDA acceleration algorithms, the problem of insufficient calculation speed and accuracy in traditional methods is solved, and efficient finite element analysis and visual display are achieved.
Patent Information
- Application Number
- CN202410527527.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-08-30
AI Technical Summary
When dealing with large-scale or highly complex data, the existing three-dimensional finite element method has limited calculation speed and processing capabilities, making it difficult to meet fast and accurate calculation requirements. Moreover, the tetrahedron as a basic unit has difficulties in meshing and ill-posed unit problems, resulting in Fields such as biomedical simulation are limited in accuracy and efficiency.
The voxel finite element method based on GPU parallel computing is used to establish a finite element model of regular hexahedral elements from three-dimensional scalar field data. The CUDA acceleration algorithm is used for parallel computing to avoid mesh division and ill-conditioned element problems, and achieve fast solution and high efficiency. Precision analysis.
It significantly improves the calculation speed and accuracy of finite element analysis, reduces memory resource usage, and enables intuitive display of results through visualization. Compared with traditional CPU methods, the solution time is shortened by more than three times, and the accuracy is increased by 25%.
Smart Images

Figure CN118569015A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer-aided engineering, and specifically relates to an oral biomechanics simulation method based on GPU parallel voxel finite element, which establishes a three-dimensional finite element model based on volume data and realizes the analysis and calculation process. Background Art
[0002] In modern engineering and scientific research, the finite element method (FEM) is widely used to simulate the mechanical properties of various structures and materials. This method can simulate and analyze the response of materials under various forces by decomposing complex structures into smaller, manageable units (or finite elements). Existing three-dimensional finite element methods mostly use tetrahedrons as basic units and use CPUs as computing resources when solving calculations. However, with the increase in simulation complexity, traditional CPU-based finite element analysis faces major challenges in computing speed and processing power. Especially when dealing with large-scale or highly complex data sets, the parallel computing power of the CPU is limited, which limits the computing efficiency and makes it difficult to meet the needs of fast and accurate calculations in practical applications. There are also some problems with using tetrahedrons as basic units. First, meshing requires a lot of geometric processing. Second, there are pathological units in tetrahedrons. At the same time, the number of iterations required for analysis with tetrahedrons as basic units is high. In addition, when dealing with high-resolution simulations, the number of tetrahedral meshes will be very large under the condition of achieving the same accuracy, but practical analysis often requires a compromise between computational accuracy and speed. This trade-off is particularly evident in areas such as biomedical simulations, sophisticated material science research, or analysis of complex engineering structures, where simulations require extremely high accuracy, but existing technologies often cannot achieve the desired accuracy and efficiency due to limitations in computing power.
[0003] Scalar field volume data uses voxels as basic units. Each voxel is a regular hexahedron. It can be directly used as a hexahedron unit to establish a finite element model. The image information contained in it can be converted into the physical properties required for finite element analysis. With the development of graphics processing units (GPUs), they have shown great potential in parallel processing of large-scale data. The parallel computing power of GPUs far exceeds that of CPUs. Its characteristics match the computing requirements of large-scale finite element models and can greatly speed up the finite element solution.
[0004] However, there is currently no voxel-based finite element analysis method that can use the parallel computing model of GPU to achieve fast modeling and fast solving. Therefore, there is an urgent need to develop a new finite element analysis solution that can fully utilize the parallel computing power of GPU to improve the calculation speed and accuracy, thereby significantly improving the efficiency and accuracy of physical simulation and realizing efficient computer-aided engineering solutions. Summary of the invention
[0005] In order to solve the problems mentioned in the background technology, the present invention provides a voxel finite element method using GPU parallel computing, which directly establishes a finite element model based on regular hexahedron units from three-dimensional scalar field volume data, effectively avoiding the defects of tetrahedron units and eliminating the computational cost required for meshing. GPU parallel computing acceleration algorithm is used in the solution process to achieve fast solution, pursue high calculation accuracy without losing efficiency, and realize visualization of data and results.
[0006] The oral biomechanics simulation method based on GPU parallel voxel finite element of the present invention comprises the following steps:
[0007] Step 1: Obtain the oral model image data scanned by CBCT and convert it into three-dimensional scalar field data. Use the gray value conversion algorithm to convert the image attributes into the physical properties of the material; set the voxel finite element geometric model, material properties, and boundary conditions based on the dedicated data structure;
[0008] Step 2: Read the model resource file obtained in step 1, construct a three-dimensional finite element model with voxels as units, and form a finite element solution equation group by calculating the unit stiffness matrix, assembling the overall stiffness matrix and force vector;
[0009] Step 3: Copy the equation group data to the GPU, use CUDA to perform parallel computing on the GPU to accelerate the process of solving the equation group, and calculate the solution vector of the equation group, that is, the displacement vector of the finite element model;
[0010] Step 4: Calculate the stress and strain of the finite element model according to the displacement vector, calculate the impedance center of the oral model, and export the results; finally, visualize the oral model and displacement vector, strain tensor, stress tensor, and principal stress based on the volume rendering algorithm in the prototype system.
[0011] The step 1 is specifically as follows:
[0012] 1.1) Read in the 3D scalar field volume data, obtain the geometric model information and the grayscale value of the voxel, and use the grayscale value conversion algorithm to convert the image attributes into the physical properties of the material, specifically:
[0013] First, the grayscale value of the volume data is converted to CT value, then from CT value to bone density, and finally from bone density to Young's modulus; and the Young's modulus is corrected based on the measured data (due to the measurement deviation of the image data, the attribute value obtained by conversion has errors), so that the difference between the corrected data and the average value of the measured data does not exceed 20%;
[0014] The conversion formula is a regression equation;
[0015] The Poisson's ratio of the volume data is obtained by actual measurement.
[0016] 1.2) Design a dedicated data structure to store the required finite element intermediate files in a specific format
[0017] The dedicated data structures are the geometry model file, material property file, and boundary condition file. The geometry model file is set according to the three-dimensional scalar field data, the material property file is set according to the converted material physical properties, and the boundary conditions are set by the user.
[0018] For the geometric model file (the geometric shape of the finite element model, i.e. the shape of the three-dimensional scalar field), each row represents a voxel, a voxel is a hexahedral unit, and the information contained in the unit is the voxel number, the physical material number (i.e. the material number of the model), and the unit coordinates of the regular hexahedron; the unit coordinates are the three-dimensional coordinates of the point closest to the coordinate origin among the eight vertices of the regular hexahedral unit;
[0019] For the material property file, each line represents a material and contains information such as material number, Young's modulus, and Poisson's ratio;
[0020] For the boundary condition file, each line represents the boundary constraint or external force of a vertex in the geometric model, and contains the information of the three-dimensional coordinates of the vertex, the force in the three-dimensional direction, and the constraint in the three-dimensional direction.
[0021] The step 2) is specifically as follows:
[0022] 2.1) Construct a three-dimensional finite element model with voxels as units
[0023] The model resource file is the geometric model file, material property file, and boundary condition file obtained in step 1; the method for constructing a three-dimensional finite element model with voxels as units is:
[0024] Through a control flow, the model file, material property file, and boundary condition file are read in sequence; when reading the model file, one voxel is regarded as an eight-node regular hexahedron unit, and a bidirectional mapping relationship between unit coordinates and vertex coordinates is established; when reading the boundary condition file, the corresponding vertex is found according to the three-dimensional coordinates of the vertex, and the properties of the corresponding vertex are set according to the boundary constraints or external forces.
[0025] 2.2) Calculate the element stiffness matrix
[0026] The integral formula for calculating the unit stiffness matrix contains the material matrix and gradient matrix information; the material matrix is obtained according to the input material properties, and the gradient matrix is directly obtained by the finite element theory; the Gaussian quadrature rule is used in the calculation, and multi-threaded parallel calculation is used, specifically:
[0027] First, the maximum number of concurrent connections supported by the hardware is obtained, and then the task of calculating the element stiffness matrix to be calculated is assigned to each thread. Each thread calculates the material matrix based on the material properties passed in.
[0028] Substitute the material matrix and gradient matrix into the integral formula. For each unit, eight sampling points are used to calculate the integral. The eight sampling points are the eight vertices of the regular hexahedral unit. The integral result is obtained by adding up the calculation results of the eight sampling points, which is the 24*24 unit stiffness matrix.
[0029] 2.3) Assemble the overall stiffness matrix and force vector. The specific method is:
[0030] For assembling the overall stiffness matrix, multi-threaded parallel assembly is used. First, the maximum number of concurrent operations supported by the hardware is obtained, and a specified number of nodes are assigned to each thread for calculation. For each vertex, the eight cells around the current vertex are traversed, and the part of the cell stiffness matrix of each surrounding cell corresponding to the current vertex is extracted, and added to the row and column corresponding to the current vertex in the overall stiffness matrix; the overall stiffness matrix is stored in the ELLPACK sparse matrix format to save memory space;
[0031] For the assembly force vector, for each vertex with a boundary condition, the corresponding boundary constraint or external force vector is placed at the position of the current vertex corresponding to the overall force vector.
[0032] The step 3 is specifically as follows:
[0033] 3.1) The method of solving the system of equations using CUDA parallel computing on GPU is:
[0034] The conjugate gradient method is used as a method for iteratively solving a system of linear equations. Each iteration of the conjugate gradient method includes one matrix-vector multiplication, three vector scalar multiplications, three vector additions, and two vector dot multiplications. The above operations are all implemented using a CUDA-based parallel algorithm, and a precondition is set during the solution process to accelerate convergence. The solution of the system of equations obtained by calculation is a displacement vector of a finite element model; wherein the precondition is set as a left precondition, a symmetric successive super-relaxation method, and an incomplete Cholesky decomposition;
[0035] 3.2) Parallel computing acceleration process based on CUDA:
[0036] Double-precision floating-point types are used as the storage type for matrix and vector elements. The combined memory access feature of the GPU is utilized to store the coefficient matrix of the equation group in the ELLPACK format in the global memory of the GPU. For multiplication and addition operators, vectorized instructions are used, and the number of blocks and threads in CUDA is set according to the hardware scale, so that all threads in the block execute multiplication or addition instructions at the same time, and calculate the corresponding matrix or vector components according to the thread and block numbers.
[0037] The step 4 is specifically as follows:
[0038] 4.1) Calculate stress and strain:
[0039] Calculate the strain matrix of the eight vertices in the regular hexahedron unit, multiply it by the displacement vector on the left, and get the vertex strain tensor; then multiply the material matrix on the left by the strain tensor to get the vertex stress tensor, and calculate the vertex principal stress, i.e., von Mises stress, from the stress tensor. The key to calculating the node principal stress is to solve the cubic equation, which is calculated using the Shengjin formula.
[0040] 4.2) Calculate the impedance center of the oral model:
[0041] Solve the impedance center of a single tooth. According to the displacement vector, calculate the standard deviation of the displacement vectors of each vertex of a tooth except the force-applying vertex, and use the standard deviation as the impedance center result.
[0042] The standard deviation is the sum of the standard deviations of the three components of the displacement vector.
[0043] 4.3) Visualization of models and results:
[0044] A volume rendering algorithm is used, specifically a ray casting algorithm, which is implemented through the OpenGL graphics interface. The specific process is as follows:
[0045] The volume data and the solved displacement vector, strain tensor, stress tensor, and principal stress are passed to the GPU as a three-dimensional texture, and a series of drawing parameters are set to transform the three-dimensional texture from the model space to the world space, and then from the world space to the camera space. After the transformation is completed, the camera emits a ray of light to each pixel in the imaging area, and samples the light in the process of penetrating the voxel to obtain the voxel value of the current voxel. Linear interpolation is performed according to the transfer function to realize the mapping of voxel value to color and opacity. The color and opacity are accumulated during the sampling process to finally obtain the color of the pixel.
[0046] The beneficial effects of the present invention are:
[0047] 1) The present invention establishes a regular hexahedron finite element model based on scalar field volume data. Compared with the tetrahedron model, the physical properties of the material are easier to obtain, and the problems of meshing and ill-conditioned units when using the tetrahedron model are avoided, and the accuracy of the results can also be improved.
[0048] 2) This invention introduces GPU parallel computing method, based on CUDA programming model and GPU characteristics to realize parallel solution of large-scale linear equations algorithm. Compared with the traditional finite element method based on CPU calculation, the solution time is greatly shortened, the use of special data structure reduces memory resource occupation, and ensures high precision of the results.
[0049] 3) The present invention is based on a volume rendering ray casting method and uses an OpenGL graphics interface library to achieve visualization of the model and results, making it easier for users to view images of the model and results. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A flowchart of an oral biomechanics simulation method based on GPU parallel voxel finite element provided in an embodiment of the present invention.
[0051] Figure 2 Schematic diagram of the model file data structure provided by the embodiment of the present invention
[0052] Figure 3 Schematic diagram of an eight-node voxel unit provided by an embodiment of the present invention
[0053] Figure 4 Schematic diagram of reading ELLPACK format sparse matrix using GPU merged memory access method provided by an embodiment of the present invention
[0054] Figure 5 Schematic diagram of the volume rendering ray casting algorithm provided by an embodiment of the present invention
[0055] Figure 6 A schematic diagram showing a model and impedance center solution provided by an embodiment of the present invention DETAILED DESCRIPTION
[0056] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0057] like Figure 1 The present invention provides an oral biomechanics simulation method based on GPU parallel voxel finite element, comprising the steps of:
[0058] 1. Obtain the oral model image data scanned by CBCT and convert it into three-dimensional scalar field data. Use the grayscale value conversion algorithm to convert the image attributes into the physical properties of the material; based on the dedicated data structure, set the voxel finite element geometric model, material properties, and boundary conditions.
[0059] In this embodiment, the CBCT oral model image data of size w×h×d is converted into three-dimensional scalar field volume data and read into the memory voxel by voxel. Based on the following formula, the grayscale value of the voxel is converted to the physical property of the material. First, the grayscale value is converted to the CT value Hu, then the CT value is converted to the bone density ρ, and finally the bone density is converted to the Young's modulus E; then the geometric model, physical material properties, and boundary conditions are set and stored as files. The file data structure is as follows: Figure 2As shown in the figure, for the geometric model file, each line represents a voxel, a voxel is a hexahedral unit, and the information contained in the unit is the voxel number, the physical material number, and the three-dimensional coordinates of the point closest to the coordinate origin among the eight vertices of the regular hexahedral unit; for the material property file, each line represents a material, and its information includes material number, Young's modulus, and Poisson's ratio; for the boundary condition file, each line represents the boundary constraint or external force of a node in the geometric model, and its information includes three-dimensional coordinates, force in three-dimensional direction, and constraint in three-dimensional direction.
[0060] Hu=126.92+0.93×grayscale value
[0061] ρ=-13.4+1017×Hu
[0062] E=10.5×ρ 2.29
[0063] 2. Read the model resource file obtained in step 1, namely the geometric model file, material property file, and boundary condition file, construct a three-dimensional finite element model with voxels as units, calculate the unit stiffness matrix, assemble the overall stiffness matrix and force vector, and form a finite element solution equation group.
[0064] Specifically, firstly, a three-dimensional finite element model with voxels as units is constructed: through a control flow, the geometric model file, material property file, and boundary condition file are read in sequence. When reading the model file, one voxel is an eight-node regular hexahedron unit. The voxel unit is as follows: Figure 3 As shown, a bidirectional mapping relationship between units and nodes is established. When reading in the boundary condition file, the corresponding nodes are found according to the three-dimensional coordinates, and the boundary constraints or external forces are added to the nodes.
[0065] Then calculate the unit stiffness matrix: use multi-threaded parallel calculation, first according to the interface std::thread::hardware_concurrency() provided in the C++ multi-threaded standard library, obtain the maximum number of concurrent connections supported by the hardware, and then assign the unit stiffness matrix task to be calculated to each thread. Each thread calculates the material matrix D according to the material properties passed in, and then combines the gradient matrix B according to the integral formula of the unit stiffness matrix Using Gauss quadrature rule, each unit is calculated with 8 sampling points, which are the 8 vertices of the regular hexahedral unit. The integral result is a 24*24 unit stiffness matrix.
[0066] Then the overall stiffness matrix and force vector are assembled: for the assembly of the overall stiffness matrix, multi-threaded parallel assembly is used. First, according to the interface std::thread::hardware_concurrency() provided in the C++ multi-threaded standard library, the maximum number of concurrent connections supported by the hardware is obtained, and a specified number of nodes are allocated to each thread for calculation. For each node, the cells adjacent to the node are traversed, and the node part of the cell stiffness matrix is extracted and added to the corresponding rows and columns of the overall stiffness matrix. The overall stiffness matrix is stored in the ELLPACK sparse matrix format to save memory space. For the assembly of the force vector, for each node with boundary conditions, the corresponding boundary constraint or external force is placed at the position of the overall force vector corresponding to the node.
[0067] 3. Copy the equation group data to the GPU, use CUDA for parallel computing on the GPU to accelerate the process of solving the equation group calculation, and obtain the solution vector of the equation group, that is, the displacement vector of the finite element model.
[0068] The conjugate gradient method is used as an iterative method to solve the linear equations. The algorithm flow is as follows:
[0069] The input is the coefficient matrix A of the linear equations (i.e. the overall stiffness matrix of the finite element model), the initial solution vector x0, the right-hand term b (overall force vector), the iteration limit value limit, and the tolerance value ε.
[0070] The specific algorithm steps are:
[0071] 1) Initialization:
[0072] Choose an initial guess solution x0 (usually a zero vector).
[0073] Calculate the initial residual r0 = b-Ax0, which is also the initial direction d0.
[0074] Set the square of the norm of r0 as the initial error measure.
[0075] 2) Iteration:
[0076] For k = 0, 1, 2, ..., until the residual is small enough or the predetermined number of iterations is reached:
[0077] Calculation step length
[0078] Update solution x k+1 =x k +α k d k .
[0079] Update residual r k+1 =rk -α k Ad k .
[0080] If r k+1 is small enough, then stop iterating, because x k+1 is a good enough approximation.
[0081] Calculate new
[0082] Calculate the coefficient β of the next conjugate direction k =δ k+1 / δ k .
[0083] Update direction d k+1 =r k+1 +β k d k .
[0084] 3) End:
[0085] When the residual is less than the preset tolerance value ε or reaches the preset number of iterations limit, the algorithm stops.
[0086] The final approximate solution x k+1 is considered to be the solution of the original linear system of equations.
[0087] Each iteration of the conjugate gradient method includes one matrix-vector multiplication, three vector-scalar multiplications, three vector additions, and two vector dot multiplications. All of the above operations are implemented using a CUDA-based parallel algorithm, and preconditions (left preconditioning, symmetric successive superrelaxation method, incomplete Cholesky decomposition) are set during the solution process to speed up convergence.
[0088] Specifically, the parallel computing acceleration process based on CUDA is as follows: Using the Thrust standard library, first use device::vector as the underlying container, design a dedicated data structure on the GPU, store the coefficient matrix of the equation group in the ELLPACK format in the global memory of the GPU, use double-precision floating-point as the storage type of matrix and vector elements, and use the GPU's merged memory access feature to read matrix elements to save memory usage, such as Figure 4 As shown. For multiplication and addition operators, vectorized instructions are used, and the number of blocks and threads in CUDA is set according to the hardware scale, so that all threads in the block execute multiplication or addition instructions at the same time, and the corresponding components are calculated according to the thread and block numbers. The final calculated solution vector is the displacement vector of the finite element model.
[0089] In this embodiment, after using GPU parallel computing, the speed of solving the linear equations is increased by more than three times on average compared to the CPU side; compared to tetrahedral units, the accuracy of the solution results using regular hexahedral units is also increased by 25% on average. The solution result data of multiple examples are compared as shown in the following table:
[0090]
[0091]
[0092] In this table, the experimental comparison object is the mainstream finite element commercial software Comsol. This method is based on the voxel finite element model for calculation on the GPU side. Comsol software uses the tetrahedron finite element model after adaptive meshing under the same volume data and uses the CPU for calculation. Due to the software limitations of Comsol, its solution tolerance can be set to a minimum of 2.5e-06, while this method can be set to 1e-9. Both solution processes have reached convergence, so the calculation results of this method are more accurate. In terms of acceleration, the average speedup ratio of this method exceeds 3, which is much faster than Comsol software calculated on the CPU.
[0093] 4. Calculate the stress and strain of the finite element model based on the displacement vector, calculate the impedance center of the oral model, export the results, and visualize the volume data and results based on the volume rendering algorithm.
[0094] The first step is to calculate stress and strain: calculate the strain matrix B of the eight nodes in the unit, multiply it by the displacement field on the left to get the node strain tensor, and then multiply the material matrix D on the left to get the node stress tensor. The node principal stress, i.e., von Mises stress, is calculated from the stress tensor.
[0095] The method for calculating the impedance center of the oral model is: solve the impedance center of a single tooth, and calculate the standard deviation of the displacement values of each node of a tooth except the force-applying node based on the displacement field data. This standard deviation is the sum of the standard deviations of the three components of the displacement field, and the standard deviation is used as the impedance center result. The experimental data of the calculation of the impedance center are shown in the following table:
[0096]
[0097] In this table, the results of calculating the impedance center of the oral model using this method and Comsol software both meet the medical conclusions, but the standard deviation calculated by this method is smaller; due to parallel calculation on the GPU side, the calculation time of this method is also faster.
[0098] Finally, the model and results are visualized using a volume rendering algorithm, specifically a ray casting algorithm, the principle is as follows Figure 5As shown, it is implemented through the OpenGL graphics interface, the volume data is passed to the GPU as a 3D texture, a series of drawing parameters are set, the 3D texture is transformed from the model space to the world space, and then from the world space to the camera space. After the transformation is completed, the camera emits a ray of light to each pixel in the imaging area, samples the light in the process of penetrating the voxel, obtains the voxel value of the current voxel, and performs linear interpolation according to the transfer function to realize the mapping of the voxel value to the color and opacity. The color and opacity are accumulated during the sampling process to finally obtain the color of the pixel. The model and impedance center results of a set of embodiment data are visualized as follows Figure 6 shown.
[0099] The present invention provides a voxel finite element analysis solution based on GPU parallel computing. By directly establishing a finite element model based on regular hexahedron units from three-dimensional scalar field volume data and using GPU parallel computing acceleration algorithm in the solution process, fast solution can be achieved, high calculation accuracy is pursued without losing efficiency, and visualization of data and results is achieved.
Claims
1. An oral biomechanics simulation method based on GPU parallel voxel finite element, characterized in that: The following steps are involved: Step 1: Obtain the oral model image data scanned by CBCT and convert it into three-dimensional scalar field data. Use the gray value conversion algorithm to convert the image attributes into the physical properties of the material; set the voxel finite element geometric model, material properties, and boundary conditions based on the dedicated data structure; Step 2: Read the model resource file obtained in step 1, construct a three-dimensional finite element model with voxels as units, and form a finite element solution equation group by calculating the unit stiffness matrix, assembling the overall stiffness matrix and force vector; Step 3: Copy the equation group data to the GPU, use CUDA to perform parallel computing on the GPU to accelerate the process of solving the equation group, and calculate the solution vector of the equation group, that is, the displacement vector of the finite element model; Step 4: Calculate the stress and strain of the finite element model according to the displacement vector, calculate the impedance center of the oral model, and export the results; finally, visualize the oral model and displacement vector, strain tensor, stress tensor, and principal stress based on the volume rendering algorithm.
2. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In step 1, the grayscale value conversion algorithm for converting image attributes into material physical attributes is specifically: First, the gray value of the volume data is converted into CT value, then from CT value to bone density, and finally the bone density is converted into Young's modulus; and the Young's modulus is corrected in combination with the measured data, so that the difference between the corrected data and the average value of the measured data does not exceed 20%; The conversion formula is a regression equation; The Poisson's ratio of the volume data is obtained by actual measurement.
3. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In the step 1), the dedicated data structures are respectively a geometry model file, a material property file, and a boundary condition file. The geometry model file is set according to the three-dimensional scalar field volume data, the material property file is set according to the converted material physical properties, and the boundary conditions are set by the user. For the geometric model file, each line represents a voxel, and a voxel is a hexahedral unit. The information contained in the unit is the voxel number, the physical material number, and the unit coordinates of the regular hexahedron. The unit coordinates are the three-dimensional coordinates of the point closest to the coordinate origin among the eight vertices of the regular hexahedral unit. For the material property file, each line represents a material and contains information such as material number, Young's modulus, and Poisson's ratio; For the boundary condition file, each line represents the boundary constraint or external force of a vertex in the geometric model, and contains the information of the three-dimensional coordinates of the vertex, the force in the three-dimensional direction, and the constraint in the three-dimensional direction.
4. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In the step 2), the model resource file is the geometric model file, material property file, and boundary condition file obtained in step 1; the method for constructing a three-dimensional finite element model with voxels as units is: Through a control flow, the model file, material property file, and boundary condition file are read in sequence; when reading the model file, one voxel is regarded as an eight-node regular hexahedron unit, and a bidirectional mapping relationship between unit coordinates and vertex coordinates is established; when reading the boundary condition file, the corresponding vertex is found according to the three-dimensional coordinates of the vertex, and the properties of the corresponding vertex are set according to the boundary constraints or external forces.
5. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In the step 2), the integral formula for calculating the unit stiffness matrix includes material matrix and gradient matrix information; the material matrix is obtained according to the input material properties, and the gradient matrix is obtained by finite element theory; the Gaussian quadrature rule is used in the calculation, and multi-threaded parallel calculation is used, specifically: First, the maximum number of concurrent connections supported by the hardware is obtained, and then the task of calculating the element stiffness matrix to be calculated is assigned to each thread. Each thread calculates the material matrix based on the material properties passed in. Substitute the material matrix and gradient matrix into the integral formula. For each unit, eight sampling points are used to calculate the integral. The eight sampling points are the eight vertices of the regular hexahedral unit. The integral result is obtained by adding up the calculation results of the eight sampling points, which is the 24*24 unit stiffness matrix.
6. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In step 2), the method of assembling the overall stiffness matrix and force vector is: For assembling the overall stiffness matrix, multi-threaded parallel assembly is used. First, the maximum number of concurrent connections supported by the hardware is obtained, and a specified number of nodes are assigned to each thread for calculation. For each vertex, the eight cells around the current vertex are traversed, and the part of the cell stiffness matrix of each surrounding cell corresponding to the current vertex is extracted, and added to the row and column corresponding to the current vertex in the overall stiffness matrix; the overall stiffness matrix is stored in the ELLPACK sparse matrix format; For the assembly force vector, for each vertex with a boundary condition, the corresponding boundary constraint or external force vector is placed at the position of the current vertex corresponding to the overall force vector.
7. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In step 3, the method of using CUDA parallel computing on the GPU to solve the equation group is: The conjugate gradient method is used as a method for iteratively solving a system of linear equations. Each iteration of the conjugate gradient method includes one matrix-vector multiplication, three vector scalar multiplications, three vector additions, and two vector dot multiplications. The above operations are all implemented using a CUDA-based parallel algorithm, and a precondition is set during the solution process to accelerate convergence. The solution of the system of equations obtained by calculation is a displacement vector of a finite element model; wherein the precondition is set as a left precondition, a symmetric successive super-relaxation method, and an incomplete Cholesky decomposition; The CUDA-based parallel algorithm is specifically: Double-precision floating-point types are used as the storage type for matrix and vector elements. The combined memory access feature of the GPU is utilized to store the coefficient matrix of the equation group in the ELLPACK format in the global memory of the GPU. For multiplication and addition operators, vectorized instructions are used, and the number of blocks and threads in CUDA is set according to the hardware scale, so that all threads in the block execute multiplication or addition instructions at the same time, and calculate the corresponding matrix or vector components according to the thread and block numbers.
8. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In step 4, the algorithm process for calculating stress and strain is: Calculate the strain matrix of the eight vertices in the regular hexahedral unit, multiply it by the displacement vector on the left to get the vertex strain tensor; then multiply the strain tensor with the material matrix on the left to get the vertex stress tensor, and calculate the vertex principal stress from the stress tensor.
9. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 1, characterized in that: In step 4, the method for calculating the impedance center of the oral model is specifically as follows: Solve the impedance center of a single tooth. According to the displacement vector, calculate the standard deviation of the displacement vectors of each vertex of a tooth except the force-applying vertex, and use the standard deviation as the impedance center result. The standard deviation is the sum of the standard deviations of the three components of the displacement vector.
10. The oral biomechanics simulation method based on GPU parallel voxel finite element according to claim 8, characterized in that: In step 4, the visualization method is: using a volume rendering algorithm, specifically a ray casting algorithm, and implementing the ray casting algorithm through the OpenGL graphics interface. The specific process is: The volume data and the solved displacement vector, strain tensor, stress tensor, and principal stress are passed to the GPU as a three-dimensional texture, and a series of drawing parameters are set to transform the three-dimensional texture from the model space to the world space, and then from the world space to the camera space. After the transformation is completed, the camera emits a ray of light to each pixel in the imaging area, and samples the light in the process of penetrating the voxel to obtain the voxel value of the current voxel. Linear interpolation is performed according to the transfer function to realize the mapping of voxel value to color and opacity. The color and opacity are accumulated during the sampling process to finally obtain the color of the pixel.
Citation Information
Cited By
Stress-optimized printing slice image generation method
CN120533949A
