[lammps-users] MgO single crystal- application of finite strain

Dear all,

I have been struggling with an issue for some while and I was wondering of you could please help me,

I have been applying a finite strain to an MgO single crystal structure using the xyz file attached and the box I’m applying to starts with 30A length but seems to explode after that. Do you know why this is happening or what I need to do to prevent it? The first two line of the log file looks like this. I have attached the script, log file and MgO xyz file for your reference.

Step Temp TotEng Pxx Pyy Pzz Pxy Pxz Pyz Lx Ly Lz
0 0 1959.4485 259813.66 259813.66 259813.66 23.101943 23.101943 23.101943 30.5 30.5 30.5
46 0 -0.055172576 -4.9390244e-07 -4.933589e-07 -4.9324378e-07 3.0135869e-09 3.0135869e-09 3.0135869e-09 100.48519 100.48519 100.48519

In another also tried to define the MgO structure using the custom lattice command but the results are not yet what I expect

units metal
atom_style atomic

boundary p p p
lattice custom 4.212 a1 0.0 0.5 0.5 a2 0.5 0.0 0.5 a3 0.5 0.5 0.0 &
basis 0.0 0.0 0.0 basis 0.5 0.5 0.5
region box prism 0 2 0 2 0 2 0.0 0.0 0.0
create_box 2 box
create_atoms 2 box
mass 1 16
mass 2 24.035

I would appreciate help on this very much as I am in urgent need for the results

Best Regards
Sara

MgO.xyz (53.9 KB)

in.elastic_NVT_Tension (1.8 KB)

constants2mgo100K.lammps (70.4 KB)

Before you try to pull on the system, have you tried creating
it at equilibrium and just running NVE to see if it is
stable and producing the right thermodynamics? If you
can do that, then you should be able to pull on it slowly.
If you pull too fast, things will always become unphysical
and even blow up.

Steve

Dear all,

dear sara,

I have been struggling with an issue for some while and I was wondering of
you could please help me,
I have been applying a finite strain to an MgO single crystal structure
using the xyz file attached and the box I'm applying to starts with 30A
length but seems to explode after that. Do you know why this is happening or
what I need to do to prevent it? The first two line of the log file looks

if your simulation is misbehaving, then you can
almost always expect that you have done some
wrong. only occasionally, you may run into a bug,
and it is even less likely that you have stumbled
over some interesting and new science.

with that in mind, it is always a good idea to visually
double check your input. just visualizing the attached
data file shows, that there is something _fundamentally_
wrong: when setting up an ionic crystal with periodic
boundary conditions, you cannot have identical elements
on the faces and corners. this is the reason why you
get such high pressure and energy and then your system
"explodes" (as it should).

on top of that, you have overlapping atoms, which is not
really helping much. please have a look at the attached
image that highlights the problem by showing your principal
simulation cell surrounded by its periodic copies in two
dimensions.

like this. I have attached the script, log file and MgO xyz file for your
reference.

  Step     Temp TotEng        Pxx                   Pyy          Pzz
       Pxy        Pxz                 Pyz               Lx

Ly Lz
0 0 1959.4485 259813.66 259813.66 259813.66
23.101943 23.101943 23.101943 30.5 30.5 30.5

actually, the script does _not_ match the output here.
in fact, the data file doesn't even read correctly due to
some excess and misformatted lines.

in general, you cannot expect people here to do _your_
work for you and debug your input unless you have
some kind of proof that there is a bug in the lammps code.

in that case, however, you should also explain how to run
your input (e.g. if one has to use the -var switch and how).
just keep in mind that nobody here can read your mind and
thus you would have to make it as easy as possible for
people to reproduce your problem in order to get useful
help. providing files is good, but each obstacle in running
them will reduce the chances, that somebody will give them
a try.

  46            0 \-0\.055172576 \-4\.9390244e\-07 \-4\.933589e\-07

-4.9324378e-07 3.0135869e-09 3.0135869e-09 3.0135869e-09 100.48519
100.48519 100.48519
In another also tried to define the MgO structure using the custom lattice
command but the results are not yet what I expect

so what _would_ you expect and what do you get instead?

again, if you want help, you have to make it easy to help and
spell it out where the problem is instead of letting people guess.

units metal
atom_style atomic

