Method for rapidly orienting nanowire center again based on geometric structure
Through Python programming and minimum circle covering method, the problem of random offset of nanowire centers in molecular dynamics simulation is solved, and the rapid orientation of nanowire centers is realized, research efficiency and expansion are improved, and it is suitable for open source molecular dynamics simulation. Software to help analyze changes in properties of nanowires.
Patent Information
- Application Number
- CN202411457902.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In molecular dynamics simulation, the nanowire center is prone to random shifts when building the model, resulting in inconvenient display and analysis of frame-by-frame structures, affecting research efficiency.
Through Python programming, using the approximately circular characteristics of nanowire cross-section, the minimum circle covering method is used to find boundary atoms, determine the real-time center coordinates, and correct the coordinates of nanowire atoms in the molecular dynamics simulation trajectory file to achieve rapid nanowire centers Direction.
The nanowire center coordinate correction process is simplified, complexity is reduced, and efficiency is improved. It is suitable for open source molecular dynamics simulation software, with strong expansion and is conducive to studying the changing laws of parameters of different properties.
Smart Images

Figure CN119314570A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of nano material simulation and relates to a method for synchronization or post-processing analysis of molecular dynamics simulation trajectory files. Background Art
[0002] Nanomaterials have shown unique application value in many fields due to quantum confinement effects. Silicon carbide nanowires (SiCNWs), as a one-dimensional nanomaterial, not only inherit the excellent intrinsic properties of SiC, but also show new and unique properties due to size effects, such as high mechanical properties, direct band gap, optical activity, etc. For SiCNWs, the coated SiO2 layer can provide some advantages and modification possibilities, making the SiC / SiO2 core-shell structure potentially applicable in many fields, such as field emission, electromagnetic absorption, optics, superhydrophobicity, chemical / biosensors, biomedical applications, etc.
[0003] SiCNWs are usually at the nanoscale. A large number of studies have used molecular dynamics simulation methods to study their mechanical, corrosion resistance, and oxidation resistance properties. However, when constructing a nanowire model and not fixing the nanowire coordinates, the entire nanowire will randomly shift its center in the construction box, which is not conducive to displaying and analyzing its frame-by-frame structure. This phenomenon brings many inconveniences to the use of molecular dynamics to study nanowire-related issues. Therefore, it is crucial to quickly re-orient the nanowire coordinate center during synchronization or post-processing. Summary of the invention
[0004] In order to quickly re-orient the center coordinates of SiC nanowires, the present invention aims to utilize the characteristic that the cross section of the nanowire is approximately circular, and through Python programming, the minimum circle covering method is used to find the boundary atoms, determine the real-time center coordinates, correct the nanowire atomic coordinates in the molecular dynamics simulation trajectory file according to the new center coordinates, and perform multiple projection calculations on the system performance parameters after the coordinates are corrected. In addition, the operation process is simple, the key parameters are adjustable, and the scalability is strong.
[0005] In order to achieve the above object, the present invention provides the following technical solution: a method for quickly reorienting the center of a nanowire based on a geometric structure, comprising the following steps:
[0006] 1) Obtaining a trajectory file of a molecular dynamics simulation, wherein the trajectory file contains atomic species information and coordinate information of different time frames, as well as atomic property parameter information;
[0007] 2) In a certain time frame, based on the atomic property parameter information of all atomic species, the read coordinate information is projected onto a two-dimensional plane along the axial direction of the nanowire to form a boundary circle of atomic coordinate distribution;
[0008] 3) Select a certain type of atom as a reference atom and extract the new trajectory coordinates of the reference atom in the boundary circle;
[0009] 4) Read the coordinates of the new trajectory, use the improved minimum circle covering method to find the boundary atoms, and calculate the center coordinates of the covering circle through the boundary atoms;
[0010] 5) According to the center coordinates of the minimum covering circle, the atomic coordinates of the current frame in the trajectory file are subtracted from the center coordinates of the respective minimum covering circles on the projection plane to achieve coordinate correction of the current frame;
[0011] 6) Repeat steps 2) to 5) to traverse all time frames to achieve nanowire coordinate correction and orientation.
[0012] The property parameter information includes atomic stress, velocity, mass and charge.
[0013] The improved minimum circle covering method is used to find boundary atoms, comprising the following steps:
[0014] For all atoms in the current frame, the atomic numbers of the maximum and minimum coordinates are determined by sorting the coordinates in two vertical directions, and the difference between the maximum and minimum coordinates is calculated to obtain the coordinate range of the two vertical axes;
[0015] Compare the sizes of the coordinate ranges of the two axes to determine the two atomic numbers of the maximum coordinate range; use the two atoms as initial guesses and as the first two atoms to search for boundary atoms;
[0016] First, we use the two atoms P1 and P2 that we initially guessed to be the same, and use the distance between P1 and P2 as the diameter to determine an initial circle 2. Then, we traverse the other atoms one by one. If the atom P i If it is inside the circle, the circle remains unchanged. Otherwise, a new circle needs to be constructed. i P1 is the diameter of the new circle. i ; Then traverse the atoms numbered from P1 to P i The atoms P j , judge P j Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i P j Construct a new circle for the diameter j ; Further traverse P1 to P j The atoms P k , judge P k Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i , P j and P k Construct a new circle from three points on the circle k , circle kAs the minimum covering circle to ensure coverage of the first i points; i>j>k.
[0017] In step 3), nanowire skeleton atoms are selected as reference atoms.
[0018] Based on the structure of the nanowire after coordinate correction and orientation, it is used to analyze the stress changes, atomic density changes, charge changes and oxidation degree along the radial direction of the nanowire.
[0019] A device for quickly reorienting the center of a nanowire based on a geometric structure comprises a memory and a processor; the memory is used to store a computer program; the processor is used to implement a method for quickly reorienting the center of a nanowire based on a geometric structure when executing the computer program.
[0020] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, a method for quickly reorienting the center of a nanowire based on a geometric structure is implemented.
[0021] The present invention has the following beneficial effects and advantages:
[0022] 1. Taking advantage of the fact that the cross section of the nanowire is approximately circular, only the atomic geometric coordinates are considered, without considering the atomic mass weight factor, which reduces the complexity of correcting the position of the nanowire in the molecular dynamics simulation;
[0023] 2. First, determine the two atoms with the largest distance between two perpendicular axes on the projected cross section as the initial guess atoms, and use the minimum circle covering method to find the outermost boundary atoms to avoid traversing all atoms and improve efficiency;
[0024] 3. This method utilizes the Python interface of the open source molecular dynamics simulation software and can be used in conjunction with it as a method for real-time and post-processing trajectory files; in addition, it has strong scalability and can be applied to other system models and molecular dynamics simulation software after simply modifying the parameters;
[0025] 4. The corrected nanowire coordinates are helpful for studying the changing patterns of different property parameters over time, such as stress changes along the radial direction, atomic density changes, charge changes, and oxidation degree. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Schematic diagram of the process of quickly reorienting the center coordinates of nanowires based on geometric structure;
[0027] Figure 2 Schematic diagram of finding the outermost boundary atoms of the projection surface using the minimum circle covering method;
[0028] Figure 3Molecular dynamics calculation model diagram of SiCNWs in oxygen environment;
[0029] Figure 4 The results of the change of atomic number density in the radial direction of the nanowire after the reorientation of SiCNWs;
[0030] Figure 5 The results of the changes in atomic charge and number density in the radial direction of the nanowires after the reorientation of SiCNWs;
[0031] Figure 6 The result of atomic stress variation in the radial direction of the nanowire after reorientation of SiCNWs. DETAILED DESCRIPTION
[0032] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0033] The present invention can be used for open source molecular dynamics simulation trajectory file synchronization or post-processing analysis. By utilizing the characteristic that the cross section of the nanowire is approximately circular, only the atomic geometric coordinates are considered, without considering the atomic mass weight factor, and the improved minimum circle covering method is implemented by Python programming to quickly find the outermost boundary atoms, redirect the center coordinates of the nanowire, and avoid traversing all atoms. The method can be used in conjunction with open source molecular dynamics simulation software, and the operation process is flexible and adjustable, with strong expansibility, which is conducive to studying the changing laws of different property parameters over time.
[0034] The present invention discloses a method for quickly reorienting the center of a nanowire based on a geometric structure, and the specific process is as follows: Figure 1 As shown, the method described only needs to read the molecular dynamics simulation trajectory file containing atomic related parameters. The atomic parameters must include atomic type and coordinate information, and can also include property parameters such as atomic stress, velocity, mass and charge. This method reads the type and three-dimensional coordinate information of atoms in the molecular dynamics simulation trajectory file, and projects the three-dimensional coordinates of the nanowire along the axial direction to the two-dimensional plane through a self-written Python program. The atomic coordinate distribution is shown in Figure 2 The figure is approximately circular; then the center coordinates of the entire atomic system are determined by the minimum circle covering method, and the center coordinates of the nanowire are reoriented accordingly to obtain the performance parameters of interest. This method only needs to consider the geometric coordinates of the skeleton atoms when correcting the center coordinates of the nanowire, without considering other weight factors such as atomic mass. The real-time and post-processing method of the molecular dynamics calculation trajectory file is implemented through Python programming, and is combined with the open source molecular dynamics simulation software LAMMPS, and the operation process is flexible and adjustable.
[0035] The present invention also discloses a method for quickly reorienting the center of a nanowire based on a geometric structure, comprising the following steps:
[0036] 1) First, the trajectory file output by the open source molecular dynamics simulation program LAMMPS is read through a self-written Python program. The trajectory file must contain the atomic types and coordinate information at different time steps. In addition, other atomic property parameters such as atomic stress, velocity, mass and charge can be read.
[0037] 2) After reading the atomic species, coordinates, and performance parameter information such as stress, velocity, mass, and charge, the three-dimensional coordinates read are further projected onto a two-dimensional plane along the axial direction of the nanowire using a self-written Python program. The atomic coordinate distribution is as follows: Figure 2 The shown shape is approximately circular;
[0038] 3) In order to simplify the process of finding the coordinates of the atoms at the center of the nanowire, the Python program involved in the present invention reads and identifies the atomic type information at different time steps, selects one type of atom as a reference atom, and maps all the reference atomic coordinate information in the trajectory file to the new trajectory coordinate variable;
[0039] 4) Using the self-written program of the present invention to read the new trajectory coordinate variables frame by frame, using the improved minimum circle covering method to find the boundary atoms, and calculating the center coordinates of all the covering circles frame by frame through the boundary atoms of each frame;
[0040] In order to avoid traversing all situations when searching for boundary atoms using the minimum circle covering method and to speed up the efficiency of searching for boundary atoms, the present invention first determines the atomic numbers of the maximum and minimum coordinates of all planar atoms in each frame in two vertical directions by sorting the coordinate sizes through a self-compiled Python program, and obtains the coordinate ranges of the two vertical axes by taking the difference between the maximum and minimum coordinates; further determines the two atomic numbers of the maximum coordinate range by comparing the sizes of the coordinate ranges of the two axes; and passes the above two atoms as initial guesses to the minimum covering circle calculation module as the first two atoms to search for boundary atoms;
[0041] The improved minimum circle covering method first determines an initial circle circle2 (circle 2) by using the distance between the two atoms (respectively denoted as P1 and P2) as the diameter. i represents the smallest circle covering the first i points); then, traverse the other atoms one by one. If the atom P i If it is inside the circle, the circle remains unchanged. Otherwise, a new circle needs to be constructed. i P1 is the diameter of the new circle. i ; Then traverse the atoms numbered from P1 to P i The atoms P j , judge P j Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i Pj Construct a new circle for the diameter j ; Further traverse P1 to P j The atoms P k (i>j>k), judge P k Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i , P j and P k Construct a new circle from three points on the circle k , circle k As the smallest circle, it is guaranteed to cover the first i points.
[0042] 5) According to the center coordinates of the minimum covering circle of each frame of the trajectory determined in the previous step, the Python program involved in the present invention subtracts the center coordinates of the minimum covering circle of each frame in the trajectory file on the projection plane, thereby completing the coordinate correction and orientation of the nanowire system, and finally performing projection calculation on various performance parameters of the nanowire, including the radial atomic density distribution, stress distribution and charge density of the nanowire.
[0043] Preferably, in step 3), Si or C element of the nanowire skeleton atom is selected as the reference atom;
[0044] Preferably, in step 4), in order to avoid traversing all situations when using the minimum circle covering method to find boundary atoms and to speed up the efficiency of finding boundary atoms, when the Python program compiled by the present invention reads the new trajectory coordinate variables, the two perpendicular axis directions in the projection plane are determined as the atomic coordinate sorting directions according to the actual three-dimensional coordinates of the model.
[0045] Example:
[0046] In this example, SiCNWs with a diameter of 10 nm along the
[111] direction were constructed; the length of the nanowire along the z-axis was 1.5 nm (6 biatomic layers); Figure 3As shown, in order to construct a nanowire that is infinitely extended in the z-axis direction and a uniform oxidation environment, periodic boundary conditions are used in all three directions of the model. In the nanowire oxidation model, SiCNWs contains a total of 11324 Si and C atoms with equal molar ratios, and the oxidation simulation temperatures are set to 300, 600, 900, 1200, and 1500K, respectively, wherein the oxygen environments at different temperatures include 59093, 59508, 59668, 59772, and 59766 oxygen atoms, respectively. Based on the open source molecular dynamics simulation software LAMMPS, 200atm oxygen partial pressure is used to study the oxidation process of SiCNWs at different temperatures. The simulation ensemble is set to NVT ensemble, and the simulation time is 500ps. Finally, molecular dynamics simulation trajectory files containing atomic species and coordinate information, as well as other atomic property parameters such as atomic stress, velocity, mass, and charge, are obtained at different times. Based on the above process, the specific steps of the method for quickly re-orienting the center of the nanowire based on the geometric structure involved in the present invention are as follows:
[0047] Step 1: First, use a self-written Python program to read the trajectory file output by the open source molecular dynamics simulation program LAMMPS. The trajectory file must contain the atomic types and coordinate information at different time steps. In addition, the atomic property parameters such as atomic stress, velocity, mass and charge can be read.
[0048] Step 2: After reading the atomic type, coordinates, and performance parameter information such as stress, velocity, mass, and charge, the three-dimensional coordinates are projected onto a two-dimensional plane along the axial direction of the nanowire using a self-written Python program. The atomic coordinate distribution is as follows: Figure 2 It is approximately circular as shown. It can be seen from the figure that the central coordinates of the atoms in the nanowire can be successfully oriented by the method of the present invention.
[0049] Step 3: In order to simplify the process of finding the coordinates of the atoms at the center of the nanowire, the Python program of the present invention reads and identifies the atomic type information at different time steps, selects one type of atom as the reference atom, and sets the nanowire skeleton Si atom as the reference atom, and maps all the reference atomic coordinate information in the trajectory file to the new trajectory coordinate variable;
[0050] Step 4: using the self-written program of the present invention to read the new trajectory coordinate variables frame by frame, using the improved minimum circle covering method to find the boundary atoms, and calculating all the covering circle center coordinates frame by frame through the boundary atoms of each frame;
[0051] In order to avoid traversing all situations when searching for boundary atoms using the minimum circle covering method and to speed up the efficiency of searching for boundary atoms, the present invention first determines the atomic numbers of the maximum and minimum coordinates respectively by sorting the coordinate sizes of all planar atoms in each frame in two vertical directions through a self-compiled Python program. Here, the orthogonal axes of the bottom surface of the box in the output trajectory file of the open source molecular dynamics simulation software LAMMPS are used as the two vertical axis directions for sorting the atomic coordinates, and the maximum and minimum coordinates are subtracted to obtain the coordinate ranges of the two vertical axes; further, by comparing the sizes of the coordinate ranges of the two axes, the two atomic numbers of the maximum coordinate range are determined; the above two atoms are passed as initial guesses to the minimum covering circle calculation module as the first two atoms to search for boundary atoms;
[0052] The improved minimum circle covering method first determines an initial circle circle2 (circle 2) by using the distance between the two atoms (respectively denoted as P1 and P2) as the diameter. i represents the smallest circle covering the first i points); then, traverse the other atoms one by one. If the atom P i If it is inside the circle, the circle remains unchanged. Otherwise, a new circle needs to be constructed. i P1 is the diameter of the new circle. i ; Then traverse the atoms numbered from P1 to P i The atoms P j , judge P j Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i P j Construct a new circle for the diameter j ; Further traverse P1 to P j The atoms P k (i>j>k), judge P k Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i , P j and P k Construct a new circle from three points on the circle k , circle k As the smallest circle, it is guaranteed to cover the first i points.
[0053] Step 5: Based on the minimum coverage circle center coordinates of each frame of the trajectory determined in the previous step, the Python program of the present invention deducts the minimum coverage circle center coordinates of each frame in the trajectory file on the projection plane, thereby completing the coordinate correction and orientation of the nanowire system, and finally performing projection calculation on various performance parameters of the nanowire, including the radial atomic density distribution of the nanowire ( Figure 4 ), charge density ( Figure 5 ) and stress distribution ( Figure 6). From the above performance parameter calculation results, it can be found that the method of the present invention has a good effect on the position correction of the nanowires, which is conducive to the comparative analysis of the results of different simulation times, working conditions and different property parameters.
[0054] In summary, the present invention discloses a method for quickly re-orienting the center of a nanowire based on a geometric structure, which utilizes the characteristic that the cross section of the nanowire is approximately circular, and only considers the geometric coordinates of the atoms, without considering the atomic mass weight factor; in addition, the improved minimum circle covering method can be used to quickly find the outermost boundary atoms, re-orient the center coordinates of the nanowire, avoid traversing all atoms, and improve efficiency. The open source molecular dynamics calculation trajectory file real-time processing and post-processing method is implemented through Python programming, and is combined with the open source molecular dynamics simulation software. The operation process is flexible and adjustable, which is conducive to studying the change law of different property parameters over time trajectory, such as stress changes, atomic density changes, charge changes, and oxidation degree along the radial direction.
[0055] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for rapidly reorienting the center of a nanowire based on geometric structure, characterized in that: The following steps are involved: 1) Obtaining a trajectory file of a molecular dynamics simulation, wherein the trajectory file contains atomic species information and coordinate information of different time frames, as well as atomic property parameter information; 2) In a certain time frame, based on the atomic property parameter information of all atomic species, the read coordinate information is projected onto a two-dimensional plane along the axial direction of the nanowire to form a boundary circle of atomic coordinate distribution; 3) Select a certain type of atom as a reference atom and extract the new trajectory coordinates of the reference atom in the boundary circle; 4) Read the coordinates of the new trajectory, use the improved minimum circle covering method to find the boundary atoms, and calculate the center coordinates of the covering circle through the boundary atoms; 5) According to the center coordinates of the minimum covering circle, the atomic coordinates of the current frame in the trajectory file are subtracted from the center coordinates of the respective minimum covering circles on the projection plane to achieve coordinate correction of the current frame; 6) Repeat steps 2) to 5) to traverse all time frames to achieve nanowire coordinate correction and orientation.
2. A method for quickly reorienting the center of a nanowire based on a geometric structure according to claim 1, characterized in that: The property parameter information includes atomic stress, velocity, mass and charge.
3. The method for quickly reorienting the center of a nanowire based on a geometric structure according to claim 1, characterized in that: The improved minimum circle covering method is used to find boundary atoms, comprising the following steps: For all atoms in the current frame, the atomic numbers of the maximum and minimum coordinates are determined by sorting the coordinates in two vertical directions, and the difference between the maximum and minimum coordinates is calculated to obtain the coordinate range of the two vertical axes; Compare the sizes of the coordinate ranges of the two axes to determine the two atomic numbers of the maximum coordinate range; use the two atoms as initial guesses and as the first two atoms to search for boundary atoms; First, we use the two atoms P1 and P2 that we initially guessed to be the same, and use the distance between P1 and P2 as the diameter to determine an initial circle 2. Then, we traverse the other atoms one by one. If the atom P i If it is inside the circle, the circle remains unchanged. Otherwise, a new circle needs to be constructed. i P1 is the diameter of the new circle. i ; Then traverse the atoms numbered from P1 to P i The atoms P j , judge P j Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i P j Construct a new circle for the diameter j ; Further traverse P1 to P j The atoms P k , judge P k Is it inside the circle? If so, the circle remains unchanged. Otherwise, P i , P j and P k Construct a new circle from three points on the circle k , circle k As the minimum covering circle to ensure coverage of the first i points; i>j>k.
4. The method for quickly reorienting the center of a nanowire based on a geometric structure according to claim 1, characterized in that: In step 3), nanowire skeleton atoms are selected as reference atoms.
5. The method for quickly reorienting the center of a nanowire based on a geometric structure according to claim 1, characterized in that: Based on the structure of the nanowire after coordinate correction and orientation, it is used to analyze the stress changes, atomic density changes, charge changes and oxidation degree along the radial direction of the nanowire.
6. A device for rapidly reorienting the center of a nanowire based on a geometric structure, characterized in that: It comprises a memory and a processor; the memory is used to store a computer program; the processor is used to implement a method for quickly reorienting the center of a nanowire based on a geometric structure as described in any one of claims 1 to 5 when executing the computer program.
7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method for quickly reorienting the center of a nanowire based on a geometric structure as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and apparatu for simulating atomic dynamics
CN111243680A
Molecular dynamics-based nanoscale diamond friction wear process simulation method
CN113012765A
Molecular generation trajectory tracking method based on gas-solid heterogeneous reaction micromodel
CN113744810A
Method for researching interface property of nanocrystalline composite glass based on molecular dynamics simulation
CN116434882A