Re: [gmx-users] Getting the virial for each individual atom.

2013-01-22 Thread Timothy Sirk
Zach,

If you aren't using PBC, then how about saving total forces per atom and
use 'ri outer Fi' for the per-atom virial? And, if you want it, get the
kinetic part from 'm* (vi outer vi)'.

The virial shouldn't have to come from ij pairs, although that is certainly
a good way to get it.

Tim

On Tue, Jan 22, 2013 at 11:05 AM, Marcin, Zachary  wrote:

> Tim,
> The PBC's were turned off and need to be for what we're trying to do.
> Pretty much everything that might work, as far as I've seen, can't unless
> we change some source code to do what we need.
> Thanks,
> Zach
>
> On Mon, Jan 21, 2013 at 4:47 PM, Timothy Sirk  wrote:
>
> > Zach,
> >
> > Do you have periodic system with charges? For PBC, you might try one of
> the
> > forms in J. Chem. Phys. 131 154107 (2009). Electrostatics are more
> work...
> > For Ewald sum and PPPM contribution, you could check refs in
> > lammps.sandia.gov/doc/PDF/kspace.pdf
> >
> > We have an upcoming paper that explains in more detail how to do this
> with
> > PPPM and gives an example with heat flux. Maybe something similar could
> be
> > done in GROMACS with PME.
> >
> > best,
> >
> > Tim
> >
> >
> > On Mon, Jan 21, 2013 at 1:06 PM, Marcin, Zachary
> > wrote:
> >
> > > Berk,
> > > Here is where I think I might be able to:
> > > In calcvir.c there is a method called calc_vir which takes, among other
> > > things, int nxf(no idea what this does), rvec x[], and revec f[].  It
> > then
> > > does dvxx+= x[i][xx] *f[i][XX];.
> > > This is the same as the formula that I am trying to solve for (Vi*Pi +
> > > .5*SUM(Rij * Fij)).
> > > What I figured I could do is create another array to calculate the
> > virials
> > > for, thus giving me an index position per atom, and then use that
> > somehow.
> > >
> > > I also know that I can use R(ij) * F(ij), or the distance between
> atoms i
> > > and j times the Forces between atoms i and j.  If anyone has any
> insight
> > on
> > > getting these, that could also work.
> > > I know how to get the individual positions, but I don't know how I
> would
> > go
> > > about the forces aspect of that.
> > >
> > > Thanks,
> > > Zach
> > >
> > > On Mon, Jan 21, 2013 at 12:44 PM, Berk Hess  wrote:
> > >
> > > >
> > > > Hi,
> > > >
> > > > The virial has no meaning per atom.
> > > > And you can't get the virial per atom out of Gromacs, it is never
> > > > calculated in that way (see the manual for details).
> > > > A special local pressure version of Gromacs exists, but even there
> you
> > > > won't get a virial per atom.
> > > >
> > > > Cheers,
> > > >
> > > > Berk
> > > >
> > > > 
> > > > > Date: Mon, 21 Jan 2013 12:35:04 -0500
> > > > > From: zachary.mar...@wilkes.edu
> > > > > To: gmx-users@gromacs.org
> > > > > Subject: [gmx-users] Getting the virial for each individual atom.
> > > > >
> > > > > Hello,
> > > > > For the research I'm working with, I need to get the virial for
> each
> > > > > individual atom in the system. I've been tracing all of the calls
> > made
> > > in
> > > > > the methods related to virials(Version 4.5.5) and this is the call
> > > stack
> > > > > that I think has what I need.
> > > > > mdrun.c -> do_md in md.c -> do_force in sim_util.c -> calcvir.c
> > > > >
> > > > > I have a few questions that I was wondering if anyone could answer.
> > > > >
> > > > > 1. In sim_util.c, there is a comment that says "Total virial
> computed
> > > in
> > > > > global_stat, called from do_md". I cannot find where this is called
> > in
> > > > > do_md. Was this changed at any point and the comment was still left
> > in
> > > > the
> > > > > code?
> > > > >
> > > > > 2. If I change the codes in calcvir.c to find the virials for each
> > > > > individual atom, say by piping the atom numbers and forces and
> > > everything
> > > > > needed into another program so it doesn't effect the way that
> gromacs
> > > > runs
> > > > > and will still allow everything to do what it needs, will this be
> > > screwed
> > > > > up by/screw up the domain decomposition/the mpi stuff?
> > > > >
> > > > > Basically, I'm looking for advice on a method to output the
> > individual
> > > > > virials for each atom for each frame, instead of just the final
> > output
> > > of
> > > > > the average virial on the entire system.
> > > > > Thanks,
> > > > > Zach Marcin
> > > > > Wilkes University
> > > > > --
> > > > > gmx-users mailing list gmx-users@gromacs.org
> > > > > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > > > > * Please search the archive at
> > > > http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> > > > > * Please don't post (un)subscribe requests to the list. Use the
> > > > > www interface or send it to gmx-users-requ...@gromacs.org.
> > > > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> > > >   --
> > > > gmx-users mailing listgmx-users@gromacs.org
> > > > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > > > * Pl

