Setting group of atoms in LAMMPS

Hello everyone,
I have built a single layer graphene sheet in Materials studio and converted in LAMMPS file. My goal is to test uniaxial tensile strength of graphene. At first I used fix deform command to stretch the simulation box in x-direction. But the graphene continued to stretch untill when the box length is equal to the twice the initial box length and the strength is around 200 GPa. I stopped the simulation after that and the sheet still did not fracture. But from the literature we know that fracture stress of graphene is around 120 GPa and strain is 0.18-0.27. So, my simulation setup is clearly wrong.
So, now I am trying to set one layer of atoms in the graphene sheet fixed. I used region command in LAMMPS to fix the atoms but LAMMPS showed me an error saying I have to use create_box command first. But I am reading the data file from read_data command. I need an advice about how to fix a portion of atoms when I am creating the box from read_data command. I am using CVFF potential, not tersoff or AIREBO potential.

I greatly appreciate your help.

LAMMPS input file:

echo screen
log debug_grapsingle.log

units real
atom_style full

bond_style harmonic
angle_style harmonic
dihedral_style harmonic
improper_style cvff

pair_style lj/cut/coul/long 9.0 10.0 # cutoff1 = 2.5*sigma
kspace_style ewald 1e-4

neighbor 5.0 bin

#neigh_modify delay 0 every 1 one 10000 check yes
neigh_modify delay 0 every 1 check yes

boundary p p p

read_data data.grapsingle

pair_coeff * * 0.1479999981 3.6170487995 # value1 = epsilon, value2 = sigma
#pair_coeff * * CH.airebo C
pair_modify mix arithmetic tail no

group graphene type 1

compute tmpall graphene temp
compute mobile_temp graphene temp

velocity graphene create 298.0 12345 temp mobile_temp dist gaussian mom yes rot no
#velocity graphene set 1000000 0.0 0.0 temp mobile_temp units box

#------------------energy minimization-----------------------------xxx
#------------------NVE + Temp/rescale------------------------------xxx

minimize 1.0e-4 1.0e-6 100 1000
min_style cg
min_modify dmax 0.1

fix 2 all nve
fix 3 all temp/rescale 1 298.0 298.0 1.0 0.5
fix 4 all langevin 298.0 298.0 100.0 2341456

timestep 1
thermo 100
#thermo_style custom step temp pe etotal press vol density evdwl ecoul elong epair ebond eangle edihed eimp emol # epair = evdwl+ecoul+elong;
thermo_style custom step temp pe etotal press vol density
thermo_modify lost error flush yes # emol = ebond+eangle+edihed+eimp;
run 500 # 500 ps

dump 1 all xyz 1 grap.xyz
#dump_modify 1 element C H O

write_data data.grapsingle_nve pair ij # Data after NVE+Langevin
unfix 2
unfix 3
unfix 4

#---------------------------NPT------------------------------------xxx
reset_timestep 0
fix 7 all npt temp 298.0 298.0 100.0 iso 1.01325 1.01325 1000.0 pchain 1 # Pressure unit in (atm)

timestep 1
thermo 100
#thermo_style custom step temp pe etotal press vol density evdwl ecoul elong epair ebond eangle edihed eimp emol # epair = evdwl+ecoul+elong;
thermo_style custom step temp pe etotal press vol density
thermo_modify lost error flush yes # emol = ebond+eangle+edihed+eimp;
run 500 # 1000 ps

dump 2 all xyz 1 grap.xyz
write_data data.grapsingle_npt pair ij # Data after NVE+temp/rescaling+Langevin+NPT
unfix 7

#---------------------------MD simulation------------------------------------xxx

reset_timestep 0
compute peratom graphene stress/atom mobile_temp
compute p graphene reduce sum c_peratom[1] c_peratom[2] c_peratom[3] c_peratom[4] c_peratom[5] c_peratom[6]

variable tmp equal “lx”
variable l0 equal {tmp} print "initial length, l0: {l0}"
variable erate equal “1e9”
variable erate1 equal “v_erate/1e15” # engineering strain rate in fs

variable strain equal “(lx-v_l0)/v_l0”
variable p1 equal “v_strain”
variable p2 equal “-pxx”
variable p3 equal “-pyy”
variable p4 equal “-pzz”
variable stress equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol) # per-atom stress is negative of total pressure p

per-atom stress is sum of diagonal components in stress tensor

fix 8 all nvt temp 298.0 298.0 5.0 drag 1
fix 9 all deform 1 x erate ${erate1} units box remap x

