Method for realizing inter-particle short-range interaction calculation in EAM force field based on RBL algorithm
By adopting a method based on RBL algorithm in molecular dynamics simulation, using vector data structures and Reduce operators, combined with mesh division and random batching technology, the memory usage and calculation efficiency problems of short-range interaction between particles in large-scale particle systems are solved, and the effect of efficient calculation of short-range interaction between EAM particles is achieved.
Patent Information
- Application Number
- CN202411913595.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-04
AI Technical Summary
When simulating large-scale particle systems, existing molecular dynamics software is difficult to effectively describe the potential energy of short-range interactions between particles due to its high memory usage and low computational efficiency, which limits the cross-scale research of the material phase change process.
Using the RBL algorithm-based method, the vector data structures Group_Id and Group_Position are designed, combined with the Reduce operator and meshing technology, different scopes are divided and the random batch method is used to filter neighbor particles in the CS shell domain to reduce the number of neighbor particles and reduce the calculation cost.
It significantly improves the computing efficiency, reduces the computational complexity, and can efficiently realize the calculation of short-range interaction between EAM particles, and is suitable for the simulation of large-scale particle systems.
Smart Images

Figure CN119763689A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of molecular dynamics, and in particular relates to a method for realizing the calculation of short-range interactions between particles in an EAM force field based on an RBL algorithm. Background Art
[0002] During the molding and use process, materials will undergo phase change behaviors to varying degrees, such as cracks, dislocations, fractures, etc. The study of the phase change behavior of phase change materials is an important frontier in current materials research. It is of great significance for understanding the relationship between the microstructure and macroscopic properties of materials and the design of material properties (such as fatigue resistance).
[0003] Related research shows that the phase change process of materials is actually a multi-physical process involving multiple characteristic spaces and time scales from microscopic to macroscopic, and its mechanical behavior exhibits strong non-equilibrium, nonlinear and multi-scale effects. The current mainstream theoretical and simulation research methods focus on a single scale and lack effective tools for cross-scale research.
[0004] As a powerful computational tool, molecular dynamics simulation can simulate the movement and interaction of materials at the atomic level, providing a potential opportunity for a deeper understanding of the phase change process of materials. By simulating the atomic structure and behavior of materials such as alloys under different temperature, pressure and alloy composition conditions, the details of their phase change mechanism, crystal structure changes and thermodynamic properties can be revealed. One of the main difficulties in applying molecular dynamics to cross-scale research on materials is that the actual phase change scale is at the micron level, while the current mainstream molecular dynamics software is limited to the nanometer simulation scale. Its main bottleneck lies in the challenges of high memory usage in large-scale calculations to describe the potential energy of short-range interactions between particles.
[0005] The EAM (Embedded Atom Method) force field describes the effect of the electron density of other atoms on the interaction of the central atom. It is the result of two-body interaction and multi-body interaction. It is mainly used in metal and alloy systems and can predict the mechanical and mechanical properties of materials. In addition, the EAM force field is also a short-range interaction.
[0006] In the actual calculation of short-range interactions, in order to accelerate convergence, a cutoff distance is generally set, that is, taking a certain particle as the center, taking all particles within the cutoff radius, and calculating the short-range interactions of the surrounding neighboring particles of the particle according to the LJ potential energy function. Based on this calculation method, researchers have invented more optimized short-range interaction calculation methods, such as the Verlet neighbor list algorithm (Verlet list), the cell linked list algorithm (Cell linked list), etc., which are all variants of the above-mentioned calculation of short-range interactions. However, with the increase in the scale of the computing system (number of particles), the above-mentioned short-range interaction algorithms have significant problems such as excessive memory usage and low computational efficiency. The main reasons are:
[0007] The current mainstream computing architecture is based on the von Neumann architecture, which separates computing units from storage units, i.e., "storage-computing separation". However, with the failure of "Moore's Law" and the widespread application of multi-core processor architectures, computer systems based on the von Neumann architecture have gradually exposed their limitations. In large-scale computing clusters, the huge gap between the data transmission speed between the CPU and memory and the floating-point computing performance limits the application of computers on a larger time and space scale, leading to the famous "von Neumann bottleneck".
[0008] Therefore, for the simulation of large-scale particle systems, the "storage and computation separation" architecture will lead to excessive computer memory usage. At the same time, when calculating the short-range interactions of particles, the communication between the computer and the memory will also be limited due to the need to build a larger neighbor list, seriously affecting the computing efficiency. Summary of the invention
[0009] In order to solve the above technical problems, the present invention provides a method for calculating the short-range interaction between particles in the EAM force field based on the RBL algorithm, comprising the following steps:
[0010] S1: Design a vector data structure Group_Id that stores the ID vectors of each neighbor particle and a vector data structure Group_Position that embeds the coordinate Position vectors of each neighbor particle. The above two data structures are used to store the relevant information of the neighbor list when calculating the short-range interaction force;
[0011] The data structure of the Group_Id is: Vector <Vector <int>>, where the innermost Vector <int>is the neighbor particle ID vector;
[0012] The data structure of the Group_Position is: Vector <Vector<Vector <float>>>, the innermost Vector <float>The 3D coordinate position representing the position of the neighbor particle;
[0013] S2: Design Reduce operator for addition operation in large-scale particle computing;
[0014] S3: Construct a unit size of r in the particle space through mesh division operation s The grid domain Cell List is obtained and preprocessed;
[0015] S4: Based on the Cell List grid domain, divide the particles in space and make the distance between particles smaller than r s The area is set as S sphere, and the particle distance is greater than r s Less than r c The area is set as the CS sphere; where r c Search radius for neighbor list;
[0016] S5: For all particles in the computational domain, whose particle numbers are 0, 1, ..., i, a neighbor list search is performed;
[0017] S6: By traversing the grid cells in the Cell List grid domain, the neighbor particles that meet the calculation conditions are screened out;
[0018] S7: Calculate the short-range forces between all neighbor particles and the central particle in the S sphere and CS sphere respectively;
[0019] S8: The short-range force of each particle in the S sphere and the short-range force of each particle in the CS sphere are added correspondingly to obtain the temporary short-range force of each atom. The temporary short-range force of each particle is added through the Reduce operator to obtain the short-range force correction term, and the short-range force correction term is subtracted from the temporary short-range force of each particle to obtain the actual short-range force of each particle.
[0020] Beneficial effects of the present invention:
[0021] Based on the traditional method for calculating short-range interaction forces, the present invention divides the action domains into different ones and uses a random batch method to screen the neighbor particles in the CS shell domain under the conditions that the short-range action influence factors of neighbor particles at different distances on the central particle are different. This greatly reduces the number of neighbor particles calculated, reduces the calculation cost, and improves the calculation efficiency.
[0022] The present invention efficiently realizes the calculation of the short-range interaction of EAM particles, introduces random forces by spherical domain division, greatly reduces the number of neighboring particles to reduce the calculation complexity, and greatly improves the calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 Schematic diagram of traditional short-range neighbor particle search;
[0024] Figure 2 This is a schematic diagram of the neighboring particle search by region according to the present invention;
[0025] Figure 3 This is a comparison diagram of the total potential energy of the EAM of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] exist Figure 1 The traditional method for calculating short-range interaction forces is shown in the figure. In addition to setting the empirical cutoff radius r c In addition, a particle safety distance / safety threshold d is set to form the neighbor radius r for actually searching for particles. v When calculating the short-range interaction force of particles and using it to update the particle's motion, r v Particles inside and outside the sphere will not frequently shuttle through the neighborhood range, and particle movement is relatively safe. When calculating the short-range interaction force at each step, there is no need to constantly update the neighbor information within the particle neighborhood radius. Although this truncation technique can reduce the necessary amount of calculation, the number of particles within the truncation sphere is still quite large.
[0028] In order to reduce the number of calculated particles, reduce the calculation cost, and improve the calculation efficiency, the present invention proposes a method for calculating the short-range interaction between particles in the EAM force field based on the RBL algorithm, comprising:
[0029] S1: Design a vector data structure Group_Id to store the ID vectors of each neighbor particle (its data structure is: Vector <Vector <int>>, where the innermost Vector <int>is the neighbor particle Id vector) and the vector data structure Group_Position that embeds the coordinate Position vectors of each neighbor particle (its data structure is: Vector <Vector<Vector <float>>>, the innermost Vector <float>The three-dimensional coordinate position representing the position of the neighbor particle. The above two data structures are used to store the relevant information of the neighbor list when calculating the short-range interaction force;
[0030] S2: Design the Reduce operator, which is used for addition operations in large-scale particle computing;
[0031] S3: Construct a unit size of r in the particle space through mesh division operation s The grid domain Cell List is obtained and preprocessed;
[0032] S4: Based on the Cell List grid domain, divide the particles in the space and make the radius (particle spacing) smaller than r s The area is set as S sphere, and the radius is greater than r s Less than r c The area is set as CS sphere;
[0033] S5: For all particles in the computational domain (particle numbers are 0, 1, ..., i), a neighbor list search is performed;
[0034] S6: By traversing the grid cells in the Cell List domain, the neighbor particles that meet the calculation conditions are screened out, where all particles in the S sphere domain are used as neighbor particles, and a random algorithm is used in the CS sphere domain to uniformly select some neighbor particles, and all neighbor particle information is stored in Group_Id and Group_Positon;
[0035] S7: Calculate the short-range forces between all neighbor particles and the central particle in the S sphere and CS sphere respectively;
[0036] S8: The short-range force of each particle in the S sphere and the short-range force of each particle in the CS sphere are added correspondingly to obtain the temporary short-range force of each atom. The temporary short-range force of each particle is added through the Reduce operator to obtain the short-range force correction term, and the short-range force correction term is subtracted from the temporary short-range force of each particle to obtain the actual short-range force of each particle.
[0037] First, a grid division operation is performed to construct a unit size of r in the particle space. s The grid domain Cell List. Divide each dimension of the three-dimensional computational domain by the unit grid length r c , and the unit length dim of the grid domain CellList is obtained by rounding down. This three-dimensional unit length is also the particle space size.
[0038] Then preprocess the grid domain Cell List. The length of each cell is uniformly defined as L cell . Each cell has a unique identifier, which consists of three-dimensional indexes i, j, and k, denoted as ijk. The coordinates of the three-dimensional space are mapped to an integer through the formula Cell Id = ijk[0] + (ijk[1]*dims[0]) + (ijk[2]*dims[0]*dims[1]), thereby determining the unique number of each cell. After the grid is divided, each particle is assigned to a specific cell. Next, all particles are sorted according to the cell number so that the particles in the same cell are arranged continuously in the storage array. In this way, the position range of the particle set in each cell in the array, that is, the starting index lower and the ending index upper of the particle, can be determined, which helps to quickly retrieve all particles in a specific cell.
[0039] Then, a neighbor list search is performed on the particles in the calculation domain. The particle to be calculated is defined as the central particle, and the particle is taken as the center and the particle is searched in the radius r. c The search range contains n+1 layers of grids (where n=r) centered on the Cell_0 grid (the grid where the central particle is located). c / r s , and round n upwards). Assume Then n = 3, and there are 4 grid layers, such as Figure 2 Search each layer of grids one by one to determine the distance r between each particle and the central particle cs Does it satisfy r cs In r c The neighbor particles are filtered out and the particle information is stored in Group_Id and Group_Position.
[0040] In the process of searching for neighbor particles, the S sphere domain meets r ij The particles that meet the rs judgment condition participate in the calculation of the short-range force F of particle i i,S , and its calculation formula is as follows:
[0041]
[0042] Among them, r ij represents the distance between particles i and j in the S sphere, F i,s represents the short-range force between particle i and all particles j in the sphere S, f ij represents the short-range force between particles i and j in the S sphere, r s represents the radius of the S sphere.
[0043] f ij The calculation formula is as follows:
[0044]
[0045] Among them, r ij represents the distance between particle i and particle j in the S sphere, E is the total energy of the particle in the EAM force field, and F is the multi-body potential, called embedding energy, which is equal to the electron density ρ(r ij ) and particle i; φ is the two-body potential, which is the distance between particles r ij Energy E versus particle distance r ij Taking the derivative, we get the short-range force f between particles i and j in the sphere S: ij .
[0046] Similarly, in the particle search process, the particles in the CS shell domain also meet the requirements of neighbor particles, but in the calculation of short-range forces, the influence of these particles is limited. Therefore, a random algorithm is used to randomly select some particles in the shell domain for the calculation of short-range forces:
[0047]
[0048] In the above formula, F i,cs is the sum of the short-range forces calculated for all random particles in the shell domain, N cs and p are the total number of particles in the shell and the number of randomly selected particles, respectively, f i ' j It is the short-range force between the central particle i and the neighbor particle j in the shell region, where B(i) is the set of particles in the shell.
[0049] After searching for all neighboring particles in the S sphere and CS shell, calculate and count the short-range forces of all neighboring particles in the two particle domains. Add the corresponding short-range forces of each particle in the S sphere and the short-range forces of each particle in the CS sphere to obtain the temporary short-range force of each atom, which is F i,s +F i,cs The Reduce operator is used to add the temporary short-range force of each particle to obtain the short-range force correction term. Finally, the short-range force correction term is subtracted from the temporary short-range force of each particle to obtain the actual short-range force of each particle.
[0050] The actual short-range force is calculated as follows:
[0051]
[0052] F i =(F i,s +F i,cs )-F cor
[0053] In the above formula, F cor Refers to the adjustment term of the interaction force between the two spherical regions. N represents the total number of particles in the entire particle space. F i,s It describes the short-range force between particle i and all other particles in a specific spherical region S. i,cs It refers to the short-range force between particle i and a randomly selected particle in the spherical region CS. i is the actual short-range force on each particle.
[0054] The object of study in this invention is metal Cu, with a total of 2.04 million particles, which are placed in a simulation box of 298 angstroms * 289 angstroms * 289 angstroms and subjected to 10ps molecular dynamics simulation. When performing molecular dynamics simulation, the temperature control method selects the Berendsen algorithm, the temperature relaxation constant is selected as 100, the integral equation of motion is solved using the Velocity-Verlet method, the short-range interaction is solved using the EAM force field, and the short-range cutoff r is selected. c The size is selected as 5.0 angstroms, r s Take r c Calculate one-half of .
[0055] The integration step size is 1 fs, and the simulation steps are 10000. The RBL method of the present invention is compared with the molecular dynamics software LAMMPS for EAM potential energy calculation under the same conditions. The comparison results are shown in Figure 3 The calculation result of the present invention and the result of LAMMPS software are respectively -3.50 kcal / mol and -3.51 kcal / mol, and the relative error is less than 1%, which proves the correctness of the present invention.
[0056] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.< / float> < / float> < / int> < / int> < / float> < / float> < / int> < / int>
Claims
1. A method for calculating short-range interactions between particles in an EAM force field based on an RBL algorithm, characterized in that: include: S1: Design a vector data structure Group_Id that stores the ID vectors of each neighbor particle and a vector data structure Group_Position that embeds the coordinate Position vectors of each neighbor particle. The above two data structures are used to store the relevant information of the neighbor list when calculating the short-range interaction force; The data structure of the Group_Id is: Vector <Vector <int>>, where the innermost Vector <int> is the neighbor particle ID vector;< / int> < / int> The data structure of Group_Position is: Vector <Vector<Vector <float>>>, the innermost Vector <float> The 3D coordinate position representing the position of the neighbor particle;< / float> < / float> S2: Design Reduce operator for addition operation in large-scale particle computing; S3: Construct a unit size of r in the particle space through mesh division operation s The grid domain Cell List is obtained and preprocessed; S4: Based on the CellList grid domain, divide the particles in the space and make the particle distance less than r s The area is set as S sphere, and the particle distance is greater than r s Less than r c The area is set as CS sphere; Among them, r c Search radius for neighbor list; S5: For all particles in the computational domain, whose particle numbers are 0, 1, ..., i, a neighbor list search is performed; S6: By traversing the grid cells in the Cell List grid domain, the neighbor particles that meet the calculation conditions are screened out; S7: Calculate the short-range forces between all neighbor particles and the central particle in the S sphere and CS sphere respectively; S8: The short-range force of each particle in the S sphere and the short-range force of each particle in the CS sphere are added correspondingly to obtain the temporary short-range force of each atom. The temporary short-range force of each particle is added through the Reduce operator to obtain the short-range force correction term, and the short-range force correction term is subtracted from the temporary short-range force of each particle to obtain the actual short-range force of each particle.
2. According to claim 1, a method for calculating the short-range interaction between particles in an EAM force field based on an RBL algorithm is characterized in that: Through the meshing operation, a unit size of r is constructed in the particle space. s The grid field CellList includes: Divide each dimension of the three-dimensional computational domain by the unit grid length r s , and round down to get the number of cells in each dimension dim of the grid domain Cell List. This number is recorded as dims. Multiply the number of cells in the three dimensions (dims[0]*dims[1]*dims[2]) to get the total number of cells.
3. According to claim 1, a method for calculating the short-range interaction between particles in an EAM force field based on an RBL algorithm, characterized in that: Preprocess the grid domain Cell List, including: The length of each cell is uniformly defined as L cell , each cell has a unique identifier, which consists of a three-dimensional index i, j, k, denoted as ijk; The three-dimensional space coordinates are mapped to an integer using the formula Cell Id = ijk[0] + (ijk[1]*dims[0]) + (ijk[2]*dims[0]*dims[1]) to determine the unique number of each cell. After the grid is divided, each particle will be assigned to a specific cell, and all particles will be sorted according to the cell number so that the particles in the same cell are arranged continuously in the storage array to determine the position range of the particle set in each cell in the array, and obtain the starting index lower and ending index upper of the particle, which are used to quickly retrieve all particles in a specific cell.
4. According to claim 1, a method for calculating the short-range interaction between particles in an EAM force field based on an RBL algorithm, characterized in that: Perform a neighbor list search on all particles in the computational domain, including: The particle to be calculated is defined as the central particle, and the particle is taken as the center and the radius is r. c The neighbor particle search is performed within the search range, which includes n+1 layers of grids centered on the Cell_0 grid, where n=r c / r s , search each layer of grids one by one to determine the distance r between each particle and the central particle cs Does it satisfy r cs In r c range, thereby filtering out neighbor particles and storing particle information in Group_Id and Group_Position; where Cell_0 is the grid where the central particle is located, r s The unit size of the grid domain Cell List.
5. According to claim 1, a method for calculating short-range interactions between particles in an EAM force field based on an RBL algorithm, characterized in that: Filter out neighbor particles that meet the calculation conditions, including: In the process of searching for neighbor particles, the particles in the S sphere are located in the center of the sphere because the distance between the particles and the center particle is less than r. s , and has the greatest influence in the calculation of short-range forces, so all particles in the S sphere are defined as neighbor particles, and a random algorithm is used to randomly select some neighbor particles in the CS sphere, and all neighbor particle information is stored in Group_Id and Group_Positon.
6. According to claim 1, a method for calculating short-range interactions between particles in an EAM force field based on an RBL algorithm, characterized in that: Calculate the short-range forces between all neighbor particles and the central particle in the S sphere, including: Among them, F i,s Indicates that the radius is r s The short-range force between particle i and all other particles in the spherical region, r ij represents the distance between particles i and j in the sphere S, f ij represents the EAM short-range force between particles i and j in the S sphere, r s Search radius for the neighbor list.
7. According to claim 1, a method for calculating the short-range interaction between particles in an EAM force field based on an RBL algorithm, characterized in that: Calculate the short-range forces between all neighbor particles and the central particle in the CS sphere, including: Among them, F i,cs N represents the short-range force between particle i and all other particles in the CS sphere, cs and p represent the total number of particles and the number of randomly selected particles in the CS sphere, respectively. i ' j represents the short-range force between the central particle i and the neighbor particle j in the CS sphere, and B(i) represents the particle set in the CS sphere.
8. The method for calculating the short-range interaction between particles in the EAM force field based on the RBL algorithm according to claim 1, characterized in that: The short-range force correction term F is obtained by adding the temporary short-range forces of each particle in the S sphere and CS shell domains through the Reduce operator. cor Finally, the short-range force correction term is subtracted from the temporary short-range force of each particle to obtain the actual short-range force of each particle, including: F i =(F i,s +F i,cs )-F cor Among them, F cor represents the correction term of the interaction force between the two spherical regions, N represents the total number of particles in the entire particle space, and F i,s Indicates that the radius is r s The short-range force between particle i and all other particles in the spherical region, F i,cs represents the short-range force between particle i and all other particles in the CS sphere, F i is the actual short-range force on each particle.
Citation Information
Patent Citations
Method for realizing inter-particle short-range interaction calculation based on GPU (Graphics Processing Unit)
CN118658539A
Parallel neighbor search system and method thereof
KR101690315B1
