CN-121983154-A - Particle simulation method and device, electronic equipment, storage medium and program product
Abstract
The disclosure provides a particle simulation method and device, electronic equipment, storage medium and program product, wherein the method comprises the steps of determining a particle distance between a first particle and a second particle according to first position information of the first particle and second position information of the second particle, wherein the first particle and the second particle are any two of a plurality of simulation particles to be analyzed in a simulation task; the method comprises the steps of determining interaction weights between first particles and second particles according to a preset cut-off radius interval and the particle distance, determining acting forces between the first particles and the second particles based on the interaction weights, and executing the simulation task according to the acting forces between the simulation particles to obtain simulation results of the simulation task. According to the embodiment of the disclosure, the accuracy of the acting force among the particles can be ensured, and the accuracy of the particle simulation task is improved.
Inventors
- Request for anonymity
Assignees
- 摩尔线程智能科技(北京)股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260327
Claims (12)
- 1. A particle simulation method, comprising: Determining a particle distance between a first particle and a second particle according to first position information of the first particle and second position information of the second particle, wherein the first particle and the second particle are any two of a plurality of simulation particles to be analyzed in a simulation task; determining an interaction weight between the first particle and the second particle according to a preset cut-off radius interval and the particle distance, wherein the interaction weight continuously changes in the cut-off radius interval along with the change of the particle distance; Determining a force between the first particle and the second particle based on the interaction weight; And executing the simulation task according to the acting force among the plurality of simulation particles to obtain a simulation result of the simulation task.
- 2. The method of claim 1, wherein the truncation radius interval includes a minimum truncation radius and a maximum truncation radius; The determining the interaction weight between the first particle and the second particle according to the preset truncated radius interval and the particle distance comprises the following steps: determining an interaction weight between the first particle and the second particle as a preset value in the case that the particle distance is less than or equal to the minimum cutoff radius, wherein the preset value is greater than 0; Determining an interaction weight between the first particle and the second particle to be 0 in the case that the particle distance is greater than or equal to the maximum truncation radius; And determining an interaction weight between the first particle and the second particle according to the particle distance, the minimum truncation radius and the maximum truncation radius when the particle distance is larger than the minimum truncation radius and smaller than the maximum truncation radius.
- 3. The method of claim 2, wherein the determining the interaction weight between the first particle and the second particle based on the particle distance, the minimum cutoff radius, and the maximum cutoff radius comprises: determining a radius sum of the minimum cutoff radius and the maximum cutoff radius, and a radius difference of the minimum cutoff radius and the maximum cutoff radius; and processing the particle distance, the radius sum and the radius difference based on a smoothing function to obtain the interaction weight.
- 4. A method according to any one of claims 1-3, wherein said determining a force between said first particle and said second particle based on said interaction weight comprises: determining that the applied force is 0, in the case that the interaction weight is 0; In the case that the interaction weight is not 0, determining a target particle potential energy of the first particle according to the interaction weight, and determining the acting force according to the target particle potential energy.
- 5. The method of claim 4, wherein the determining the target particle potential energy of the first particle based on the interaction weight and determining the effort based on the target particle potential energy comprises: Determining initial particle potential energy of the first particle according to the interaction weight; determining a target particle potential of the first particle based on the interaction weight and the initial particle potential; A force between the first particle and the second particle is determined based on the target particle potential energy and the particle distance.
- 6. The method of claim 5, wherein the determining the initial particle potential energy of the first particle from the interaction weight comprises: determining a target calculation mode for calculating the potential energy of the initial particle according to the interaction weight and a preset weight threshold; And determining the initial particle potential energy based on the target calculation mode.
- 7. The method of claim 6, wherein determining a target calculation mode for calculating the initial particle potential energy based on the interaction weight and a preset weight threshold comprises: Determining the target computing mode in a first candidate computing set under the condition that the interaction weight is greater than or equal to the preset weight threshold, wherein the computing precision of a plurality of computing modes in the first candidate computing set is in a first precision range and the computing speed is in a first speed range; And under the condition that the interaction weight is smaller than the preset weight threshold, determining the target calculation mode in a second candidate calculation set, wherein the calculation precision of a plurality of calculation modes in the second candidate calculation set is in a second precision range, the calculation speed is in a second speed range, the first precision range is higher than the second precision range, and the first speed range is lower than the second speed range.
- 8. A method according to any of claims 1-3, wherein said performing said simulation task based on forces between said plurality of simulation particles comprises: respectively updating the motion state of each simulation particle according to acting force among the simulation particles; And executing the simulation task based on the motion state of each simulation particle.
- 9. A particle simulation apparatus, comprising: The device comprises a distance determining module, a first particle detection module and a second particle detection module, wherein the distance determining module is configured to determine a particle distance between a first particle and a second particle according to first position information of the first particle and second position information of the second particle, and the first particle and the second particle are any two of a plurality of simulation particles to be analyzed in a simulation task; A weight determination module configured to determine an interaction weight between the first particle and the second particle according to a preset truncated radius interval and the particle distance, wherein the interaction weight continuously changes within the truncated radius interval as the particle distance changes; A force determination module configured to determine a force between the first particle and the second particle based on the interaction weight; and the simulation module is configured to execute the simulation task according to the acting force among the plurality of simulation particles to obtain a simulation result of the simulation task.
- 10. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
- 11. A computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the method according to any of claims 1-8.
- 12. A computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, performs the method of any one of claims 1-8.
Description
Particle simulation method and device, electronic equipment, storage medium and program product Technical Field The present disclosure relates to the field of computer technology, and in particular, to a particle simulation method and apparatus, an electronic device, a computer readable storage medium, and a computer program product. Background In recent years, particle simulation technology, which is an important technology in computer graphics, physical simulation and computational science, is increasingly applied to various technical fields, and represents the overall dynamics of a complex system by simulating individual behaviors and interactions of a large number of minute particles. Thus, the behavior and interactions between particles severely affect the accuracy of particle simulation. In molecular dynamics (Molecular Dynamics, MD) simulation, in order to calculate the interaction forces between particles, a potential function is often used to sum each pair of particles. Since the inter-particle forces decay with distance, in order to reduce the amount of computation, a cut-off radius (cutoff radius) is usually introduced for computation, i.e. when the inter-particle distance is greater than this radius, the inter-particle forces are considered negligible. However, in practical applications, there are various particle systems, some of which have uniform densities and some of which have non-uniform densities, and for non-uniform particle systems, it is difficult to ensure the accuracy of the interaction force between particles determined in different particle systems, so that the accuracy of the simulation result of the particle simulation task based on the interaction force between particles may be affected. Disclosure of Invention The present disclosure provides a particle simulation method and apparatus, an electronic device, a computer readable storage medium, and a computer program product. In a first aspect, the present disclosure provides a particle simulation method, including: determining a particle distance between a first particle and a second particle according to first position information of the first particle and second position information of the second particle, wherein the first particle and the second particle are any two of a plurality of simulation particles to be analyzed in a simulation task; Determining interaction weight between the first particles and the second particles according to a preset cut-off radius interval and a particle distance, wherein the interaction weight continuously changes in the cut-off radius interval along with the change of the particle distance; determining a force between the first particle and the second particle based on the interaction weight; And executing the simulation task according to the acting force among the plurality of simulation particles to obtain a simulation result of the simulation task. In a second aspect, the present disclosure provides a particle simulation apparatus, comprising: The distance determining module is configured to determine a particle distance between a first particle and a second particle according to first position information of the first particle and second position information of the second particle, wherein the first particle and the second particle are any two of a plurality of simulation particles to be analyzed in a simulation task; The weight determining module is configured to determine an interaction weight between the first particle and the second particle according to a preset truncated radius interval and a particle distance, wherein the interaction weight continuously changes in the truncated radius interval along with the change of the particle distance; A force determination module configured to determine a force between the first particle and the second particle based on the interaction weight; The simulation module is configured to execute a simulation task according to acting forces among the plurality of simulation particles to obtain a simulation result of the simulation task. In a third aspect, the present disclosure provides an electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executable by the at least one processor to enable the at least one processor to perform the particle simulation method described above. In a fourth aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the particle simulation method described above. In a fifth aspect, the present disclosure provides a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an el