Topic Options
#37210 - 12/05/18 01:26 AM Charmm array
Rohit Offline
Forum Member

Registered: 10/25/17
Posts: 26
Hi,

I have read about set command and how to use array index with @@ but it does't say about how can we set/define the array.

say i want resid 2, 4, 9 and 11. so I want

my_array = [2,4,9,11] how can we define this array in charmm.


Edited by Rohit (12/05/18 01:27 AM)

Top
#37212 - 12/05/18 11:05 AM Re: Charmm array [Re: Rohit]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
One array element at a time, in a loop.

Also, duplicate posts are not permitted, and the other one was removed.
_________________________
Rick Venable
computational chemist


Top
#37214 - 12/06/18 03:32 AM Re: Charmm array [Re: rmv]
Rohit Offline
Forum Member

Registered: 10/25/17
Posts: 26
I cannot put 2, 4, 9, 11 in a loop as there is not constant increment these are random resid i want to access.

Top
#37215 - 12/06/18 11:07 AM Re: Charmm array [Re: Rohit]
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
Then use four separate lines.
If you have very many different values you can put them in a text file (one per line), which you can read into CHARMM variables using the get command (see miscom.doc)
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top

Moderator:  John Legato, lennart