espressomd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ESPResSo] Extracting Values of Quantities Calculated during Simulat


From: Lorenzo Isella
Subject: Re: [ESPResSo] Extracting Values of Quantities Calculated during Simulation
Date: Tue, 20 Nov 2007 12:53:52 +0100

Dear Kai,
Many thanks for your suggestion.
After struggling a bit with TCL, I managed to save the particle
positions in the format I needed.
One other question (it should be straightforward): I need to do
exactly the same thing for the particle velocities, this time.
However, the analyze append/analyze config "sees" only the positions.
If I try saving the velocities with a blockfile using:

set f [open "config_vel_$i" "w"]
#blockfile $f write tclvariable {box_l density}
#blockfile $f write variable box_l
blockfile $f write particles "id v"
close $f

then in the resulting blockfile particle positions are automatically
added and I end up storing both the velocities and the positions,
which in itself would be pleasant.
I can still follow your suggestions to get the system configuration,
but I have not been able to retrieve the velocities.

Things like

blockfile "config_vel_27" read particles

did not work at all. Any suggestions? The info I need is already in
the blockfile, but I do not know how to get it.
Many thanks

Lorenzo



On 19/11/2007, Kai Grass <address@hidden> wrote:
>  Dear Lorenzo,
>
> one way to do, what you want, is to load your configurations as you wrote,
> and then use the
>
> analyze append
>
> command for each timestep to store the current particle coordinates within
> Espresso. When all configurations are loaded (and appended), you can use
>
> analyze config
>
> to get a tcl list of order Mx3N (where M is the number of configurations
> that you stored). This list can be analyzed on the tcl level by writing a
> user-defined function (tcl command proc) to obtain properties that are not
> hard-coded into Espresso.
>
> Likewise, if you only have one stored configuration,
>
> analyze config
>
> will return you a 3N list, that you can save to a file in any format you
> need for an external program.
>
> I hope that helps,
> Kai
>
>
>
> Am 19.11.2007 um 12:44 schrieb Lorenzo Isella:
>
> Dear All,
> I have a couple of questions about how to save and manipulate the
> output of a simulation with Espresso.
> Despite the manual, I have not been able to do what I have in mind.
> Apologies if it was already clear enough there, but I have been stuck
> for quite a while.
> 1) Say that you saved the configuration of your system in a blockfile
> using a command like:
>
> set f [open "config_$i" "w"]
> blockfile $f write tclvariable {box_l density}
> blockfile $f write variable box_l
> blockfile $f write particles {pos}
> close $f
>
> for i labeling the time during your simulation.
> Then you read the corresponding blockfile using:
> set f [open "config_$j" "r"]
> while { [blockfile $f read auto] != "eof" } {}
> close $f
>
>
> After reading the blockfile, I can use e.g. Espresso builtin functions
> to get a radius of gyration using one of its ready-to-use statistical
> functions.
> Now,  what if you want to calculate some statistics about the position
> of your particles along the x axis?
> In other words, how do you access that info which is not a hard-coded
> function in Espresso?
> 2)It is similar to the previous question: what if I just want to save
> the particle positions (x,y,z) as a N by 3 plain matrix to read it and
> post-process it with other tools which do not like the blockfile
> format?
>
> In general, as you can see, I have troubles in accessing "directly"
> some of the quantities which are internally calculated by Espresso.
> Many thanks
>
> Lorenzo
>
> _______________________________________________
> ESPResSo mailing list
> address@hidden
> https://fias.uni-frankfurt.de/mailman/listinfo/espresso
>
>
>
> --
> Dipl. Phys. Kai Grass
> Frankfurt Institute for Advanced Studies (FIAS)
> Room 2|403
> Ruth-Moufang-Strasse 1
> 60438 Frankfurt am Main
> Germany
>
> phone: +49 69 798 47533
> fax:   +49 69 798 47611
> mail:  address@hidden
> web:   www.fias.uni-frankfurt.de/~grass
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]