██╗███╗ ██╗████████╗███████╗██████╗ ███████╗ █████╗ ██████╗██╗ █████╗ ██╗
██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗██╔════╝██╔══██╗██╔════╝██║██╔══██╗██║
██║██╔██╗ ██║ ██║ █████╗ ██████╔╝█████╗ ███████║██║ ██║███████║██║
██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗██╔══╝ ██╔══██║██║ ██║██╔══██║██║
██║██║ ╚████║ ██║ ███████╗██║ ██║██║ ██║ ██║╚██████╗██║██║ ██║███████╗
╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝╚═╝ ╚═╝╚══════╝
██████╗ ██████╗ ██╗ ██╗ ██╗███╗ ███╗███████╗██████╗ ██╗███████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗
██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝████╗ ████║██╔════╝██╔══██╗██║╚══███╔╝██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║
██████╔╝██║ ██║██║ ╚████╔╝ ██╔████╔██║█████╗ ██████╔╝██║ ███╔╝ ███████║ ██║ ██║██║ ██║██╔██╗ ██║
██╔═══╝ ██║ ██║██║ ╚██╔╝ ██║╚██╔╝██║██╔══╝ ██╔══██╗██║ ███╔╝ ██╔══██║ ██║ ██║██║ ██║██║╚██╗██║
██║ ╚██████╔╝███████╗██║ ██║ ╚═╝ ██║███████╗██║ ██║██║███████╗██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
███████╗██╗███╗ ███╗██╗ ██╗██╗ █████╗ ████████╗ ██████╗ ██████╗
██╔════╝██║████╗ ████║██║ ██║██║ ██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗
███████╗██║██╔████╔██║██║ ██║██║ ███████║ ██║ ██║ ██║██████╔╝
╚════██║██║██║╚██╔╝██║██║ ██║██║ ██╔══██║ ██║ ██║ ██║██╔══██╗
███████║██║██║ ╚═╝ ██║╚██████╔╝███████╗██║ ██║ ██║ ╚██████╔╝██║ ██║
╚══════╝╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
Before getting started, please make sure that you have installed Python 3.5 or later versions and LAMMPS version 3 Mar 2020 or later.
-
Confirm your Python environment
python --version
Confirm whether your Python environment is installed correctly. You should see the following output:
$ python --version Python 3.10.6
-
Confirm your LAMMPS environment
lmp -h
If there is no error, it means that the LAMMPS environment is normal.
-
Rename the LAMMPS module as
data.lmpsand put it in the project root directory. -
Put the related input and settings modules into the
./configfolder. -
Install the required modules by executing the following command in the project root directory:
pip install -r requirements.txtThen execute:
python Simulator.py
The program will run.
The configuration file uses YAML format.
Please note that YAML files have strict spacing requirements. For example, the following format is incorrect:
minfile:"config/min.in" # Incorrect format: no space between minfile: and "config/min.in"Correct format:
minfile: "config/min.in" # Correct format: space between minfile: and "config/min.in"Please edit according to YAML format specifications.
minfile:
- Description: Path to the energy minimization input file
- Value type: String
- Example:
minfile: "config/min.in"
mdfile:
- Description: Path to the molecular dynamics input file
- Value type: String
- Example:
mdfile: "config/md.in"
bondsNum:
- Description: Current number of formed bonds. Set to
0to start a new calculation. If set to a value >0, the calculation will continue based on data in theoutPathdirectory. - Example:
bondsNum: 0
bondLimits:
- Description: Maximum number of bonds that can be formed during the calculation. When this limit is reached, the energy minimization calculation will stop.
- Example:
bondLimits: 500
tryNum:
- Description: Number of attempts to find a valid bond pair within the current bonding cycle. If no valid pair is found, the program will try again until a bondable pair is found or the maximum number of attempts is reached.
- Example:
tryNum: 1
trylimit:
- Description: Maximum number of attempts per bonding cycle to find a valid bond pair. If this limit is exceeded without success, the entire calculation will terminate.
- Example:
trylimit: 140
lammps:
- Description: Command to execute LAMMPS from the command line.
- Example:
lammps: "mpirun -np 32 lmp_oneapi"
outPath:
- Description: Directory path for storing calculation results from each iteration.
- Example:
outPath: "outdirs"
lmprundir:
- Description: Directory path where LAMMPS runs.
- Example:
lmprundir: "lammps"
These settings define the constraints for bond formation.
link:
- Description: Defines the atom types to be bonded. Each entry consists of pairs of atom types. The atom type codes must be defined in the molecular system settings. Supports multiple link groups for different bonding scenarios.
- Example:
link: - - nh,n - c,c_1 - - tnv,tns - c,c_1
deletelink:
- Description: Atom types to be deleted when forming bonds (e.g., leaving groups).
- Example:
deletelink: - hn - cl - thn
cutoff:
- Description: Maximum distance between atoms that can form a bond, in Angstroms (Å).
- Example:
cutoff: 3.5
charge:
- Description: Virtual charges to be assigned to the two bonding atoms. The first and second values correspond to the atom types defined in the same positions in
link. - Example:
charge: - 0 - 0
intra:
- Description: The first parameter defines whether to check if the two potentially bondable atoms are adjacent atoms on the same molecule. The second parameter defines the maximum number of atoms between them for this adjacency relationship.
- Example:
intra: - true - 1
These settings are used when equilibrium calculations are enabled.
equilibrium:
- Description: Whether to perform equilibrium calculations during the simulation.
- Value type: Boolean
- Example:
equilibrium: true
When equilibrium: true, the following parameters are required:
upperPlate:
- Description: Atom type name for the upper plate.
- Value type: String
- Example:
upperPlate: "up"
upperSolvent:
- Description: List of atom type numbers for the upper solvent.
- Value type: List of integers
- Example:
upperSolvent: - 11 - 12
upperMonomer:
- Description: LAMMPS data file path for the upper monomer.
- Value type: String
- Example:
upperMonomer: "config/tmc.lmps"
upperFactor:
- Description: Ratio factor for comparing upper monomer count with solvent count. The monomer count is multiplied by this factor before comparison.
- Value type: Integer
- Example:
upperFactor: 97
lowerPlate:
- Description: Atom type name for the lower plate.
- Value type: String
- Example:
lowerPlate: "be"
lowerSolvent:
- Description: List of atom type numbers for the lower solvent.
- Value type: List of integers
- Example:
lowerSolvent: - 13 - 14
lowerMonomer:
- Description: LAMMPS data file path for the lower monomer.
- Value type: String
- Example:
lowerMonomer: "config/mpd.lmps"
lowerFactor:
- Description: Ratio factor for comparing lower monomer count with solvent count. The monomer count is multiplied by this factor before comparison.
- Value type: Integer
- Example:
lowerFactor: 258
These parameters define the type indices corresponding to atoms, bonds, angles, dihedrals, and impropers in data.lmps. For impropers, the first atom is the central atom.
Example:
atoms:
c: 1
c3: 2
ca: 3
ha: 4
bonds:
c3,c3: 1
c3,hc: 2
c3,n: 3
c3,n3: 4
angles:
c3,c3,hc: 1
c3,c3,n3: 2
c3,c3,n: 3
hc,c3,hc: 4
hc,c3,n3: 5
dihedrals:
ca,ca,c,cl: 1
ca,ca,c_1,n: 2
o,c_1,n,c3: 3
ca,c_1,n,c3: 4
n3,c3,c3,n: 5
impropers:
ca,o,c_1,n: 1
ca,o,c,cl: 2
ca,ca,ca,ha: 3Licensed under the GNU General Public License v3.0. See LICENSE.