# Impose Gaussian distribution to property/atom

Hi Lammps users,
What is the easiest way to impose a profile on a new property/atom based on location ?
For eg. if the new property/atom is called G i.e. each atom has a new property/atom scalar G
I wish to set quantity G=function(atom’s z coordinate)
This is similar to imposing a linear velocity profile. But instead I wish to assign G=exp(-(z-mu)^2/ 2*sig) where z is the z position of the atom.
Thanks for any inputs!
Liz

Hi Lammps users,
What is the easiest way to impose a profile on a new property/atom based on
location ?
For eg. if the new property/atom is called G i.e. each atom has a new
property/atom scalar G
I wish to set quantity G=function(atom's z coordinate)
This is similar to imposing a linear velocity profile. But instead I wish to
assign G=exp(-(z-mu)^2/ 2*sig) where z is the z position of the atom.

with fix property/atom you can add any number of properties to your
atom and with atom style variables, you can initialize them to any
kind of atom/position dependent value.

axel.

Sorry for not explaining my question clearly. I wanted to see how to do it without changing the source code i.e. using an already existing command. I am not sure which command to use.
I read that I can use the set command with the variable command to set the value to the new property/atom based on its height.
This are the commands I use.
variable v atom 4*(0.1+0.25zz)
and use this variable to set the value of the new property atom.
It doesn’t do anything to the value G. It doesn’t even show any error messages.
I think I am misunderstanding something in the manual.
I would appreciate if anyone could point out the mistake or have an alternative way to do the same.

Thanks again,
Liz

Sorry for not explaining my question clearly. I wanted to see how to do it
without changing the source code i.e. using an already existing command. I

do you mean by this, that you *did* modify the source?

am not sure which command to use.
I read that I can use the set command with the variable command to set the
value to the new property/atom based on its height.
This are the commands I use.
variable v atom 4*(0.1+0.25*z*z)
and use this variable to set the value of the new property atom.

i don't understand what you mean by this. it is very difficult to
argue such matters based on descriptions alone, thus please provide a
complete input example.

It doesn't do anything to the value G. It doesn't even show any error
messages.

what value G? from where? how is it defined.

I think I am misunderstanding something in the manual.
I would appreciate if anyone could point out the mistake or have an
alternative way to do the same.

i already told you this. via fix proper/atom you can add as many
properties to atoms as you want.

axel.

I read that I can use the set command with the variable command to set the
value to the new property/atom based on its height.
This are the commands I use.
variable v atom 4*(0.1+0.25zz)
and use this variable to set the value of the new property atom.

You’re on the right track. See the set command with its d_name option

and use the atom-style variable you have defined. I suggest you

then dump the property/atom variable with its new attribute

and verify that you have set them to what you expect.

Steve