fix print all print 100 “${p1} {p2} {p3} {p4}” file wgw.defo.txt screen no

timestep 1
thermo 100
#thermo_style custom step temp pe etotal vol press v_strain v_stress lx ly lz
thermo_style custom step temp vol press v_strain v_stress lx emol
dump 3 all xyz 5000 grap.xyz
dump 4 all image 25000 dump.*.jpg type type
run 5000
write_data data.grapsingle_md pair ij

unfix 8
unfix 9

Hello everyone,
I have built a single layer graphene sheet in Materials studio and
converted in LAMMPS file. My goal is to test uniaxial tensile strength of
graphene. At first I used fix deform command to stretch the simulation box
in x-direction. But the graphene continued to stretch untill when the box
length is equal to the twice the initial box length and the strength is
around 200 GPa. I stopped the simulation after that and the sheet still did
not fracture. But from the literature we know that fracture stress of
graphene is around 120 GPa and strain is 0.18-0.27. So, my simulation setup
is clearly wrong.
So, now I am trying to set one layer of atoms in the graphene sheet fixed.
I used region command in LAMMPS to fix the atoms but LAMMPS showed me an
error saying I have to use *create_box* command first. But I am reading
the data file from *read_data* command. I need an advice about how to fix
a portion of atoms when I am creating the box from read_data command. I am
using CVFF potential, not tersoff or AIREBO potential.

I greatly appreciate your help.

LAMMPS input file:

echo screen
log debug_grapsingle.log

units real
atom_style full

bond_style harmonic

​here is your problem. bonds modeled with a harmonic potential *cannot*
break.​ you can pull as much as you want.

axel.

Hi Axel,

Thank you for your reply. I have changed bond_style from harmonic to morse and used morse potentials parameters in CVFF potential. But I am getting segmentation fault error.

LAMMPS (10 Aug 2015)
log debug_grapsingle.log

units real
atom_style full

bond_style morse
angle_style harmonic
dihedral_style harmonic
improper_style cvff

pair_style lj/cut/coul/long 9.0 10.0 # cutoff1 = 2.5*sigma
kspace_style ewald 1e-4

neighbor 5.0 bin

#neigh_modify delay 0 every 1 one 10000 check yes
neigh_modify delay 0 every 1 check yes

boundary p p p

read_data data.grapsingle
Reading data file …
orthogonal box = (2.53375 -1.30073 30) to (23.5381 27.1541 36)
1 by 1 by 1 MPI processor grid
[SECEEW-5JS9PS1:21435] *** Process received signal ***
[SECEEW-5JS9PS1:21435] Signal: Segmentation fault (11)
[SECEEW-5JS9PS1:21435] Signal code: Address not mapped (1)
[SECEEW-5JS9PS1:21435] Failing at address: (nil)
[SECEEW-5JS9PS1:21435] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f41c5ca5340]
[SECEEW-5JS9PS1:21435] [ 1] ./lmp_ubuntu() [0x7f12c0]
[SECEEW-5JS9PS1:21435] [ 2] ./lmp_ubuntu() [0x7f5794]
[SECEEW-5JS9PS1:21435] [ 3] ./lmp_ubuntu() [0x5f1169]
[SECEEW-5JS9PS1:21435] [ 4] ./lmp_ubuntu() [0x5eea89]
[SECEEW-5JS9PS1:21435] [ 5] ./lmp_ubuntu() [0x5ef4ff]
[SECEEW-5JS9PS1:21435] [ 6] ./lmp_ubuntu() [0x40e3c6]
[SECEEW-5JS9PS1:21435] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f41c58f1ec5]
[SECEEW-5JS9PS1:21435] [ 8] ./lmp_ubuntu() [0x41001f]
[SECEEW-5JS9PS1:21435] *** End of error message ***
Segmentation fault (core dumped)

Baig

Hello everyone,
I have built a single layer graphene sheet in Materials studio and converted in LAMMPS file. My goal is to test uniaxial tensile strength of graphene. At first I used fix deform command to stretch the simulation box in x-direction. But the graphene continued to stretch untill when the box length is equal to the twice the initial box length and the strength is around 200 GPa. I stopped the simulation after that and the sheet still did not fracture. But from the literature we know that fracture stress of graphene is around 120 GPa and strain is 0.18-0.27. So, my simulation setup is clearly wrong.
So, now I am trying to set one layer of atoms in the graphene sheet fixed. I used region command in LAMMPS to fix the atoms but LAMMPS showed me an error saying I have to use create_box command first. But I am reading the data file from read_data command. I need an advice about how to fix a portion of atoms when I am creating the box from read_data command. I am using CVFF potential, not tersoff or AIREBO potential.

