TABLE OF CONTENTS


::pwtk::boxify

SYNOPSIS

proc ::pwtk::boxify {atmPos a {b ""} {c ""}} {

PURPOSE

Return the edge lengths of the orthorhombic box that encapsulates the "atmPos" molecular structure with the margins (vacuum) a, b, c along thre x, y, z direction.

The margins a, b, c can be specified as 1, 2, or, 3 numbers:

RETURN VALUE

The box edge lengths as the "size_x size_y size_z" list (aka orthorhombic A, B, C parameters).

SOURCE

    lassign [boxSize $atmPos] s(1) s(2) s(3)
    
    # orthorhombic: a b c    
    lassign "$a $b $c" l(1) l(2) l(3)

    if { $l(2) eq {} } {
        # cubic: a a a        
        set l(3) [set l(2) $l(1)]
    }
    if { $l(3) eq {} } {
        # tetragonal: a a c
        set l(3) $l(2)
        set l(2) $l(1)
    }

    foreach i {1 2 3} { lappend result [expr $s($i) + $l($i)] }
    return $result
}