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
- kmesh --- k-mesh to tranform
- dim --- dimension of k-mesh (either 3, 2, or 1)
RETURN VALUE
- for dim==3: {M N K}
- for dim==2: {M N 1}
- for dim==1: {M 1 1}
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] }