TABLE OF CONTENTS


::pwtk::CELL_PARAMETERS_math_parser

SYNOPSIS

proc ::pwtk::CELL_PARAMETERS_math_parser {content} {

PURPOSE

Specially supplied math-parser for CELL_PARAMETERS card to yield nicely formated output.

RETURN VALUE

Cell parameters in the form:

       ax  ay  az
       bx  by  bz
       cx  cy  cz

SOURCE

    set parsedContent ""
    foreach line [split [::pwtk::skipEmptyLines $content] \n] {
        if { [::pwtk::is_comment $line] } {
            append parsedContent [string trim $line]\n
            continue
        } 
        set len [llength $line]
        if { $len != 3 } {
            ::pwtk::error "wrong number of fields, $len, in CELL_PARAMETERS card, must be 3, while reading CELL_PARAMETERS\n$content"
        }
        lassign $line vx vy vz
        append parsedContent [format "  %20.15f %20.15f %20.15f\n" \
                                  [::pwtk::mathParser $vx] \
                                  [::pwtk::mathParser $vy] \
                                  [::pwtk::mathParser $vz] ]
    }
    
    return $parsedContent
}