How to create the lammsp data file for my lammps input script? Kindly review my script for any suggestions or modifications

VARIABLES

variable fname index PC_cl33.txt
read_data ${fname}

Initialization

units real
boundary p p p
atom_style molecular
log log.{simname}.txt read_data {fname}

Dreiding potential information

neighbor 0.4 bin
neigh_modify every 10 one 10000

bond_style harmonic
bond_coeff 1 1.61e22 3.37
bond_coeff 2 1.60e22 3.37
bond_coeff 3 1.57e22 3.76
bond_coeff 4 1.52e22 3.76

angle_style harmonic
angle_coeff 1 4.17e2 90.53
angle_coeff 2 1.42e2 32.65
angle_coeff 3 1.36e2 32.65

dihedral_style opls

dihedral_coeff 1 0.4109 -0.8192 0.1873 0.6718 -0.1202
dihedral_coeff 2 0.3270 0.3666 -0.1756 -0.3320 -0.06420
dihedral_coeff 3 0.4222 0.6021 0.1812 -0.4568 -0.4515
dihedral_coeff 4 0.3911 -0.7477 0.2187 0.5642 -0.2026

pair_style lj/cut

pair_coeff 1 1 0.4109 -0.8192 3.76 # 1-2-3-4
pair_coeff 2 2 0.3270 0.3666 3.37 # 1-4-3-2
pair_coeff 3 3 0.4222 0.6021 3.37 # 2-1-4-3
pair_coeff 4 4 0.3911 -0.7477 3.76 # 3-2-1-4

compute csym all centro/atom fcc
compute peratom all pe/atom

#####################################################

Equilibration (Langevin dynamics at 5000 K)

velocity all create 5000.0 1231
fix 1 all nve/limit 0.05
fix 2 all langevin 5000.0 5000.0 10.0 904297
thermo_style custom step temp
thermo 10000
timestep 1
run 1000000
unfix 1
unfix 2
write_restart restart.${simname}.dreiding1

#####################################################

Define Settings

compute eng all pe/atom
compute eatoms all reduce sum c_eng

#####################################################

Minimization

dump 1 all cfg 6 dump.comp_*.cfg mass type xs ys zs c_csym c_peratom fx fy fz

reset_timestep 0
fix 1 all nvt temp 500.0 500.0 100.0
thermo 20
thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms
min_style cg
minimize 1e-25 1e-25 500000 1000000

print “All done”

How?

We have no idea of what you want to do. Also, note that creating initial topology is usually done outside of LAMMPS.

Also, please this guidelines for posting here.

Simon

what is coarse grained model for polycarbonate and how to define its force field?

Your second message contradicts the first one: you initially asked for a data file, and now you want a coarse grained force field? I doubt that somebody will be willing to help you if you don’t make the minimum effort. I sure won’t.

I am not contradicting my ask, the above input script is about the coarse grained model of polycarbonate which defines the force file for that, i am just asking to confirm me that for the said input script is that, i am going on right path?, and suggest me the best possible method for generating the lammps data file for polycarbonate with the help of some another tool?

Let me rephrase @simongravelle advice for you:

  1. Please read the etiquette before posting ill-formulated and poorly formatted questions. You haven’t even clicked on the link provided.
  2. Your script reads a DATA file called PC_cl33.txt. The force field parameters in there refer to this specific file; from what I can see, it contains only 4 atom types.
  3. The quickest way to verify that your script works is by running it in LAMMPS. I assume that you also have the data file PC_cl33.txt.
  4. If you want to generate a different sample, there are plenty of different ways to do so. The best way is to be guided by your supervisor or an expert colleague. The forum also contains plenty of threads on this topic, mentioning Packmol, VMD, Moltemplate, or directly with LAMMPS using a combination of the molecule and create_atoms commands, for instance.

Bottom line: it seems that you are building on someone else’s work without understanding your assigned task. Do your homework first, and come back with specific questions if you have any meaningful ones.

1 Like

