CN115455753A - Collision simulation method and device for soft tissue and rigid ground - Google Patents

Collision simulation method and device for soft tissue and rigid ground Download PDF

Info

Publication number
CN115455753A
CN115455753A CN202210979062.6A CN202210979062A CN115455753A CN 115455753 A CN115455753 A CN 115455753A CN 202210979062 A CN202210979062 A CN 202210979062A CN 115455753 A CN115455753 A CN 115455753A
Authority
CN
China
Prior art keywords
soft tissue
simulation
constraint
model
vertex
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210979062.6A
Other languages
Chinese (zh)
Inventor
王娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Polytechnic Normal University
Original Assignee
Fujian Polytechnic Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Polytechnic Normal University filed Critical Fujian Polytechnic Normal University
Priority to CN202210979062.6A priority Critical patent/CN115455753A/en
Publication of CN115455753A publication Critical patent/CN115455753A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/23Design optimisation, verification or simulation using finite element methods [FEM] or finite difference methods [FDM]

Abstract

The invention provides a soft tissue and rigid ground collision simulation method and a device, wherein the method comprises the following steps: s1, obtaining a soft tissue model after simulation modeling; s2, in each simulation step, calculating and obtaining the predicted position of each vertex on the soft tissue model at the next moment, correcting the predicted position of each vertex on the soft tissue model by taking a rigid ground as external constraint and taking strain energy constraint of a flexible object as internal constraint, and performing next-step model rendering and deformation calculation according to the corrected position of each vertex; and S3, repeatedly executing the calculation of the next simulation step until the simulation is finished. The invention realizes deformation simulation, and the simulation method is stable and efficient and has better physical reality so as to give consideration to the simulation accuracy and the calculation efficiency in an interactive virtual three-dimensional scene of soft tissue and rigid ground collision.

Description

