[ase-users] ASE LAMMPS: update Atoms object coordinates and use constraints

- mazay0 at gmail.com
Tue Mar 14 06:34:06 CET 2017


Please, show your code.
Minimization should be done with  LBFGS,MDMin,FIRE classes from
ase.optimize. Where do you call minimize() function ?


Concerning constraints in LAMMPS input file.
Right now I work on  this functionality here:
https://gitlab.com/Mazay0/ase/tree/lammps-multistep
Currently you can fix atoms with the following parameters of the calculator:

params['group'] = ['lower_atoms id ' + ' '.join([str(atom.index+1) for atom
in sio2 if atom.position[2] < 6 ])] # named group of all atoms if z
coordinate less than 6.0
params['fix'] = ['freeze_lower_atoms lower_atoms setforce 0.0 0.0 0.0']  #
fix their position, in fact you can used any fix from here:
http://lammps.sandia.gov/doc/fix.html

For a while my code do not consider ASE constraints, but in future I am
going  to implement automatic generation of fix commands from Atoms's
constraints.

Also you can control trajectory generation with two parameters of the
calculator:

calc.trajectory_out = Trajectory('/tmp/sio2.run.traj','w') # convert LAMMPS
trajectory  from 'trj_xxx' to ASE trajectory '/tmp/sio2.run.traj'
calc.dump_period = 20   # write trajectory frame each 20 steps

To run multistep simulation just pass the desired number of steps:

params['run'] = 100000
calc.parameters = params

and call run() method of the calculator:

calc.run()


For multistep minimization there is a code in lammpsrun.py that should
accept something like this:

params['minimize'] = 'etol ftol maxiter maxeval' # see
http://lammps.sandia.gov/doc/minimize.html for details

But I have not tested it yet.




On 14 March 2017 at 00:28, Spencer Hills via ase-users <
ase-users at listserv.fysik.dtu.dk> wrote:

> Hello,
>
> I am new to ASE and am trying to use it to look at different data types by
> calling other functions (ex: LAMMPS). With the ASE atoms object it is very
> easy to keep everything stored in one place. I am using lammpsrun.py from
> the standard ASE package to write input files from a code, so that I can
> make a modular code and not require the user to write lammps input file
> everytime they want to run the code.
>
> However, when I use LAMMPS and call the minimize function, I run into some
> difficulties. It will minimize the energy correctly (compared to running
> lammps with the python library version of it and the same inputs), but it
> does not update the positions of the atoms in the atoms object, so I can't
> compare the minimized energy to anything else because its a different
> arrangement.
>
> Is there a way to update the atoms object with the LAMMPS minimized
> structure? I think that I could make it read the trajectory file and
> convert that to positions, but I would rather not save the temporary files
> in order to do this. Is there a more elegant way to do this? Or is there a
> current implementation in ASE?
>
> Additionally, when I call the minimize function, it does not use the
> constraints that I assign to it. Right now I am starting simple with one
> atom at a fixed position, but this atom does not stay in the same position.
>
> Is there a way to pass the constraints to the LAMMPS input file?
>
> I've looking through some of the mailing list, and have been unable to
> find answers to the questions. Any direction, either to previous threads or
> general help on this issue would be appreciated!
>
> Thanks,
> Spencer Hills
> Research Aide
> Argonne National Lab
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170314/99d52984/attachment-0001.html>


More information about the ase-users mailing list