Meanwhile, there are some errors in your script:

  • the variable ${simname} is not defined
  • you issue the read_data ${fname} twice.
  • The skin distance in the neighbour list is too small and will likely produce numerical errors.
  • The bond constants have crazy values. Besides, do you appreciate how meaningless it is to distinguish between 1.61e22 and 1.52e22? I have reduced them by 19 orders of magnitude --just a guesstimate.
  • The LJ well depth looks a bit shallow to me, given that the sample is being cooked at 5000 K.
  • compute eng all pe/atom and compute eng all pe/atom are clearly performing the same operation.
  • The coupling constant of 10 (fs) for the Langevin thermostat is too tight. The recommended value is 100x the timestep.
  • You define a fix 1 all nvt temp 500.0 500.0 100.0, but instead you ask for a structural minimisation. The velocity of atoms won’t change, so the temperature of your sample is still 5000 K. To me, setting energy and force thresholds with a value of 1e-25 is totally unnecessary.
  • What is the point of displaying lx ly lz with an NVE integrator?

I am not making any comment on the science you want to achieve. Here is a revised script:

# VARIABLES
variable simname index PC_cl33

# Initialization
units		real
boundary	p p p
atom_style	molecular
log 		log.${simname}.txt
read_data	${simname}.txt

# Dreiding potential information
neighbor     2 bin

bond_style harmonic
bond_coeff 1 1.61e3 3.37
bond_coeff 2 1.60e3 3.37
bond_coeff 3 1.57e3 3.76
bond_coeff 4 1.52e3 3.76

angle_style harmonic
angle_coeff 1 4.17e2 90.53
angle_coeff 2 1.42e2 32.65
angle_coeff 3 1.36e2 32.65

dihedral_style opls
dihedral_coeff 1 0.4109 -0.8192 0.1873 0.6718 -0.1202
dihedral_coeff 2 0.3270 0.3666 -0.1756 -0.3320 -0.06420
dihedral_coeff 3 0.4222 0.6021 0.1812 -0.4568 -0.4515
dihedral_coeff 4 0.3911 -0.7477 0.2187 0.5642 -0.2026

pair_style lj/cut
pair_coeff 1 1 0.4109 -0.8192 3.76  # 1-2-3-4
pair_coeff 2 2 0.3270 0.3666 3.37   # 1-4-3-2
pair_coeff 3 3 0.4222 0.6021 3.37   # 2-1-4-3
pair_coeff 4 4 0.3911 -0.7477 3.76  # 3-2-1-4

#####################################################
# Equilibration (Langevin dynamics at 5000 K)
timestep	1
velocity 	all create 5000.0 1231
fix		1 all nve/limit 0.05
fix		2 all langevin 5000.0 5000.0 $(100*dt) 904297
thermo_style	custom  step etotal evdwl ecoul elong ebond eangle edihed eimp &
  ke pe temp press vol density c_inter cpu
thermo          10000
run		1000000
unfix 1
unfix 2
write_restart 	restart.${simname}.dreiding1

#####################################################
# Define Settings
compute csym all centro/atom fcc
compute eng all pe/atom
compute eatoms all reduce sum c_eng 

#####################################################
# Minimization
dump 		1 all cfg 6 dump.comp_*.cfg mass type xs ys zs c_csym c_eng fx fy fz
reset_timestep 0
thermo 20 
thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms 
min_style cg
minimize 1e-5 1e-5 500000 1000000 

print "All done (perhaps)"

thank you sir,
the answer to your question is:
In molecular dynamics simulations, the quantities lx, ly, and lz represent the box dimensions along the x, y, and z directions, respectively. The box dimensions are important parameters that define the simulation cell size, and they can change during the simulation due to the periodic boundary conditions or the application of certain fixes.

The display of lx, ly, and lz can provide valuable information during a simulation, even when using an NVE (constant Number of particles, constant Volume, constant Energy)

But above script is showing some error when i run it, showing; ERROR: Unexpected end of data file (src/read_data.cpp:1528)
Last command: read_data ${simname}.txt

The error is self-explanatory: your data file is not formatted according to atom_style molecular. It is time to use the LAMMPS Manual ^\text{TM} and learn for yourself.