TABLE OF CONTENTS


::pwtk::Kmeshize

SYNOPSIS

proc ::pwtk::Kmeshize {kmesh {dim 3}} {

PURPOSE

Tranform various K-mesh representations into a list of 3 numbers, i.e., {M N K}.

In particular:

      MxNxK --> {M N K}
      MxN   --> {M N 1}
      {M N} --> {M N 1}
      M     --> {M 1 1}

ARGUMENTS

RETURN VALUE

SOURCE

    if { [string match *x* $kmesh] } {
        set kmesh [split $kmesh x]
    }
    if { [llength $kmesh] < $dim } {
        ::pwtk::error "wrong format of k-mesh, must be a list of $dim numbers, but got $kmesh" 1
    }
    lassign $kmesh k1 k2 k3
    if { $dim < 3 } { set k3 1 }
    if { $dim < 2 } { set k2 1 }
    return [list $k1 $k2 $k3]
}