TABLE OF CONTENTS


::pwtk::pwi::substituteAtmType

SYNOPSIS

proc ::pwtk::pwi::substituteAtmType {oldType newType} {

PURPOSE

Substitute a given atom-type in ATOMIC_POSITIONS with a new atom type.

ARGUMENTS

EXAMPLE

   Substitute all hydrogen atoms (H) with deuterium (D):

      ::pwtk::pwi::substituteAtmType H D

SOURCE

    set lenUnit [::pwtk::input::cardGetFlags ATOMIC_POSITIONS]
    set atmPos  [::pwtk::purifyCoor [::pwtk::input::cardGetContent ATOMIC_POSITIONS]]

    set new_atmPos ""
    foreach line [split $atmPos \n] {   
        append new_atmPos [regsub -- $oldType $line $newType]\n
    }

    ATOMIC_POSITIONS $lenUnit [::pwtk::purifyCoor $new_atmPos]

    return  $new_atmPos
}