I greatly appreciate your help.

LAMMPS input file:

echo screen
log debug_grapsingle.log

units real
atom_style full

bond_style harmonic

​here is your problem. bonds modeled with a harmonic potential cannot break.​ you can pull as much as you want.

axel.

Hi Axel,

Thank you for your reply. I have changed bond_style from harmonic to morse
and used morse potentials parameters in CVFF potential. But I am getting
segmentation fault error.

​that would most likely come from an incorrectly formatted data file.

axel.​

Hi Axel,

I solved the problem of segmentation fault. It was about the incorrect formatting in data file. However, using the morse potential is leading to much much lower values of strength with the corresponding value of strain. For example, I am getting 0.5 GPa in 0.05 strain. I found out that quartic bond_style is for bond breaking in LAMMPS. But, there is no parameters for quartic bond stretching in CVFF. Is there any other bond_style that can represent the graphene’s actual behavior?

Thanks for the help.

Baig

Hi Axel,

Thank you for your reply. I have changed bond_style from harmonic to morse and used morse potentials parameters in CVFF potential. But I am getting segmentation fault error.

​that would most likely come from an incorrectly formatted data file.

axel.​

Hi Axel,

I solved the problem of segmentation fault. It was about the incorrect
formatting in data file. However, using the morse potential is leading to
much much lower values of strength with the corresponding value of strain.
For example, I am getting 0.5 GPa in 0.05 strain. I found out that quartic
bond_style is for bond breaking in LAMMPS. But, there is no parameters for
quartic bond stretching in CVFF. Is there any other bond_style that can
represent the graphene's actual behavior?

​that is a question for a literature search, not a mailing list for a
simulation software. also, it is not only the bond style that ​determines
the behavior, but also the specific parameterization. that also includes
non-bonded interactions with nearby atoms that are not 1-2, 1-3, or 1-4
neighbors. keep in mind, that "generic" force fields are usually
parameterized to represent a certain set of reference or training molecules
or systems. you'll probably have to look for something that is
parameterized specifically for graphene and not CVFF.

axel.

Hi Axel,

Thank you for pointing out my mistake. I have used CVFF potential because later in my simulation I will include tobermorite/jennite models which use CLAYFF-CVFF potential. I don’t want to get into hybrid potential just yet because I am still in LAMMPS infancy. However, I could break the bonds using morse potential instead of harmonic in bond_style command but the stress is 25 GPa, although the strain is 0.27, which seems to agree with the literature. What can cause my stress to be so small? The stress-strain curve’s behavior is accurate. I checked my potential parameters with the following paper: http://ac.els-cdn.com/S0927025609001712/1-s2.0-S0927025609001712-main.pdf?_tid=ad580310-f4f1-11e5-806f-00000aab0f6c&acdnat=1459175633_bfa7be5109789f34cc03adf7e20b5556.
Here’s my input file:
INPUT:

graphene (1-layer) (without functionalization/ions/tobermorite)

echo screen
log debug_grapsingle.log

units real
atom_style full
boundary p p p

bond_style morse
angle_style harmonic
dihedral_style harmonic
improper_style cvff

read_data data.grapsingle

pair_style lj/cut/coul/long 10.0 10.0 # cutoff1 = 2.5*sigma
kspace_style ewald 1e-4
#pair_style airebo 3.0 1 1
neighbor 5.0 bin

#neigh_modify delay 0 every 1 one 10000 check yes
neigh_modify delay 0 every 1 check yes

#pair_coeff * * CH.airebo C
pair_modify mix arithmetic tail no

group graphene type 1

compute tmpall graphene temp
compute mobile_temp graphene temp

variable temp equal “298”
velocity graphene create ${temp} 12345 temp mobile_temp dist gaussian mom yes rot no
#velocity graphene set 50 1 1 temp mobile_temp units box

#------------------energy minimization-----------------------------xxx
#------------------NVE + Temp/rescale------------------------------xxx

minimize 1.0e-4 1.0e-6 100 1000
min_style cg
min_modify dmax 0.1

fix 2 all nve
fix 3 all temp/rescale 1 {temp} {temp} 1.0 0.5
fix 4 all langevin {temp} {temp} 100.0 2341456

timestep 1
thermo 100
#thermo_style custom step temp pe etotal press vol density evdwl ecoul elong epair ebond eangle edihed eimp emol # epair = evdwl+ecoul+elong;
thermo_style custom step temp pe etotal press vol density
thermo_modify lost error flush yes # emol = ebond+eangle+edihed+eimp;
run 1000 # 500 ps

dump 1 all xyz 1 grap.xyz
#dump_modify 1 element C H O

write_data data.grapsingle_nve pair ij # Data after NVE+Langevin
unfix 2
unfix 3
unfix 4

#---------------------------NPT------------------------------------xxx
reset_timestep 0
fix 7 all npt temp {temp} {temp} 100.0 iso 1.01325 1.01325 1000.0 pchain 1 # Pressure unit in (atm)

timestep 1
thermo 100
#thermo_style custom step temp pe etotal press vol density evdwl ecoul elong epair ebond eangle edihed eimp emol # epair = evdwl+ecoul+elong;
thermo_style custom step temp pe etotal press vol density
thermo_modify lost error flush yes # emol = ebond+eangle+edihed+eimp;
run 1000 # 1000 ps

dump 2 all xyz 1 grap.xyz
write_data data.grapsingle_npt pair ij # Data after NVE+temp/rescaling+Langevin+NPT
unfix 7

#---------------------------MD simulation------------------------------------xxx

reset_timestep 0
compute peratom graphene stress/atom mobile_temp
compute p graphene reduce sum c_peratom[1] c_peratom[2] c_peratom[3] c_peratom[4] c_peratom[5] c_peratom[6]

variable tmp equal “lx”
variable l0 equal {tmp} print "initial length, l0: {l0}"
variable erate equal “1e9”
variable erate1 equal “v_erate/1e15” # true strain rate in fs

variable strain equal “(lx-v_l0)/v_l0”
variable p1 equal “v_strain”
variable p2 equal “-pxx”
variable p3 equal “-pyy”
variable p4 equal “-pzz”
variable stress equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol) # per-atom stress is negative of total pressure p

per-atom stress is sum of diagonal components in stress tensor

fix 8 all nvt temp {temp} {temp} 5.0 drag 1
fix 9 all deform 1 x erate ${erate1} units box remap x

fix print all print 100 “${p1} {p2} {p3} {p4}” file wgw.defo.txt screen no

timestep 1
thermo 100
#thermo_style custom step temp pe etotal vol press v_strain v_stress lx ly lz
thermo_style custom step temp vol press v_strain v_stress lx emol
dump 3 all xyz 5000 grap.xyz
dump 4 all image 25000 dump.*.jpg type type
run 50000
write_data data.grapsingle_md pair ij

unfix 8
unfix 9

Regards,
Baig

Hi Axel,

I solved the problem of segmentation fault. It was about the incorrect formatting in data file. However, using the morse potential is leading to much much lower values of strength with the corresponding value of strain. For example, I am getting 0.5 GPa in 0.05 strain. I found out that quartic bond_style is for bond breaking in LAMMPS. But, there is no parameters for quartic bond stretching in CVFF. Is there any other bond_style that can represent the graphene’s actual behavior?

​that is a question for a literature search, not a mailing list for a simulation software. also, it is not only the bond style that ​determines the behavior, but also the specific parameterization. that also includes non-bonded interactions with nearby atoms that are not 1-2, 1-3, or 1-4 neighbors. keep in mind, that “generic” force fields are usually parameterized to represent a certain set of reference or training molecules or systems. you’ll probably have to look for something that is parameterized specifically for graphene and not CVFF.

axel.

i don't know. ​as i already mentioned, this is a question about how to
conduct research in general and your project specifically and thus not
really a LAMMPS problem. if you have convincing proof that LAMMPS doesn't
compute forces/energies correctly, we can talk. but i don't have the time
to review everybody's research and tell them what how to do it. that is the
task of your adviser. ​

axel.

Hi Axel,

I could finally get the correct stress values by fix deform command without fixing any layer of atoms.

Here it is:
in the variable stress command I used:
variable speratom equal c_p[1]/2477.6588 instead of using variable stress equal (c_p[1]+c_p[2]+c_p[3])/(3*2477.6588) because the latter command was giving me total hydrostatic pressure of the system. If I take out 3 as dimension value from the command and used only stress in the x direction then I get fracture stress of around 140 GPa.
Here, 2477 is the volume of the graphene sheet.

Input file:

graphene (1-layer) (without functionalization/ions/tobermorite)

echo screen
log debug_grapsingle.log

