[Top][All Lists]

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

[ESPResSo-devel] Re: Doubt in an analysis TCL script provided with Espre

From: prateeksha s
Subject: [ESPResSo-devel] Re: Doubt in an analysis TCL script provided with Espresso
Date: Wed, 23 Jan 2008 15:32:45 +0530


I'm encountering problems in modes.c file. Could you please tell me if I'm setting the grid size right?

My simulation box length 'box_l' - Set to size of molecule = 64 (xdir and ydir)
'modes_grid_3d[xdir]' = 64
'modes_grid_3d[ydir]' = 64

gridsize becomes 1 as follows:
  grid_size[xdir] = box_l[xdir]/(double)mode_grid_3d[xdir];  = 1
  grid_size[ydir] = box_l[ydir]/(double)mode_grid_3d[ydir];  = 1

If I set modes_grid_3d to any other value like 32 or so , it program is crashing .


On 1/21/08, Axel Arnold < address@hidden> wrote:
Am Montag 21 Januar 2008 12:38 schrieb prateeksha s:
> Hi,
> I am developing using Espresso code, and I'm converting the
> fluctuations.tclscript, found in packages/mbtools/analysis/, to C. I
> encountered this piece
> of TCL which I do not understand, hence, I'm unable to translate it to C.
> The difficult-to-understand code is in italics :
> set re [expr *[lindex [lindex $rawmodes 1 $i $j] 0]**$norm]
> set im [expr *[lindex [lindex $rawmodes 1 $i $j] 1]**$norm]
> *rawmodes* is a 2D array( or is it? ) so trying* rawmodes[1][i][j][0]* just
> doesn't make sense.
> Can somebody please clarify.

rawmodes is not a simply array, but has the form "{Modes} {2d-array of complex
values}", where each complex number is itself a two-element array, therefore
the second element is 3d. Therefore, [lindex [lindex $rawmodes 1 $i $j] 0] is
the real part of mode i,j, and  [lindex [lindex $rawmodes 1 $i $j] 1] the
imaginary part. So, the first 1 after rawmodes selects the 2d-array instead
of the "Modes" string, and the last 0/1 the real/imaginary part.


Dr. Axel Arnold
Fraunhofer Institute for Algorithms and Scientific Computing (SCAI)
Schloss Birlinghoven
53754 Sankt Augustin

reply via email to

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