TABLE OF CONTENTS


::pwtk::pwi::filterAtomicSpecies

SYNOPSIS

proc ::pwtk::pwi::filterAtomicSpecies {{atmSymbCmd_ ::pwtk::pwi::getAtmSymbList}} {

PURPOSE

Starting from QE v4.0, the pw.x aborts if unused atomic species are specified. In order to prevent that, this proc filters-out unsed species

ARGUMENTS

RETURN VALUE

SOURCE

    set content [::pwtk::input::cardGetContent ATOMIC_SPECIES]
    set atmSymb [lsort -unique [$atmSymbCmd_]]    
    set result  ""

    foreach line [split $content \n] {
        # skip empty lines
        if { [string is space $line] } { continue }
        
        if { [lindex $line 0] in $atmSymb } {
            lappend result $line
        }
    }

    return [join $result \n]
}