units real
atom_style full
boundary p p p

bond_style morse
angle_style harmonic
dihedral_style harmonic
improper_style cvff

pair_style lj/cut/coul/long 10.0 10.0 # cutoff1 = 2.5*sigma

read_data data.grapsingle

kspace_style ewald 1e-4

neighbor 5.0 bin

#neigh_modify delay 0 every 1 one 10000 check yes
neigh_modify delay 0 every 1 check yes

pair_modify mix arithmetic tail no

group graphene type 1

compute tmpall graphene temp
compute mobile_temp graphene temp

variable temp equal “298” # Kelvin
velocity graphene create ${temp} 12345 temp mobile_temp dist gaussian mom yes rot no
#velocity graphene set 50 1 1 temp mobile_temp units box

#------------------energy minimization-----------------------------xxx
#------------------NVE + Temp/rescale------------------------------xxx

minimize 1.0e-4 1.0e-6 100 1000
min_style cg
min_modify dmax 0.1

fix 2 all nve
fix 3 all temp/rescale 1 {temp} {temp} 1.0 0.5
fix 4 all langevin {temp} {temp} 100.0 2341456

timestep 1
thermo 100
#thermo_style custom step temp pe etotal press vol density evdwl ecoul elong epair ebond eangle edihed eimp emol # epair = evdwl+ecoul+elong;
thermo_style custom step temp pe etotal press vol density
thermo_modify lost error flush yes # emol = ebond+eangle+edihed+eimp;
run 1000 # 500 ps

dump 1 all xyz 1 grap.xyz
#dump_modify 1 element C H O

write_data data.grapsingle_nve pair ij # Data after NVE+Langevin
unfix 2
unfix 3
unfix 4

#---------------------------NPT------------------------------------xxx
reset_timestep 0
fix 7 all npt temp {temp} {temp} 100.0 iso 1.01325 1.01325 1000.0 pchain 1 # Pressure unit in (atm)

timestep 1
thermo 100
#thermo_style custom step temp pe etotal press vol density evdwl ecoul elong epair ebond eangle edihed eimp emol # epair = evdwl+ecoul+elong;
thermo_style custom step temp pe etotal press vol density
thermo_modify lost error flush yes # emol = ebond+eangle+edihed+eimp;
run 1000 # 1000 ps

dump 2 all xyz 1 grap.xyz
write_data data.grapsingle_npt pair ij # Data after NVE+temp/rescaling+Langevin+NPT
unfix 7

#---------------------------MD simulation------------------------------------xxx

reset_timestep 0
compute peratom graphene stress/atom mobile_temp
compute p graphene reduce sum c_peratom[1] c_peratom[2] c_peratom[3] c_peratom[4] c_peratom[5] c_peratom[6]
compute peatom all pe/atom pair bond angle dihedral improper kspace
compute pe all reduce sum c_peatom
#compute radialdist all rdf 10
#compute r all reduce sum c_radialdist[1]

variable tmp equal “lx”
variable l0 equal {tmp} print "initial length, l0: {l0}"
variable erate equal “1e10”
variable erate1 equal “v_erate/1e15” # true strain rate in fs

variable strain equal “(lx-v_l0)/v_l0”
variable s1 equal “v_strain”
variable p1 equal c_p[1]
variable p2 equal c_p[2]
variable p3 equal c_p[3]
variable p4 equal c_p[4]
#variable stress equal (c_p[1]+c_p[2]+c_p[3])/(3*2477.6588) # per-atom stress is negative of total pressure p

per-atom stress is sum of diagonal components in stress tensor

variable speratom equal c_p[1]/2477.6588
variable speratom1 equal c_p[2]/2477.6588
variable speratom2 equal c_p[4]/2477.6588
variable peatom equal c_pe
#variable rdf equal c_r[1]

fix 8 all nvt temp {temp} {temp} 5.0 drag 1
fix 9 all deform 1 x erate ${erate1} units box remap x

fix print all print 100 “{s1} {p1} {p2} {p3} ${p4}” file wgw.defo.txt screen no

timestep 1
thermo 100
#thermo_style custom step temp pe etotal vol press v_strain v_stress lx ly lz
thermo_style custom step temp vol press v_strain v_speratom v_speratom1 v_speratom2 lx ly
dump 3 all xyz 5000 grap.xyz
dump 4 all image 25000 dump.*.jpg type type
run 30000 # 3 ns
write_data data.grapsingle_md pair ij

unfix 8
unfix 9