LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] [EXTERNAL] Re: how to output an average of compute gyration/chunk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] [EXTERNAL] Re: how to output an average of compute gyration/chunk


From: "Frischknecht, Amalie L" <alfrisc@...3...>
Date: Tue, 12 Sep 2017 14:53:59 +0000

 

Thanks, but I don’t think that solves my problem. If I instead set aveRg to be an equal style variable, like this:

 

compute               c1 all chunk/atom molecule

compute               myChunk all gyration/chunk c1

variable                 aveRg equal ave(c_myChunk)

 

fix                            3 all ave/time 100 1 100 v_aveRg file Rg.out mode scalar

 

then I get the following run-time error:

ERROR: Invalid special function in variable formula (../variable.cpp:4015)

 

My understanding is that the gyration/chunk compute returns a global vector, as per the lammps manual: “This compute calculates a global vector if the tensor keyword is not specified and a global array if it is.”

 

So the input to ave() is a vector, so I need to specify it with vector.  The ouput of the ave() function should be a scalar. So I think I should use:

 

compute               c1 all chunk/atom molecule

compute               myChunk all gyration/chunk c1

variable                 aveRg vector ave(c_myChunk)

 

fix                            3 all ave/time 100 1 100 v_aveRg file Rg.out mode scalar

 

But now LAMMPS complains with:

ERROR: Fix ave/time variable is not equal-style variable (../fix_ave_time.cpp:216)

 

So I guess fix ave/time can’t deal with a function that takes a vector and returns a scalar?  Any suggestions on how to access the result of the ave() function when it’s input is a vector?

 

Thanks,

Amalie

 

From: Axel Kohlmeyer <akohlmey@...24...>
Date: Friday, September 1, 2017 at 4:44 PM
To: Amalie Frischknecht <alfrisc@...3...>
Cc: "lammps-users@lists.sourceforge.net" <lammps-users@lists.sourceforge.net>
Subject: [EXTERNAL] Re: [lammps-users] how to output an average of compute gyration/chunk

 

 

 

On Fri, Sep 1, 2017 at 6:26 PM, Frischknecht, Amalie L <alfrisc@...3...> wrote:

 

Hi,

 

I am running simulations of a simple polymer melt.  I want to calculate the average radius of gyration of all the polymer chains at a given timestep.  I tried to do this by computing the Rg for each molecule using gyration/chunk, and then averaging all of the resulting Rg’s to get one scalar variable.  I think I have to use a variable to do this, since the output of compute gyration/chunk is a global vector.  So I used the ave() function.  But now I can’t seem to print the result to a file, using fix ave/time.  Here is what I have tried:

 

compute               c1 all chunk/atom molecule

compute               myChunk all gyration/chunk c1

variable                 aveRg vector ave(myChunk)

 

​shouldn't aveRg be an equal style variable?​ the output of ave() is a scalar, right?

 

axel.

 

 

fix                            3 all ave/time 100 1 100 v_aveRg file Rg.out mode vector

 

But I get an error saying:

ERROR: Invalid special function in variable formula

 

If I instead tell fix ave/time that its mode is scalar, I get:

ERROR: Fix ave/time variable is not equal-style variable

 

But ave() requires a vector-style variable.  So I’m stuck.  Is this calculation possible in LAMMPS?  Or should I just output the Rg of each individual molecule and use a post-processing step to average them?

 

Thanks,

Amalie

 

-----------------------------------------------------

 

Amalie Frischknecht, Ph.D.

Center for Integrated Nanotechnologies

Sandia National Laboratories

PO Box 5800 MS-1315

Albuquerque, NM 87185-1315

 

505-284-8585 (office)

505-284-7778 (fax)

alfrisc@...3...

 

-----------------------------------------------------

 

 

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lammps-users



 

--

Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.