Collision simulation method and device for soft tissue and rigid ground
Technical Field
The invention relates to the technical field of computer graphics, in particular to a collision simulation method and device of soft tissue and rigid ground.
Background
In computer graphics, simulation solids can be generally classified into three categories, rigid bodies, flexible bodies, and clothes. The soft body such as liver belongs to the soft body class, and different from the rigid body, the shape of the soft body can change after being stressed, and the relative position of each point in the soft body can also change; whereas garments are usually modeled in two dimensions (ignoring thickness), the flexible body must be modeled in three dimensions. Therefore, flexible body simulation belongs to a class of more complex solid body simulation. The conventional Newton (frictionless) method does not consider the friction generated when soft tissue collides with a rigid ground, and thus causes distortion.
Specifically, the conventional method includes:
1.1 spring-mass model
The spring-mass point model is the simplest deformation model, and is a physical modeling method based on spring force. In the spring-mass system, the simulation object is dispersed into a series of masses, the masses are connected with each other through a spring network, and the deformation behavior of the object can be controlled by adjusting the coefficient of the spring.
The model is simple and clear, is easy to realize, and can obtain higher computational efficiency in most simulation scenes. Its simplicity brings with it some drawbacks:
1. the deformation behavior of the object depends on the scale and the way of building the spring network.
2. The spring-particle model cannot maintain some necessary volume characteristics, such as volume conservation, which makes the system unsuitable for deformation simulation of solids. Spring-mass point systems are more applied to garment simulation because in computer graphics, garments are generally viewed as objects without thickness, i.e., without a volume.
3. The spring rate is difficult to set due to the lack of necessary theoretical support. For a given simulation material, the spring constant can only be achieved by trial and error to achieve a closer match.
1.2 finite element model
FEM is a physically accurate method of deformation modeling. In numerical calculation, FEM is a method for approximately solving the edge value problem of partial differential equations, and is widely used in structural mechanics analysis.
FEMs are based on a continuous medium assumption that the substance is continuously distributed throughout the space it occupies. For systematic solution, the model needs to be divided into a finite number of sub-regions, called cells, and the connection points of the cells are called nodes. In the FEM calculation process, an equation is established for each unit, and the equation is established by the relationship among unit stress, strain and displacement; then, the equations corresponding to all the units are aggregated to form an integral system equation set, wherein the system equation set is a set of linear equations with node displacement as an unknown quantity; and finally, solving the system equation set to obtain the displacement of each node.
FEM directly applies the traditional mechanics theory analysis method to computer graphics, thus obtaining ideal physical accuracy. However, accurate simulation results tend to be at the cost of significant computational expense. For a model with n nodes, the system needs to solve a sparse matrix linear equation with a scale of 3n × 3n at each Simulation Step (Simulation Step), which is undoubtedly a huge calculation burden for the Simulation system, and thus FEM is not suitable for large-scale interactive applications.
Therefore, there is a need for a method that can compromise the accuracy and computational efficiency of simulation in an interactive application scenario where soft tissue collides with a rigid ground.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a method and an apparatus for simulating a collision between a soft tissue and a rigid ground, so as to achieve both simulation accuracy and calculation efficiency in an interactive application scenario where a soft tissue collides with a rigid ground.
In order to achieve the purpose, the invention adopts the technical scheme that:
in a first aspect, the present invention provides a method for simulating collision between soft tissue and rigid ground, comprising:
s1, obtaining a soft tissue model after simulation modeling;
s2, in each simulation step, calculating and obtaining the predicted position of each vertex on the soft tissue model at the next moment, correcting the predicted position of each vertex on the soft tissue model by taking the rigid ground as external constraint and taking strain energy constraint of a flexible object as internal constraint, and performing model rendering and deformation calculation of the next step according to the corrected position of each vertex;
and S3, repeatedly executing the calculation of the next simulation step until the simulation is completed.
The invention has the beneficial effects that: the invention takes position dynamics as a basic deformation model, adopts strain energy constraint as internal constraint and adopts environment collision constraint as external constraint, the position dynamics and the strain energy constraint form a system constraint equation set, and the system constraint equation set is solved to obtain a new position of a model vertex, thereby realizing deformation simulation.
Optionally, the step S2 includes:
step S21, during the first simulation step, initializing the basic attribute of each vertex on the soft tissue model:
Figure BDA0003799612020000031
wherein the basic attribute of each vertex comprises a mass m i Position x i Velocity v i
S22, in each simulation step, performing time integral calculation by using a fixed time step delta t to obtain the predicted speed { v ] of each vertex on the soft tissue model 0 ,v 1 ,...v n H and predicted position p 0 ,p 1 ,...p n The predicted position serves as an initial condition for constraint solving;
s23, according to the current simulation scene, taking the external constraint of the rigid ground and the strain energy constraint of the flexible object as internal constraints to jointly form a system constraint equation set;
step S24, predicting position { p ] of each vertex 0 ,p 1 ,...p n Substituting the correction value into a system constraint equation set, solving by using a Gauss-Seidel iteration method, limiting the iteration times, and solving to obtain a set of position correction values (delta p) 0 ,Δp 1 ,...Δp n };
Step S25, using the position correction amount { Δ p 0 ,Δp 1 ,...Δp n Correcting the predicted position of each vertex { p } 0 ,p 1 ,...p n Using the corrected predicted position { x } 0 ,x 1 ,...x n Updating the vertex position attribute and updating the pre-speed measurementAnd finally, performing next model rendering and deformation calculation according to the corrected position of each vertex.
According to the description, compared with the traditional method, the simulation process can obtain more accurate results, meanwhile, the constraint projection is more converged, and the simulation accuracy and the calculation efficiency are both considered.
Optionally, the step S23 of externally constraining the rigid ground includes:
considering a collision constraint between the soft tissue model and the rigid ground as a distance constraint whose constraint function is:
C(p)=(p-q s )·n s ≥0;
wherein p is any vertex on the soft tissue model, q s Representing the point on the collision contact surface closest to p, n s Is q is s The normal vector of (c).
According to the above description, the collision constraint between the soft tissue model and the rigid ground is regarded as the distance constraint, and the distance between the soft tissue model and the rigid ground is limited to be greater than or equal to 0, so that when the simulation object falls to the ground under the action of gravity, the phenomenon that the simulation object penetrates through the rigid ground can be prevented.
Optionally, the step S23 of constraining the strain energy of the flexible object as an internal constraint includes:
and (2) showing the deformation of the soft tissue model as a continuous displacement field u, defining omega as a volume domain occupied by the soft tissue model, and obtaining an expression of an object deformation function phi (X) if X belongs to omega as any point of the soft tissue model in an undeformed state:
φ(X)=X+u=x;
the deformation function describes a mapping relation between a point X in a material space and a point X corresponding to the deformation, and a deformation gradient tensor F of the deformation function is as follows:
Figure BDA0003799612020000041
the strain tensor E can be obtained from the deformation gradient tensor F as follows:
Figure BDA0003799612020000042
wherein I represents an identity matrix;
obtaining the strain energy density psi according to the deformation gradient tensor F and the strain tensor E s Comprises the following steps:
Figure BDA0003799612020000043
wherein E = tr (E) T E) The function tr (a) represents the trace of the matrix a, μ, λ are the ramet coefficients, and are related only to the two material properties young's modulus K and poisson ratio V:
Figure BDA0003799612020000044
since the tetrahedral units are adopted to disperse the object volume domain, and the unit shape function adopts a linear lagrangian shape function, the deformation gradient corresponding to each unit is further expressed as:
Figure BDA0003799612020000051
wherein D s Is a matrix of shape functions, D m For reference to the shape function matrix, is a constant matrix, D s 、D m The vector expressions of (a) are:
D s =(x 0 -x 3 x 1 -x 3 x 2 -x 3 );
D m =(X 0 -X 3 X 1 -X 3 X 2 -X 3 );
for any tetrahedral unit of the soft tissue model, defining a unit volume domain as
Figure BDA0003799612020000057
The strain energy constraint function stored in a tetrahedral cell is:
Figure BDA0003799612020000052
wherein V is the unit volume when the tetrahedral unit is undeformed;
obtaining a stress tensor P (F) of the soft tissue model according to the deformation gradient F:
Figure BDA0003799612020000053
the stress tensor P (F) of the soft tissue model is further reduced to:
P(F)=F(2μE+λtr(E)I);
and obtaining the strain energy gradient according to the relation of the stress tensor and the deformation gradient as follows:
Figure BDA0003799612020000054
for the tetrahedral unit of the soft tissue model, only the strain energy gradient corresponding to 4 vertexes needs to be solved, and the method is defined as
Figure BDA0003799612020000055
i = {1,2,3,4}, the final expression of each tetrahedral strain energy gradient of the soft tissue model is obtained as:
Figure BDA0003799612020000056
according to the description, the strain energy constraint method suitable for flexible body deformation simulation is provided, and the method combines the computational efficiency advantage of position dynamics and the mature theoretical result of traditional continuous medium mechanics, so that the simulation is stable, efficient and controllable.
Optionally, the young's modulus K is [0.3,0.5] and the poisson's ratio V is [0.3,0.5].
Optionally, the step S24 includes:
the predicted position of each vertex p 0 ,p 1 ,...p n Substituting into a system constraint equation set;
at each iteration, for each constraint function C j (p) finding a suitable position correction Δ p to satisfy C j (p + Δ p) =0, then the constraint equations are linearized separately for each:
Figure BDA0003799612020000061
wherein the content of the first and second substances,
Figure BDA0003799612020000062
expressed as a constraint function C j (p) the gradient operator solver system limits Δ p to
Figure BDA0003799612020000063
The position correction amount Δ p of each vertex i of the soft tissue model can be obtained by solving the direction of (a) and taking the individual mass of the mass point into account i The derived formula is:
Figure BDA0003799612020000064
Figure BDA0003799612020000065
wherein s represents a Lagrange multiplier, and k is ∈ [0,1 ]]A parameter indicative of the stiffness of the steel sheet,
Figure BDA0003799612020000066
denotes the vector C (p) at p i A gradient operator in direction;
after the limited number of iterations is completed, a set of position corrections { Δp 0 ,Δp 1 ,...Δp n }。
Alternatively, the updating of the predicted speed in step S25 is to update the predicted speed by a second-order backward differential formula.
According to the description, an iteration method of a modified version is adopted, the n linear equations are split in each iteration, and each equation is independently linearized and solved, so that the calculation efficiency is obviously improved.
Optionally, the step S1 includes:
and (3) modeling the soft tissue by adopting a Saint-Venn-kirchhoff model to obtain a soft tissue model after simulation modeling.
Optionally, the number of iterations is [3,8], and the time step is [0.001,0.01].
According to the description, the deformation simulation effect based on the position dynamics also depends on the time step length and the iteration times, the range of the iteration times and the time step length is limited, and the collision simulation effect of soft tissues and the rigid ground is guaranteed.
In a second aspect, the present invention provides a soft tissue and rigid ground collision simulation device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a soft tissue and rigid ground collision simulation method of the first aspect when executing the computer program.
The technical effect corresponding to the soft tissue and rigid ground collision simulation device provided by the second aspect refers to the related description of the soft tissue and rigid ground collision simulation method provided by the first aspect.
Drawings
FIG. 1 is a schematic main flow chart of a soft tissue and rigid ground collision simulation method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a morph map according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating distance determination in environmental collision constraints according to an embodiment of the present invention;
fig. 4 is a schematic modeling diagram of a liver model 1 according to an embodiment of the present invention;
fig. 5 is a schematic diagram of modeling a liver model 2 according to an embodiment of the present invention;
fig. 6 is a schematic diagram of modeling a liver model 3 according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a simulation of a liver model 2 according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a simulation of a liver model 3 according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a simulation of a liver model 2 according to the prior art;
fig. 10 is a schematic structural diagram of a soft tissue and rigid ground collision simulation device according to an embodiment of the present invention.
[ description of reference ]
1: a soft tissue and rigid ground collision simulation device;
2: a processor;
3: a memory.
Detailed Description
In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Example one
Referring to fig. 1 to 8, a method for simulating collision between soft tissue and rigid ground includes the steps of:
s1, obtaining a soft tissue model after simulation modeling;
in this embodiment, step S1 includes:
and modeling the soft tissue by adopting a Saint Vietnam-kirchhoff model to obtain a soft tissue model after simulation modeling.
In the soft tissue model of this embodiment, the liver model, the elastic deformation will cause potential Energy to accumulate in the deformed object, and for the solid, the potential Energy is also called Strain Energy (Strain Energy), the material having the elastic potential Energy function is super elastic (superelastic) material, and common super elastic materials include rubber, sponge, and the like. Considering that rubber is commonly used as a manufacturing material of a human body model in real medical experiments, the liver is treated as a super-elastic material, and a StVK (Saint Venant-Kirchoff) model is adopted for modeling.
In this embodiment, three liver models with different accuracies are used to divide the liver. The relevant data before and after the subdivision of the three models are shown in table 1, and the subdivision effects are sequentially shown in fig. 4 to 6.
TABLE 1 tetrahedron subdivision data for liver models
Figure BDA0003799612020000081
S2, in each simulation step, calculating and obtaining the predicted position of each vertex on the soft tissue model at the next moment, correcting the predicted position of each vertex on the soft tissue model by taking a rigid ground as external constraint and taking strain energy constraint of a flexible object as internal constraint, and performing next-step model rendering and deformation calculation according to the corrected position of each vertex;
the position dynamics is suitable for simulating liquid, rigid bodies, flexible bodies and clothes, and deformation calculation of objects of different types is carried out under a unified simulation frame, so that interactive simulation among multiple objects can be conveniently realized in the same scene.
The position dynamics is different from a spring-mass point model and a finite element model in the calculation process, the spring-mass point model and the finite element model need to calculate the internal force and the external force of each node in each simulation step, new node speeds are calculated through resultant force, and then the positions are updated according to the speeds. The position dynamic model omits the calculation of a speed layer and directly processes position information, and the basic idea is to predict the position of a node at the next moment, correct the position through a constraint equation, project the position to the final position and update the speed by using the position. Thus, position dynamics has significant computational advantages, particularly in an interactive application environment.
In terms of physical reality, the position dynamics can not achieve the physical simulation result which is accurate enough like a finite element model, but can obtain a relatively real result by establishing a constraint equation based on continuous medium mechanics, and the visual rationality is ensured enough. Compared with a spring-particle model, the position dynamics has the capability of processing large deformation, can ensure the stability of the system even under an explicit time integration scene, and has controllability.
In summary, the position dynamics is a fast, stable and controllable deformation model, although the mechanical reality is somewhat deficient, considering that the study of the embodiment does not relate to the analysis of the liver biomechanics, mainly relates to the collision simulation of the liver and the rigid ground, and the interactive environment is an application background, the position dynamics is selected as the basic deformation model.
The position dynamics carries out mathematical modeling on the simulation object through a vertex set of the model and a group of constraint equations, the deformation of the object is realized through the displacement of the vertices, and the position relation between the vertices is limited through the constraint equations, so that the deformation behavior of the object is normalized. In each simulation step, the system needs to solve the constraint equation set and project the vertex to a new position according to the solution result.
In the position dynamics computation framework, each vertex i contains a mass m i Position x i Velocity v i Three basic attributes. The equation of motion for the vertices can be derived from newton's second law, as shown in equation 1.
Figure BDA0003799612020000101
Wherein the content of the first and second substances,
Figure BDA0003799612020000102
represents acceleration, f i Representing all the resultant forces acting on vertex i.
Thus, step S2 comprises:
step S21, during the first simulation step, initializing the basic attribute of each vertex on the soft tissue model:
Figure BDA0003799612020000103
wherein the basic attribute of each vertex comprises a mass m i Position x i Velocity v i
Step S22, in each simulation step, time integral calculation is carried out by using a fixed time step delta t to obtain the predicted speed { v ] of each vertex on the soft tissue model 0 ,v 1 ,...v n And predicted position p 0 ,p 1 ,...p n Predicting the position as an initial condition of constraint solving;
wherein the predicted velocity { v } for each vertex is calculated 0 ,v 1 ,...v n And predicted position p 0 ,p 1 ,...p n As shown in formulas 2 and 3:
v i (t n +Δt)=v i (t n )+Δtw i f i (t n ) (2)
p i (t n +Δt)=x i (t n )+Δtv i (t n +Δt) (3)
s23, according to the current simulation scene, taking external constraint of a rigid ground and strain energy constraint of a flexible object as internal constraint to jointly form a system constraint equation set;
among other things, position dynamics has the further advantage that the handling of collisions is very convenient and can also be implemented in the form of constraint equations. Collision constraints are external constraints that define the position constraint relationship between the model and other objects. The collision constraint equations are generated from the current positions of the vertices prior to performing the system solution. The collision constraint equation and the strain energy constraint equation are directly integrated to form a system equation set together, and the system equation set are solved together.
Considering simple environmental impact, i.e. impact between dynamic simulation object and other static solid, such as the simulation object falling under gravity, in order to prevent the simulation object from penetrating the wall surface, the projection position of the vertex needs to be limited within an effective range. Wherein the static solid comprises a floor, a wall, etc.
Thus, the external restraint with rigid ground in step S23 comprises:
regarding the collision constraint between the soft tissue model and the rigid ground as a distance constraint, the constraint function is as follows:
C(p)=(p-q s )·n s (4)
wherein p is any vertex on the soft tissue model, q s Representing the point on the collision contact surface closest to p, n s Is q s The normal vector of (c).
As shown in fig. 3, the object gradually falls to the ground under the action of gravity, and in this simulation scenario, it is required to ensure that equation (4) is not less than 0, that is, the collision constraint expression is: c (p) is not less than 0.
In the embodiment, a continuous medium mechanics theory is introduced under a basic calculation framework of position dynamics, and a strain energy constraint method suitable for flexible body deformation simulation is provided. The method combines the computational efficiency advantage of position dynamics and the mature theoretical achievement of traditional continuous medium mechanics, so that the simulation is stable, efficient and controllable. The embodiment introduces a strain energy function E s (x) Defining an energy constraint equation C (x) = E s (x) And =0. The energy function E will be given below s (x) The step S23 of calculating the strain energy constraint of the flexible object as the internal constraint includes:
and (3) showing the deformation of the soft tissue model as a continuous displacement field u, defining omega as a volume domain occupied by the soft tissue model, and obtaining an expression of an object deformation function phi (X) if X epsilon omega is any point of the soft tissue model in an undeformed state:
φ(X)=X+u=x (5)
wherein, the deformation function describes the mapping relation between the point X in the material space and the point X corresponding to the deformation, and the deformation gradient tensor F of the deformation function is:
Figure BDA0003799612020000111
the StVK model uses a non-linear Green-Lagrange strain tensor, and a strain tensor E is obtained from a deformation gradient tensor F as follows:
Figure BDA0003799612020000112
wherein I represents an identity matrix;
obtaining the strain energy density psi according to the deformation gradient tensor F and the strain tensor E s Comprises the following steps:
Figure BDA0003799612020000113
wherein E = tr (E) T E) The function tr (a) represents the trace of the matrix a, μ, λ are the lame coefficients, and are related only to the two material properties young's modulus K and poisson ratio V:
Figure BDA0003799612020000114
since the tetrahedral units are adopted to disperse the object volume domain, and the unit shape function adopts a linear lagrangian shape function, the deformation gradient corresponding to each unit is further expressed as:
Figure BDA0003799612020000121
wherein D s Is a matrix of shape functions, D m For reference to the shape function matrix, is a constant matrix, D s 、D m The vector expressions of (a) are:
D s =(x 0 -x 3 x 1 -x 3 x 2 -x 3 ) (11)
D m =(X 0 -X 3 X 1 -X 3 X 2 -X 3 ) (12)
for any tetrahedral unit of the soft tissue model, defining the unit volume domain as
Figure BDA0003799612020000128
The strain energy constraint function stored in a tetrahedral cell is:
Figure BDA0003799612020000122
wherein V is the unit volume when the tetrahedral unit is undeformed;
and obtaining the stress tensor P (F) of the soft tissue model according to the deformation gradient F:
Figure BDA0003799612020000123
the stress tensor P (F) of the soft tissue model is further simplified, and concretely, the equation (8) is substituted into the equation (14) to obtain:
Figure BDA0003799612020000124
a differential expression of the strain tensor can be obtained from equation (7), as shown in equation (15):
Figure BDA0003799612020000125
by substituting equation (16) for equation (15), the final relation between stress tensor and deformation gradient can be obtained, as shown in equation (17):
P(F)=F(2μE+λtr(E)I) (17)
and obtaining the strain energy gradient according to the relation of the stress tensor and the deformation gradient as follows:
Figure BDA0003799612020000126
for the tetrahedral unit of the soft tissue model, only the strain energy gradient corresponding to 4 vertexes needs to be solved, and the method is defined as
Figure BDA0003799612020000127
i = {1,2,3,4}, the final expression of each tetrahedral strain energy gradient for the soft tissue model is then:
Figure BDA0003799612020000131
step S24, predicting position { p ] of each vertex 0 ,p 1 ,...p n Substituting the correction value into a system constraint equation set, solving by using a Gauss-Seidel iteration method, limiting the iteration times, and solving to obtain a set of position correction values (delta p) 0 ,Δp 1 ,...Δp n };
If a set of equations containing n constraint equations is solved by using a newton iteration method, each iteration needs to solve and calculate an n × n linear equation set, and the calculation amount is large, so that the simulation system is affected. Therefore, the solution system adopts a modified version of iteration method, each iteration is carried out by splitting the n linear equations, and each equation is independently linearized and solved. Bender et al verified that the method is significantly faster in computational efficiency than the Newton iteration method and only slightly worse in convergence than the Newton iteration method.
Thus, step S24 includes:
the predicted position of each vertex p 0 ,p 1 ,...p n Substituting into a system constraint equation set;
at each iteration, for each constraint function C j (p) finding a suitable position correction Δ p to satisfy C j (p + Δ p) =0, then the constraint equations are linearized separately for each:
Figure BDA0003799612020000132
wherein the content of the first and second substances,
Figure BDA0003799612020000133
expressed as a constraint function C j (p) the gradient operator solver system limits Δ p to
Figure BDA0003799612020000134
The position correction amount Δ p of each vertex i of the soft tissue model can be obtained by solving for the direction of (a) and taking into account the individual mass of the mass point i The derived formula is:
Figure BDA0003799612020000135
Figure BDA0003799612020000136
wherein s represents a Lagrange multiplier, and k is ∈ [0,1 ]]Which is indicative of a stiffness parameter of the steel,
Figure BDA0003799612020000137
denotes the vector C (p) at p i A gradient operator in direction;
after the limited number of iterations is completed, a set of position corrections { Δ p is obtained 0 ,Δp 1 ,...Δp n }. Step S25, using the position correction amount { Δ p } 0 ,Δp 1 ,...Δp n Correcting the predicted position of each vertex { p } 0 ,p 1 ,...p n Using the corrected predicted position { x } 0 ,x 1 ,...x n And updating the position attribute of the vertex and the prediction speed, and then performing the next step of model rendering and deformation calculation according to the corrected position of each vertex.
Wherein, updating the prediction speed is updating the prediction speed through a second-order backward differential formula, and specifically comprises the following steps:
Figure BDA0003799612020000141
and S3, repeatedly executing the calculation of the next simulation step until the simulation is finished.
Therefore, the simulation verification of the liver model in combination with step S2 and step S3 is specifically as follows:
for the simulation material, there are two controllable parameters: stiffness coefficient k, poisson ratio v. The stiffness coefficient is defined as the strength of constraint, the larger the stiffness parameter is, the more difficult the deformation is generated, and the poisson ratio is the ratio of the absolute value of transverse positive strain and axial positive strain when the material is unidirectionally pulled or pressed, and is also called as the transverse deformation coefficient, which is the elastic constant reflecting the transverse deformation of the material. For the solution system, there are also two controllable parameters: the number of iterations and the time step. The more the iteration times, the more accurate the solution result, but the solution time will be increased correspondingly, and the shorter the time step, the faster the update speed of the vertex position is, the more accurate the simulation result is, but the same system calculation load will be increased correspondingly. To facilitate analytical comparisons, the same parameters were used in all verifications and in all models: k =0.4, v =0.4, the number of iterations is taken to be 5, and the time step is taken to be 0.005. In other embodiments, the Young's modulus K is [0.3,0.5] and the Poisson's ratio V is [0.3,0.5]. Optionally, the number of iterations is [3,8] and the time step is [0.001,0.01].
Experiment 1: collision restraint test
For better result comparison and performance analysis, in this embodiment, besides the test of the interactive external force algorithm, the present embodiment will only consider the deformation influence of gravity on the model. And in order to achieve better simulation effect, environmental collision constraint must be realized first. Therefore, the effect of the environmental impact constraint is first experimentally analyzed in experiment 1.
Before the environmental collision constraint is not added, the system does not incorporate the constraint influence of the floor into the deformation calculation, so that when the liver model hits the floor in the descending process, the due collision effect is not generated, and the liver model directly passes through the floor to continue to fall, as shown in fig. 9.
After the environmental collision constraint is added, the system judges and corrects the position validity of the model in each step of deformation calculation, so that the motion space of the model is limited within a limited range, namely above the floor. The deformation state of the liver model before the liver model is not contacted with the floor is consistent with the deformation state of the liver model when the liver model is not constrained, the liver model stops falling immediately once being contacted with the floor, reasonable collision rebound effect is generated under the collision action of the floor until the liver model is finally stopped on the floor, and the complete falling process is shown in figure 7.
The experimental result shows that the environmental collision constraint is applied to the collision interaction scene of the dynamic simulation object and the static environment object to achieve a better effect, the activity space of the liver model can be limited within a limited range, and necessary collision reaction is generated, so that the simulation result is more reasonable and more real.
Experiment 2: performance analysis
According to the theoretical discussion of the previous embodiment, in the deformation model based on the position dynamic strain energy constraint, the number of equations of the system constraint equation set is consistent with the number of model units. In order to verify the performance influence of the number of model units on the deformation simulation, in addition to performing experiments by using 3 liver models in step S1, a model with 12829 units is selected as a reference. Several experimental models are affected only by gravity, and all the experimental models collide with the floor in the falling process, wherein the simulation effect of the liver model 3 is shown in fig. 8.
The average solution time for the 3 model deformation calculations is shown in table 1:
TABLE 1 mean solution time for deformation simulation
Model (model) Number of units Mean solution time (ms) Unit mean time (ms)
Liver model 1 596 0.50 8.39×10 -4
Liver model 2 5395 5.20 9.64×10 -4
Liver model 3 7325 6.80 9.28×10 -4
Reference model 12829 12.96 1.01×10 -3
The experimental results show that the system solution time increases with the number of units. In order to quantitatively explain the relationship between the system solution time and the number of the units, the average solution time in the table is divided by the number of the units to obtain the average solution time of the constraint equation corresponding to each unit, the unit average solution times of the 3 models are approximately equal, and the system solution time and the number of the units are approximately in a linear relationship. Meanwhile, experimental results also verify the feasibility of the simulation method provided by the embodiment in coping with model simulation with greater accuracy with the number of units exceeding 10000.
Because each equation in the system constraint equation set is solved independently in the position dynamics, the parallel computation can be adopted to further improve the solving speed of the system by utilizing the characteristic. In this embodiment, openMP is used to implement multi-thread parallel computation, and experimental comparison is performed with a single-thread solving system, where the experimental results are shown in table 2. Experimental results show that the solution time of the system can be effectively shortened and the simulation efficiency of the system can be increased by adopting OpenMP multithreading parallel computing. Meanwhile, experiments show that the advantage of multi-thread parallel computing is more remarkable along with the increase of the number of units. This also further improves the feasibility of location dynamics in simulation scenarios with large-scale meshes.
TABLE 2 comparison of Single-threaded, multithreaded solution System Performance
Model (model) Single thread solution time (ms) OpenMP multithreading solution time (ms) Acceleration ratio
Liver model
1 0.50 0.40 1.25
Liver model 2 5.20 1.85 2.81
Liver model 3 6.80 2.10 3.24
Reference model 12.96 3.77 3.44
Therefore, according to the characteristics of the simulation scene, the position dynamics is selected as a basic deformation model. And adopting strain energy constraint as internal constraint and environmental collision constraint as external constraint, forming a system constraint equation set by the strain energy constraint and the environmental collision constraint, and solving the equation set to obtain a new position of the model vertex so as to realize deformation simulation. Finally, the feasibility of the deformation simulation method is verified through experiments, and experimental results prove that the simulation method is stable and efficient, has better physical reality and can basically meet the requirement of collision simulation of soft tissues and a rigid ground in a virtual three-dimensional scene.
Example two
Referring to fig. 10, a collision simulation apparatus 1 for soft tissue and rigid ground includes a memory 3, a processor 2 and a computer program stored in the memory 3 and capable of running on the processor 2, wherein the processor 2 implements the steps of the first embodiment when executing the computer program.
Since the apparatus/device described in the above embodiments of the present invention is an apparatus/device used for implementing the method of the above embodiments of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus/device based on the method described in the above embodiments of the present invention, and therefore, the detailed description thereof is omitted here. All the devices/apparatuses adopted in the method of the above embodiments of the present invention are within the intended protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the terms first, second, third and the like are for convenience only and do not denote any order. These words are to be understood as part of the name of the component.
Furthermore, it should be noted that in the description of the present specification, the description of the term "one embodiment", "some embodiments", "examples", "specific examples" or "some examples", etc., means that a specific feature, structure, material or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Moreover, various embodiments or examples and features of various embodiments or examples described in this specification can be combined and combined by one skilled in the art without being mutually inconsistent.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, the claims should be construed to include preferred embodiments and all changes and modifications that fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include such modifications and variations.