Re: [gmx-users] Getting the virial for each individual atom.

2013-01-22 Thread Marcin, Zachary
Tim,
The PBC's were turned off and need to be for what we're trying to do.
Pretty much everything that might work, as far as I've seen, can't unless
we change some source code to do what we need.
Thanks,
Zach

On Mon, Jan 21, 2013 at 4:47 PM, Timothy Sirk  wrote:

> Zach,
>
> Do you have periodic system with charges? For PBC, you might try one of the
> forms in J. Chem. Phys. 131 154107 (2009). Electrostatics are more work...
> For Ewald sum and PPPM contribution, you could check refs in
> lammps.sandia.gov/doc/PDF/kspace.pdf
>
> We have an upcoming paper that explains in more detail how to do this with
> PPPM and gives an example with heat flux. Maybe something similar could be
> done in GROMACS with PME.
>
> best,
>
> Tim
>
>
> On Mon, Jan 21, 2013 at 1:06 PM, Marcin, Zachary
> wrote:
>
> > Berk,
> > Here is where I think I might be able to:
> > In calcvir.c there is a method called calc_vir which takes, among other
> > things, int nxf(no idea what this does), rvec x[], and revec f[].  It
> then
> > does dvxx+= x[i][xx] *f[i][XX];.
> > This is the same as the formula that I am trying to solve for (Vi*Pi +
> > .5*SUM(Rij * Fij)).
> > What I figured I could do is create another array to calculate the
> virials
> > for, thus giving me an index position per atom, and then use that
> somehow.
> >
> > I also know that I can use R(ij) * F(ij), or the distance between atoms i
> > and j times the Forces between atoms i and j.  If anyone has any insight
> on
> > getting these, that could also work.
> > I know how to get the individual positions, but I don't know how I would
> go
> > about the forces aspect of that.
> >
> > Thanks,
> > Zach
> >
> > On Mon, Jan 21, 2013 at 12:44 PM, Berk Hess  wrote:
> >
> > >
> > > Hi,
> > >
> > > The virial has no meaning per atom.
> > > And you can't get the virial per atom out of Gromacs, it is never
> > > calculated in that way (see the manual for details).
> > > A special local pressure version of Gromacs exists, but even there you
> > > won't get a virial per atom.
> > >
> > > Cheers,
> > >
> > > Berk
> > >
> > > 
> > > > Date: Mon, 21 Jan 2013 12:35:04 -0500
> > > > From: zachary.mar...@wilkes.edu
> > > > To: gmx-users@gromacs.org
> > > > Subject: [gmx-users] Getting the virial for each individual atom.
> > > >
> > > > Hello,
> > > > For the research I'm working with, I need to get the virial for each
> > > > individual atom in the system. I've been tracing all of the calls
> made
> > in
> > > > the methods related to virials(Version 4.5.5) and this is the call
> > stack
> > > > that I think has what I need.
> > > > mdrun.c -> do_md in md.c -> do_force in sim_util.c -> calcvir.c
> > > >
> > > > I have a few questions that I was wondering if anyone could answer.
> > > >
> > > > 1. In sim_util.c, there is a comment that says "Total virial computed
> > in
> > > > global_stat, called from do_md". I cannot find where this is called
> in
> > > > do_md. Was this changed at any point and the comment was still left
> in
> > > the
> > > > code?
> > > >
> > > > 2. If I change the codes in calcvir.c to find the virials for each
> > > > individual atom, say by piping the atom numbers and forces and
> > everything
> > > > needed into another program so it doesn't effect the way that gromacs
> > > runs
> > > > and will still allow everything to do what it needs, will this be
> > screwed
> > > > up by/screw up the domain decomposition/the mpi stuff?
> > > >
> > > > Basically, I'm looking for advice on a method to output the
> individual
> > > > virials for each atom for each frame, instead of just the final
> output
> > of
> > > > the average virial on the entire system.
> > > > Thanks,
> > > > Zach Marcin
> > > > Wilkes University
> > > > --
> > > > gmx-users mailing list gmx-users@gromacs.org
> > > > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > > > * Please search the archive at
> > > http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> > > > * Please don't post (un)subscribe requests to the list. Use the
> > > > www interface or send it to gmx-users-requ...@gromacs.org.
> > > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> > >   --
> > > gmx-users mailing listgmx-users@gromacs.org
> > > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > > * Please search the archive at
> > > http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> > > * Please don't post (un)subscribe requests to the list. Use the
> > > www interface or send it to gmx-users-requ...@gromacs.org.
> > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> > >
> > --
> > gmx-users mailing listgmx-users@gromacs.org
> > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> > * Please don't post (un)subscribe requests to the list. Use the
> > www interface or