boundary p p p
lattice custom 4.212 a1 0.0 0.5 0.5 a2 0.5 0.0 0.5 a3 0.5 0.5 0.0 &
basis 0.0 0.0 0.0 basis 0.5 0.5 0.5
region box prism 0 2 0 2 0 2 0.0 0.0 0.0
create_box 2 box
create_atoms 2 box
mass 1 16
mass 2 24.035

I would appreciate help on this very much as I am in urgent need for the
results

a final remark: whether you need your urgently or not,
is primarily your concern, not ours. stating this in a request
for help, is another item that will - in general - lower the
chances to get (good) help. it would make sense, if you
would have a service contract, but the opposite is the
case, people volunteer their time and pointing out your
urgency without providing any incentive beyond that
to help you, only reminds people that they all have
urgent projects. :wink:

cheers,
     axel.

mgo-init-snap.jpg

Thanks steve for your reply.
I gave that a try and this time the change in length of the box is not huge but the pressure is unreasonable and when i for example plot Pxx-Time, It shows that the pressure stays constant at 150bars throughout the period of 450 Psecs accroding to Axel’s email the MgO.xyz file that I used as the input file has problems but when I define the lattice using the custom command the problem is not eliminate and looks similar as before. I have written the lattice definition section and potential section below: (I should mention I used the same script for Silicon using the lattice and potential used in the ELASTIC example of lammps and the script worked fine).
Thank you for your kind help.
Sara

Lattice Definition

boundary p p p
lattice custom 4.212 a1 0.0 0.5 0.5 a2 0.5 0.0 0.5 a3 0.5 0.5 0.0 &
basis 0.0 0.0 0.0 basis 0.5 0.5 0.5
region box prism 0 2 0 2 0 2 0.0 0.0 0.0
create_box 2 box
create_atoms 2 box
mass 1 16

mass 2 24.035

#Potential definition

pair_style buck 12

pair_coeff 1 1 676.9 0.3683 32.52
pair_coeff 2 2 0.0 0.1 0.0
pair_coeff 1 2 2134.39 0.2763 3.05
neighbor 2 bin
neigh_modify once no every 1 delay 0 check yes
min_style cg
min_modify dmax 1.0e-2 line quadratic

Setup output

thermo 1
thermo_style custom step temp pe press pxx pyy pzz pxy pxz pyz lx ly lz vol
thermo_modify norm no

Dear Axel and lammp users

Thanks for your reply and thanks for the visualized image of my input file, it helped a lot. I had received this file from a friend who had used it in his own work and I did not have any software to check the file. I should mention I have only recently started using lammps and learning simulation in general therefore if I don’t explain the details of everything or if my questions seem too simple it’s due to the fact that I am in the learning process.

Axel, you mentioned the out put file does not match the script, I have made an honest mistake and attached the wrong file and that is because I ran the same simulation several times on the same day and it has been a simple mistake and i apologize for that.I used the same script using Si lattice and potential given in ELASTIC example of lammps and the results seemed ok. That is that the out put pressures Pxx, Pyy, Pzz increased in a step like feature with time and then when I plotted stress-strain I was able to derive the elastic modulus but when I used the lattice definition and potential definition below it did not work and my pressure Pxx for example stayed constant with time. below is the lattice definition and potential definition. I have aslo attached the script I used (i checked it on my computer and it works). I ran it using this mpirun lmp -var T 100 -echo screen < in.elastic_NVT_Tensionmgo

Lattice Definition

boundary p p p
lattice custom 4.212 a1 0.0 0.5 0.5 a2 0.5 0.0 0.5 a3 0.5 0.5 0.0 &
basis 0.0 0.0 0.0 basis 0.5 0.5 0.5
region box prism 0 2 0 2 0 2 0.0 0.0 0.0
create_box 2 box
create_atoms 2 box
mass 1 16

mass 2 24.035

#Potential definition

pair_style buck 12

pair_coeff 1 1 676.9 0.3683 32.52
pair_coeff 2 2 0.0 0.1 0.0
pair_coeff 1 2 2134.39 0.2763 3.05
neighbor 2 bin
neigh_modify once no every 1 delay 0 check yes
min_style cg
min_modify dmax 1.0e-2 line quadratic

Setup output

thermo 1
thermo_style custom step temp pe press pxx pyy pzz pxy pxz pyz lx ly lz vol
thermo_modify norm no

Axel on your final remark:
I should mention that i do not know how this forum works but for sure did not think it is peoples responsibility to respond to my email, since I perception is this place is a public forum and any one who thinks they can help does so out of generosity and good will. Since I’m a beginner in simulation world any comment on my work is beneficial for me and I fully embrace it. So when I state I urgently need help I simply mean I urgently need help and would welcome any comment or advice anyone might have, I do not mean to force anyone into helping me as I’m sure everybody here is very busy. so if in any way I offended you or any of the people reading my request, it surly was not my intention and I’m sorry it was perceived that way. :slight_smile:

In the end I thank you for your help and time.

Thanks and regards
Sara

in.elastic_NVT_Tensionmgo (2.1 KB)

Dear Axel and lammp users
Thanks for your reply and thanks for the visualized image of my input file,
it helped a lot. I had received this file from a friend who had used it in
his own work and I did not have any software to check the file. I should

that file is definitely wrong for use with periodic boundaries and it
is a mystery to me, how somebody could have used it in his own
work without noticing the problem.

you can read lammps data files into VMD using the topotools plugin.

http://www.ks.uiuc.edu/Research/vmd/plugins/topotools/
http://sites.google.com/site/akohlmey/software/topotools

after you have installed version 1.1 of the plugin (you need v1.1
for triclinic cells, but your cell is actually cubic, so you could
also use v1.0 if you delete the line with the mixed terms for the
cell definition. the command

topo readlammpsdata MgO.xyz atomic

will load your file and then you can visualize it.

mention I have only recently started using lammps and learning simulation in
general therefore if I don't explain the details of everything or if my
questions seem too simple it's due to the fact that I am in the learning
process.

visualizing your input data, is probably _the_ most important tool
to check the correctness of your input data. you did notice the
inconsistency in the pressure, but the visualization of your results,
will most of the time tell you where it is coming from.

Axel, you mentioned the out put file does not match the script, I have made
an honest mistake and attached the wrong file and that is because I ran the
same simulation several times on the same day and it has been a simple
mistake and i apologize for that.I used the same script using Si lattice and
potential given in ELASTIC example of lammps and the results seemed ok. That

as i said before. the problem is not the input script, but the data file.
with plain silicon there is no issue with having equally charged particles
as direct neighbors, if the simulation cell is not defined correctly.

[...]

Axel on your final remark:
I should mention that i do not know how this forum works but for sure did
not think it is peoples responsibility to respond to my email, since
I perception is this place is a public forum and any one who thinks they can
help does so out of generosity and good will. Since I'm a beginner in
simulation world any comment on my work is beneficial for me and I fully
embrace it. So when I state I urgently need help I simply mean I urgently
need help and would welcome any comment or advice anyone might have, I do

as i wrote before, there is no need to point it out.
if you didn't need help, you wouldn't ask for it.

not mean to force anyone into helping me as I'm sure everybody here is very
busy. so if in any way I offended you or any of the people reading my
request, it surly was not my intention and I'm sorry it was perceived that
way. :slight_smile:

this is no problem. if i was offended, i would not have answered. i simply made
my remarks in order for you to have a chance to get _better_ help the next time
around. you also have to keep in mind, that this kind of forum is no replacement
for getting properly trained in doing MD. it is expected that you
acquire this kind
of training off-list from text books and talking to colleagues and advisors.
we had a few heated discussions on the list with people that thought, they could
do MD without that and as far as i can tell, it all ended in a huge
waste of time of
everybody involved. the typical policy is to be generous and forgiving at the
first few questions and then increasingly demanding over time.

your best chance to get help is when you demonstrate that you have made
an honest effort to get as far as possible (and that usually means more than
a couple hours worth of work) and then try to make it as easy as possible
for others to reproduce your problem. in short, people are most likely to
help if you have done your "homework" first.

the fact that you didn't visualize your simulation would be an example
of not having done the "homework". now you know and can try to do it
better the next time around.

cheers,
    axel.

Dear Axel,

Thanks so much for introducing me to VMD software. It is amazing and makes everything a lot more clearer.

Best Regards
Sara