TABLE OF CONTENTS
::pwtk::pwi::getAtmPosSegment
SYNOPSIS
proc ::pwtk::pwi::getAtmPosSegment {atomList} {
PURPOSE
Get requested segment of atoms as specified by $atomList from ATOMIC_POSITIONS card.
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 atmPosL [split [::pwtk::input::cardGetContent ATOMIC_POSITIONS] \n] set nat [getNAtoms] set atomList [::pwtk::parseRangeString $atomList $nat] 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\]" } else { # ok, add this atom lappend result [lindex $atmPosL $atom-1] } } return [join $result \n] }