Re: [gmx-users] Getting the virial for each individual atom.

2013-01-21 Thread Timothy Sirk
Zach,

Do you have periodic system with charges? For PBC, you might try one of the
forms in J. Chem. Phys. 131 154107 (2009). Electrostatics are more work...
For Ewald sum and PPPM contribution, you could check refs in
lammps.sandia.gov/doc/PDF/kspace.pdf

We have an upcoming paper that explains in more detail how to do this with
PPPM and gives an example with heat flux. Maybe something similar could be
done in GROMACS with PME.

best,

Tim


On Mon, Jan 21, 2013 at 1:06 PM, Marcin, Zachary
wrote:

> Berk,
> Here is where I think I might be able to:
> In calcvir.c there is a method called calc_vir which takes, among other
> things, int nxf(no idea what this does), rvec x[], and revec f[].  It then
> does dvxx+= x[i][xx] *f[i][XX];.
> This is the same as the formula that I am trying to solve for (Vi*Pi +
> .5*SUM(Rij * Fij)).
> What I figured I could do is create another array to calculate the virials
> for, thus giving me an index position per atom, and then use that somehow.
>
> I also know that I can use R(ij) * F(ij), or the distance between atoms i
> and j times the Forces between atoms i and j.  If anyone has any insight on
> getting these, that could also work.
> I know how to get the individual positions, but I don't know how I would go
> about the forces aspect of that.
>
> Thanks,
> Zach
>
> On Mon, Jan 21, 2013 at 12:44 PM, Berk Hess  wrote:
>
> >
> > Hi,
> >
> > The virial has no meaning per atom.
> > And you can't get the virial per atom out of Gromacs, it is never
> > calculated in that way (see the manual for details).
> > A special local pressure version of Gromacs exists, but even there you
> > won't get a virial per atom.
> >
> > Cheers,
> >
> > Berk
> >
> > 
> > > Date: Mon, 21 Jan 2013 12:35:04 -0500
> > > From: zachary.mar...@wilkes.edu
> > > To: gmx-users@gromacs.org
> > > Subject: [gmx-users] Getting the virial for each individual atom.
> > >
> > > Hello,
> > > For the research I'm working with, I need to get the virial for each
> > > individual atom in the system. I've been tracing all of the calls made
> in
> > > the methods related to virials(Version 4.5.5) and this is the call
> stack
> > > that I think has what I need.
> > > mdrun.c -> do_md in md.c -> do_force in sim_util.c -> calcvir.c
> > >
> > > I have a few questions that I was wondering if anyone could answer.
> > >
> > > 1. In sim_util.c, there is a comment that says "Total virial computed
> in
> > > global_stat, called from do_md". I cannot find where this is called in
> > > do_md. Was this changed at any point and the comment was still left in
> > the
> > > code?
> > >
> > > 2. If I change the codes in calcvir.c to find the virials for each
> > > individual atom, say by piping the atom numbers and forces and
> everything
> > > needed into another program so it doesn't effect the way that gromacs
> > runs
> > > and will still allow everything to do what it needs, will this be
> screwed
> > > up by/screw up the domain decomposition/the mpi stuff?
> > >
> > > Basically, I'm looking for advice on a method to output the individual
> > > virials for each atom for each frame, instead of just the final output
> of
> > > the average virial on the entire system.
> > > Thanks,
> > > Zach Marcin
> > > Wilkes University
> > > --
> > > gmx-users mailing list gmx-users@gromacs.org
> > > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> > > * Please don't post (un)subscribe requests to the list. Use the
> > > www interface or send it to gmx-users-requ...@gromacs.org.
> > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >   --
> > gmx-users mailing listgmx-users@gromacs.org
> > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> > * Please don't post (un)subscribe requests to the list. Use the
> > www interface or send it to gmx-users-requ...@gromacs.org.
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> --
> gmx-users mailing listgmx-users@gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> * Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-requ...@gromacs.org.
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
-- 
gmx-users mailing listgmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
* Please don't post (un)subscribe requests to the list. Use the 
www interface or send it to gmx-users-requ...@gromacs.org.
* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists


Re: [gmx-users] Getting the virial for each individual atom.

2013-01-21 Thread Bogdan Costescu
On Mon, Jan 21, 2013 at 7:06 PM, Marcin, Zachary
wrote

> dvxx+= x[i][xx] *f[i][XX];
>

Compare the indexing above with:


> This is the same as the formula that I am trying to solve for (Vi*Pi +
> .5*SUM(Rij * Fij)).
>

... the ones you want to have. See the difference ? The existing code takes
one atom at a time (i), what you want takes 2 atoms at a time (i & j). You
cannot calculate what you want from there, as the forces are already summed
per atom; Fij are the pairwise forces calculated in the kernels
corresponding to the different potentials.

Cheers,
Bogdan
-- 
gmx-users mailing listgmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
* Please don't post (un)subscribe requests to the list. Use the 
www interface or send it to gmx-users-requ...@gromacs.org.
* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists


Re: [gmx-users] Getting the virial for each individual atom.

2013-01-21 Thread Marcin, Zachary
Berk,
Here is where I think I might be able to:
In calcvir.c there is a method called calc_vir which takes, among other
things, int nxf(no idea what this does), rvec x[], and revec f[].  It then
does dvxx+= x[i][xx] *f[i][XX];.
This is the same as the formula that I am trying to solve for (Vi*Pi +
.5*SUM(Rij * Fij)).
What I figured I could do is create another array to calculate the virials
for, thus giving me an index position per atom, and then use that somehow.

I also know that I can use R(ij) * F(ij), or the distance between atoms i
and j times the Forces between atoms i and j.  If anyone has any insight on
getting these, that could also work.
I know how to get the individual positions, but I don't know how I would go
about the forces aspect of that.

Thanks,
Zach

On Mon, Jan 21, 2013 at 12:44 PM, Berk Hess  wrote:

>
> Hi,
>
> The virial has no meaning per atom.
> And you can't get the virial per atom out of Gromacs, it is never
> calculated in that way (see the manual for details).
> A special local pressure version of Gromacs exists, but even there you
> won't get a virial per atom.
>
> Cheers,
>
> Berk
>
> 
> > Date: Mon, 21 Jan 2013 12:35:04 -0500
> > From: zachary.mar...@wilkes.edu
> > To: gmx-users@gromacs.org
> > Subject: [gmx-users] Getting the virial for each individual atom.
> >
> > Hello,
> > For the research I'm working with, I need to get the virial for each
> > individual atom in the system. I've been tracing all of the calls made in
> > the methods related to virials(Version 4.5.5) and this is the call stack
> > that I think has what I need.
> > mdrun.c -> do_md in md.c -> do_force in sim_util.c -> calcvir.c
> >
> > I have a few questions that I was wondering if anyone could answer.
> >
> > 1. In sim_util.c, there is a comment that says "Total virial computed in
> > global_stat, called from do_md". I cannot find where this is called in
> > do_md. Was this changed at any point and the comment was still left in
> the
> > code?
> >
> > 2. If I change the codes in calcvir.c to find the virials for each
> > individual atom, say by piping the atom numbers and forces and everything
> > needed into another program so it doesn't effect the way that gromacs
> runs
> > and will still allow everything to do what it needs, will this be screwed
> > up by/screw up the domain decomposition/the mpi stuff?
> >
> > Basically, I'm looking for advice on a method to output the individual
> > virials for each atom for each frame, instead of just the final output of
> > the average virial on the entire system.
> > Thanks,
> > Zach Marcin
> > Wilkes University
> > --
> > gmx-users mailing list gmx-users@gromacs.org
> > http://lists.gromacs.org/mailman/listinfo/gmx-users
> > * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> > * Please don't post (un)subscribe requests to the list. Use the
> > www interface or send it to gmx-users-requ...@gromacs.org.
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>   --
> gmx-users mailing listgmx-users@gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> * Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-requ...@gromacs.org.
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
-- 
gmx-users mailing listgmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
* Please don't post (un)subscribe requests to the list. Use the 
www interface or send it to gmx-users-requ...@gromacs.org.
* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists


RE: [gmx-users] Getting the virial for each individual atom.

2013-01-21 Thread Berk Hess

Hi,

The virial has no meaning per atom.
And you can't get the virial per atom out of Gromacs, it is never calculated in 
that way (see the manual for details).
A special local pressure version of Gromacs exists, but even there you won't 
get a virial per atom.

Cheers,

Berk


> Date: Mon, 21 Jan 2013 12:35:04 -0500
> From: zachary.mar...@wilkes.edu
> To: gmx-users@gromacs.org
> Subject: [gmx-users] Getting the virial for each individual atom.
>
> Hello,
> For the research I'm working with, I need to get the virial for each
> individual atom in the system. I've been tracing all of the calls made in
> the methods related to virials(Version 4.5.5) and this is the call stack
> that I think has what I need.
> mdrun.c -> do_md in md.c -> do_force in sim_util.c -> calcvir.c
>
> I have a few questions that I was wondering if anyone could answer.
>
> 1. In sim_util.c, there is a comment that says "Total virial computed in
> global_stat, called from do_md". I cannot find where this is called in
> do_md. Was this changed at any point and the comment was still left in the
> code?
>
> 2. If I change the codes in calcvir.c to find the virials for each
> individual atom, say by piping the atom numbers and forces and everything
> needed into another program so it doesn't effect the way that gromacs runs
> and will still allow everything to do what it needs, will this be screwed
> up by/screw up the domain decomposition/the mpi stuff?
>
> Basically, I'm looking for advice on a method to output the individual
> virials for each atom for each frame, instead of just the final output of
> the average virial on the entire system.
> Thanks,
> Zach Marcin
> Wilkes University
> --
> gmx-users mailing list gmx-users@gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> * Please search the archive at 
> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> * Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-requ...@gromacs.org.
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
  --
gmx-users mailing listgmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
* Please don't post (un)subscribe requests to the list. Use the
www interface or send it to gmx-users-requ...@gromacs.org.
* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists