TABLE OF CONTENTS
::pwtk::getAtmPosSegment
SYNOPSIS
proc ::pwtk::getAtmPosSegment {atomList atmPos} {
PURPOSE
Get requested segment of atoms as specified by "atomList" from the supplied atomic-positions "atmPos".
ARGUMENTS
- atomList -- list of indices of atoms to delete; the index of the first atom is 1 (list of atoms can also have a symbolic compact syntax supported by ::pwtk::parseRangeString)
SOURCE
set nat [getNAtoms $atmPos] set atomList [::pwtk::parseRangeString $atomList $nat] set atmPosL [split [purifyCoor $atmPos] \n] set result "" foreach atom $atomList { # check if in range if { $atom > $nat || $atom < 1 } { ::pwtk::error "atom index $atom out of range, should be within \[1, $nat\]" 1 } else { # ok, add this atom lappend result [lindex $atmPosL $atom-1] } } return [join $result \n] }