compute: bond orientation factor

Dear all,

I started using LAMMPS 4 months ago and want to simulate semi crystalline polymers. I could not find a compute for examining the crystallinity of a polymer chain… Although my programming skills are not really good I started to program a compute to calculate a bond orientation factor by myself. I started from “compute_coord_atom” and modified the code. So far it seems to be running ok (but still some testing needed on different structures). If there is somebody on the list who is interested in this and would like to have a look on my code, I’d be happy to share, let me know.

Some general questions I could not find an answer in the manual:

  • How often is a compute invoked. Each timestep, or just when the output is needed for a dump? If it is each timestep, is there a possibility to invoke it just when needed?

  • Is there the possibility to get a “full” bond list somewhere? I found “atom->bond_atom”, but here I just get the bonds according to the input data file and not a “full” list.

  • Maybe this is trivial, but I could not find out. Does it make a difference if the function in the compute is called “void ComputeBOFAtom::compute_peratom()” or “void ComputeBOFAtom::compute_local()”? What is the difference?

  • At the end there is a function “double ComputeBOFAtom::memory_usage()”: Am I right that this function returns the amount of memory that is needed for the per atom vector/array or is it the total memory used for the compute?

  • I had a look at different computes. Some initialize by “memory->create(…)”, others by “var = new double*[i]”, others just by “double var[i]”. Any recommendation for nice LAMMPS coding?

Kind regards

Dipl.-Ing. Wolfgang Verestek

Institute for Materials Testing, Materials Science and Strength of Materials (IMWF)

Universität Stuttgart

Pfaffenwaldring 32

70569 Stuttgart

Tel: +49 711 685 62583

Fax: +49 711 685 62635

E-Mail: wolfgang.verestek@…4387…

Web: http://www.imwf.uni-stuttgart.de

Dear all,

I started using LAMMPS 4 months ago and want to simulate semi crystalline
polymers. I could not find a compute for examining the crystallinity of a
polymer chain… Although my programming skills are not really good I started
to program a compute to calculate a bond orientation factor by myself. I
started from “compute_coord_atom” and modified the code. So far it seems to
be running ok (but still some testing needed on different structures). If
there is somebody on the list who is interested in this and would like to
have a look on my code, I’d be happy to share, let me know.

Some general questions I could not find an answer in the manual:

- How often is a compute invoked. Each timestep, or just when the
output is needed for a dump? If it is each timestep, is there a possibility
to invoke it just when needed?

computes are updated as needed. see Modify::addstep_compute()

- Is there the possibility to get a “full” bond list somewhere? I
found “atom->bond_atom”, but here I just get the bonds according to the
input data file and not a “full” list.

what is a "full" list?

- Maybe this is trivial, but I could not find out. Does it make a
difference if the function in the compute is called “void
ComputeBOFAtom::compute_peratom()” or “void
ComputeBOFAtom::compute_local()”? What is the difference?

yes. Compute::compute_peratom() computes a property that is computed
for every atom.
the difference is evident, when you look at the existing /local and
/atom computes.

- At the end there is a function “double
ComputeBOFAtom::memory_usage()”: Am I right that this function returns the
amount of memory that is needed for the per atom vector/array or is it the
total memory used for the compute?

this is an optional feature and is used for accounting purposes only.
it should contain the amount of memory that is allocated by the
compute itself.

axel.

- I had a look at different computes. Some initialize by
“memory->create(…)”, others by “var = new double*[i]”, others just by
“double var[i]”. Any recommendation for nice LAMMPS coding?

use memory->create()/destroy() for everything that is large and would
be kept around for a long time. also, it can only be used on simply
data types. use new/delete for small, temporary allocations or when
allocating classes. try to avoid allocation of arrays on the stack. if
the argument is a variable, it may not be portable across c++
compilers.

axel.