Previous Thread
Next Thread
Print Thread
Selection within a cylinder
#35935 09/06/16 06:53 PM
Joined: Nov 2011
Posts: 79
Forum Member
OP Offline
Forum Member
Joined: Nov 2011
Posts: 79
Hi CHARMMers,

I am curious of making selections within a cylindrical region.

For example, if I want to find number of water molecules between -20 Angstrom and -15 Angstrom along the z-axis, it is easy to define z-range using "(prop Z .gt. -20) .and. (prop Z .lt. -15)", but how can I define the region on xy-plane?

Thanks in advance.

Best

Shane


Zhi (Shane) Yue
Department of Chemistry
University of Chicago
Re: Selection within a cylinder
shane yue #35936 09/06/16 07:44 PM
Joined: Sep 2003
Posts: 4,816
Likes: 2
Forum Member
Online Content
Forum Member
Joined: Sep 2003
Posts: 4,816
Likes: 2
For a cylinder of radius Rc the following should work

scalar x store 1
scalar y store 2
scalar sca1 pow 2.0
scalar sca2 pow 2.0
scalar sca1 +store 2
scalar sca2 sqrt

define inxysel sele prop sca2 .le. "rc" end

define cylinder sele inxysel .and. ( your-z-selection) .and. type oh2 end
echo Number of water molecules in cylinder: @cylinder


Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden
Re: Selection within a cylinder
lennart #35937 09/06/16 08:43 PM
Joined: Nov 2011
Posts: 79
Forum Member
OP Offline
Forum Member
Joined: Nov 2011
Posts: 79
Hi Lennart,

Thanks for your instruction. It worked.

Best

Shane


Zhi (Shane) Yue
Department of Chemistry
University of Chicago

Moderated by  BRBrooks, lennart, rmv 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 5.6.33-0+deb8u1 Page Time: 0.008s Queries: 20 (0.005s) Memory: 0.9037 MB (Peak: 0.9794 MB) Data Comp: Off Server Time: 2021-04-15 07:26:50 UTC
Valid HTML 5 and Valid CSS