automated way to calculate pressure profile in lammps?

Dear All,

Does anyone know if there is an automated way to calculate the pressure profile (I mean a pressure along some given Z-axis as a function of z-coordinate) in lammps?

Thank you!

How about compute stress/atom and fix ave/spatial?

Dear All,

Does anyone know if there is an automated way to calculate the pressure
profile (I mean a pressure along some given Z-axis as a function of
z-coordinate) in lammps?

takenobu nakamura (cc'd) presented some work on this at the LAMMPS
workshop in august 2013.

it has not (yet) been included in the official LAMMPS distribution.

axel.

Dear Naill,

Thank you for your hint.

The problem with “fix p_prof all ave/spatial …” is that the bin values are also averaged over the number of the atoms in the bin (or in another words bin counts). So that I get some average pressure on a single atom. the number of atoms for each bin is stored in the array p_prof[2] and the bin values are stored in the array p_prof[3]. as an out put I would like to have an array p_prof[2]*p_prof[3] where each element is the product of the corresponding elements of arrays p_prof[2] amd p_prof[3]. Unfortunately I cannot find the way to define in the lammps-input file an array of an arbitrary length (=Nbins) in order to save a new array p_prof[2]*p_prof[3]. I would appreciate any hint…

Thanks

Since you’re writing the output of fix ave/spatial to a file with
the 2 columns you want, and then post-processing it,
why not do the multiplication of the 2 columns in the post-process
step?

Steve

This is a LAMMPS package I wrote that contains some relevant examples, in terms of both input commands and post-processing as suggested in the previous messages:
See especially “examples/bilayer*”, as well as “tools/stress2press.py” Mario

Dear Steve, Thank you for the reply. Yes, sure post post-processing would be the next option. I just thought there was a way in LAMMPS (which slipped away from me) to declare and work with a global array of an arbitrary length.

Dear Mario, Thanks a lot for sharing your code and examples. it is very kind of you.

Have a nice weekend!

Dear Anton, Steve, Axel and Mario,

You can download my patch from
https://docs.google.com/ le/d/0B6Gmla2hklutZ2h1NC12LVZ1VHM/

and use "compute stress/spatial” whose manual is written in the attached pdf file, with “fix ave/time”.

Thanks,

Takenobu Nakamura

toIakovlev.pdf (63.4 KB)

Dear mario and LAMMPS User List,

I tried running the example system found in the "bilayer_128dopc4232wat" directory using mpiexec.mpich2 with the LAMMPS (8 Apr 2014) build from git. The simulation stops with "ERROR: Illegal compute stress/atom command (../compute_stress_atom.cpp:41)" message. Am I missing a certain package necessary for this compute? here's the output of make package-status:

/scratch/mylammps/src$ make package-status
Installed YES: package ASPHERE
Installed YES: package BODY
Installed NO: package CLASS2
Installed NO: package COLLOID
Installed YES: package DIPOLE
Installed NO: package FLD
Installed NO: package GPU
Installed NO: package GRANULAR
Installed NO: package KIM
Installed YES: package KSPACE
Installed YES: package MANYBODY
Installed NO: package MC
Installed NO: package MEAM
Installed NO: package MISC
Installed YES: package MOLECULE
Installed YES: package MPIIO
Installed YES: package OPT
Installed NO: package PERI
Installed NO: package POEMS
Installed NO: package REAX
Installed NO: package REPLICA
Installed YES: package RIGID
Installed NO: package SHOCK
Installed NO: package SRD
Installed NO: package VORONOI
Installed NO: package XTC

Installed NO: package USER-ATC
Installed NO: package USER-AWPMD
Installed NO: package USER-CG-CMM
Installed NO: package USER-COLVARS
Installed NO: package USER-CUDA
Installed NO: package USER-EFF
Installed NO: package USER-LB
Installed YES: package USER-MISC
Installed NO: package USER-MOLFILE
Installed NO: package USER-OMP
Installed NO: package USER-PHONON
Installed NO: package USER-QMMM
Installed NO: package USER-REAXC
Installed NO: package USER-SPH

Regards

Tatiana Kuznetsova

Dear Anton, Steve, Axel and Mario,

You can download my patch from
https://docs.google.com/ le/d/0B6Gmla2hklutZ2h1NC12LVZ1VHM/

the URL doesn't seem to work. also the doc refers to a Nov13 version.
there have been substantial changes to the core parts of LAMMPS since
in order to support simulations of larger molecular systems, so there
is no way that this code can be merged into the distribution without a
significant effort.

axel.

   Dear mario and LAMMPS User List,

I tried running the example system found in the "bilayer_128dopc4232wat"
directory using mpiexec.mpich2 with the LAMMPS (8 Apr 2014) build from git.
The simulation stops with "ERROR: Illegal compute stress/atom command
(../compute_stress_atom.cpp:41)" message. Am I missing a certain package
necessary for this compute? here's the output of make package-status:

no. the syntax for compute stress/atom changed a couple months ago to
require the id of a temperature compute (or NULL).
please compare the input to the documentation.

axel.

Dear Takenobu, thank you for sharing your code.

Dear Axel, thank you for your comment.

Regards, Anton