Claims (10)

1. A soft tissue and rigid ground collision simulation method is characterized by comprising the following steps:
s1, obtaining a soft tissue model after simulation modeling;
s2, in each simulation step, calculating and obtaining the predicted position of each vertex on the soft tissue model at the next moment, correcting the predicted position of each vertex on the soft tissue model by taking the rigid ground as external constraint and taking the strain energy constraint of a flexible object as internal constraint, and performing model rendering and deformation calculation of the next step according to the corrected position of each vertex;
and S3, repeatedly executing the calculation of the next simulation step until the simulation is finished.
2. The method for simulating the collision of the soft tissue with the rigid ground as claimed in claim 1, wherein the step S2 comprises:
step S21, during the first simulation step, initializing the basic attribute of each vertex on the soft tissue model:
Figure FDA0003799612010000011
wherein the basic attribute of each vertex comprises a mass m i Position x i Velocity v i
S22, in each simulation step, performing time integral calculation by using a fixed time step delta t to obtain the predicted speed { v ] of each vertex on the soft tissue model 0 ,v 1 ,...v n H and predicted position p 0 ,p 1 ,...p n The predicted position serves as an initial condition for constraint solving;
s23, according to the current simulation scene, taking the external constraint of the rigid ground and the strain energy constraint of the flexible object as internal constraints to jointly form a system constraint equation set;
step S24, predicting position { p ] of each vertex 0 ,p 1 ,...p n Substituting the correction value into a system constraint equation set, solving by using a Gauss-Seidel iteration method, limiting the iteration times, and solving to obtain a set of position correction values (delta p) 0 ,Δp 1 ,...Δp n };
Step S25, using the position correction amount { Δ p 0 ,Δp 1 ,...Δp n Correcting the predicted position of each vertex { p } 0 ,p 1 ,...p n Using the corrected predicted position { x } 0 ,x 1 ,...x n Updating the vertex position attribute and updating the prediction speed, and then performing next-step model rendering and deformation calculation according to the corrected position of each vertex.
3. The method for simulating the collision of the soft tissue with the rigid ground as claimed in claim 2, wherein the step S23 of externally constraining the rigid ground comprises:
considering a collision constraint between the soft tissue model and the rigid ground as a distance constraint whose constraint function is:
C(p)=(p-q s )·n s ≥0;
wherein p is any vertex on the soft tissue model, q s Representing the point on the collision contact surface closest to p, n s Is q s The normal vector of (a).
4. The method for simulating the collision of the soft tissue and the rigid ground according to claim 2, wherein the step S23 of constraining the strain energy of the flexible object as the internal constraint comprises:
and (2) showing the deformation of the soft tissue model as a continuous displacement field u, defining omega as a volume domain occupied by the soft tissue model, and obtaining an expression of an object deformation function phi (X) if X epsilon omega is any point of the soft tissue model in an undeformed state:
φ(X)=X+u=x;
the deformation function describes a mapping relation between a point X in a material space and a point X corresponding to the deformation, and a deformation gradient tensor F of the deformation function is as follows:
Figure FDA0003799612010000021
the strain tensor E can be found from the deformation gradient tensor F as follows:
Figure FDA0003799612010000022
wherein I represents an identity matrix;
obtaining the strain energy density psi according to the deformation gradient tensor F and the strain tensor E s Comprises the following steps:
Figure FDA0003799612010000023
wherein E = tr (E) T E) The function tr (a) represents the trace of the matrix a, μ, λ are the lame coefficients, and are related only to the two material properties young's modulus K and poisson ratio V:
Figure FDA0003799612010000024
because the tetrahedral units are adopted to disperse the object volume domain, and the unit shape function adopts a linear Lagrange shape function, the deformation gradient tensor F corresponding to each unit can be further expressed as follows:
Figure FDA0003799612010000025
wherein D s Is a matrix of shape functions, D m For reference to the shape function matrix, is a constant matrix, D s 、D m The vector expressions of (a) are:
D s =(x 0 -x 3 x 1 -x 3 x 2 -x 3 );
D m =(X 0 -X 3 X 1 -X 3 X 2 -X 3 );
for any tetrahedral unit of the soft tissue model, defining a unit volume domain as
Figure FDA0003799612010000031
The strain energy constraint function stored in a tetrahedral cell is:
Figure FDA0003799612010000032
wherein V is the unit volume when the tetrahedral unit is undeformed;
obtaining a stress tensor P (F) of the soft tissue model according to the deformation gradient F:
Figure FDA0003799612010000033
the stress tensor P (F) of the soft tissue model is further reduced to:
P(F)=F(2μE+λtr(E)I);
and obtaining the strain energy gradient according to the relation of the stress tensor and the deformation gradient as follows:
Figure FDA0003799612010000034
for the tetrahedral unit of the soft tissue model, only the strain energy gradient corresponding to 4 vertexes needs to be solved, and the method is defined as
Figure FDA0003799612010000035
Obtaining a final expression of each tetrahedral strain energy gradient of the soft tissue model as follows:
Figure FDA0003799612010000036
5. the method for simulating the collision of the soft tissue and the rigid ground, according to claim 4, wherein the Young's modulus K is [0.3,0.5] and the Poisson's ratio V is [0.3,0.5].
6. The method for simulating collision of soft tissue with rigid ground according to claim 2, wherein the step S24 comprises:
the predicted position of each vertex p 0 ,p 1 ,...p n Substituting into a system constraint equation set;
at each iteration, for each constraint function C j (p) finding a suitable position correction Δ p to satisfy C j (p + Δ p) =0, then the constraint equations are linearized separately for each:
Figure FDA0003799612010000037
wherein,
Figure FDA0003799612010000041
Expressed as a constraint function C j (p) the gradient operator solver system limits Δ p to
Figure FDA0003799612010000042
Is calculated, and the position correction amount Δ p for each vertex i of the soft tissue model is obtained by taking the individual mass of the mass point into account i The derived formula is:
Figure FDA0003799612010000043
Figure FDA0003799612010000044
wherein s represents a Lagrange multiplier, and k is ∈ [0,1 ]]Which is indicative of a stiffness parameter of the steel,
Figure FDA0003799612010000045
denotes the vector C (p) at p i A gradient operator in direction;
after the limited number of iterations is completed, a set of position corrections { Δ p is obtained 0 ,Δp 1 ,...Δp n }。
7. The method for simulating the collision of a soft tissue with a rigid ground as claimed in claim 4, wherein the step S25 of updating the predicted velocity is to update the predicted velocity by a second-order backward differential formula.
8. The method for simulating the collision of the soft tissue with the rigid ground according to any one of claims 1 to 7, wherein the step S1 comprises:
and modeling the soft tissue by adopting a Saint Vietnam-kirchhoff model to obtain a soft tissue model after simulation modeling.
9. The method for simulating the collision of a soft tissue with a rigid ground according to any one of claims 2 to 7, wherein the number of iterations is [3,8] and the time step is [0.001,0.01].
10. A soft tissue and rigid ground collision simulation device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a soft tissue and rigid ground collision simulation method according to any one of claims 1 to 9 when executing the computer program.
CN202210979062.6A 2022-08-16 2022-08-16 Collision simulation method and device for soft tissue and rigid ground Pending CN115455753A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210979062.6A CN115455753A (en) 2022-08-16 2022-08-16 Collision simulation method and device for soft tissue and rigid ground

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210979062.6A CN115455753A (en) 2022-08-16 2022-08-16 Collision simulation method and device for soft tissue and rigid ground

Publications (1)

Publication Number Publication Date
CN115455753A true CN115455753A (en) 2022-12-09

Family

ID=84299044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210979062.6A Pending CN115455753A (en) 2022-08-16 2022-08-16 Collision simulation method and device for soft tissue and rigid ground

Country Status (1)

Country Link
CN (1) CN115455753A (en)

Similar Documents

Publication Publication Date Title
Müller et al. Position based dynamics
Overby et al. ADMM $\supseteq $ projective dynamics: Fast simulation of hyperelastic models with dynamic constraints
Sifakis et al. FEM simulation of 3D deformable solids: a practitioner's guide to theory, discretization and model reduction
US7650266B2 (en) Method of simulating deformable object using geometrically motivated model
San-Vicente et al. Cubical mass-spring model design based on a tensile deformation test and nonlinear material model
CN107330972B (en) Real-time soft tissue deformation method and system for simulating biomechanical characteristics
Jaiman et al. Transient fluid–structure interaction with non-matching spatial and temporal discretizations
Lee et al. Multi‐resolution cloth simulation
Sun et al. Topology optimization based on level set for a flexible multibody system modeled via ANCF
CN112749518A (en) Computer system for simulating physical process
US20230061175A1 (en) Real-Time Simulation of Elastic Body
JP2020115343A (en) Computer simulation of physical fluid in mesh of arbitrary coordinate system
CN109002630B (en) Rapid simulation method for super-elastic material
Marinkovic et al. Towards real-time simulation of deformable structures by means of co-rotational finite element formulation
Li et al. Numerical method of fabric dynamics using front tracking and spring model
CN115455753A (en) Collision simulation method and device for soft tissue and rigid ground
Zhou et al. Plausible cloth animation using dynamic bending model
Volino et al. Stop-and-go cloth draping
Wang et al. Explicit dynamic analysis of sheet metal forming processes using linear prismatic and hexahedral solid-shell elements
Rath et al. An interface preserving and residual-based adaptivity for phase-field modeling of fully Eulerian fluid-structure interaction
Cetinaslan ESPEFs: exponential spring potential energy functions for simulating deformable objects
Yinghui et al. Real-time deformation using modal analysis on graphics hardware
Wood et al. A dynamically adaptive lattice Boltzmann method for flapping wing aerodynamics
CN115393545B (en) Collision processing method, system, equipment and medium based on deformable grid
JP2009301149A (en) Structural analysis method by nonlinear finite element method and program, recording medium, simulation apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination