Ignore:
Timestamp:
Feb 6, 2012 5:03:22 PM (10 years ago)
Author:
toby
Message:

fix bug in releasing fixed atoms; finish interface for fixed parms in readexp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/readexp.tcl

    r1176 r1189  
    22432243}
    22442244
    2245 #  read fixed constraints
    2246 
     2245#  read fixed constraints for a phase
    22472246proc atom_constraint_read {phase} {
    2248     set fix_list ""
     2247    set fixlist ""
    22492248    foreach k {1 2 3 4 5 6 7 8 9} {
    22502249        set key [format "LEQV HOLD%1d%2d" $phase $k]
     
    22522251        foreach j {2 10 18 26 34 42 50 58} {
    22532252            set fix_param [string range $line $j [expr $j+7]]
    2254             if {[string trim $fix_param] == ""} {return $fix_list}
    2255             lappend fix_list $fix_param
    2256         }
    2257     }
     2253            if {[string trim $fix_param] == ""} {return $fixlist}
     2254            lappend fixlist $fix_param
     2255        }
     2256    }
     2257    return $fixlist
    22582258}
    22592259
     
    22712271}
    22722272
    2273 proc atom_constraint_write {phase fix_list} {
     2273# returns 1 if the specified variable is fixed
     2274proc atom_constraint_get {phase atom type} {
     2275    if {[array names ::fix_param "$phase,$atom,$type"] == ""} {
     2276        return 0
     2277    }
     2278    return 1
     2279}
     2280
     2281proc atom_constraint_set {phase atomlist type mode} {
     2282    foreach atom $atomlist {
     2283        set key "$phase,$atom,$type"
     2284        if {$mode} {
     2285            set ::fix_param($key) 1
     2286        } else {
     2287            array unset ::fix_param $key
     2288        }
     2289    }
     2290    set fixlist {}
     2291    foreach key [array names ::fix_param "$phase,*"] {
     2292        foreach {j atom parm} [split $key ","] {}
     2293        lappend fixlist \
     2294            [format "%1s %+2s%-4s" $phase $atom $parm]
     2295    }
    22742296    foreach key [array names ::exparray "LEQV HOLD$phase*"] {
    22752297        delexp $key
     
    22782300    set j 1
    22792301    set line ""
    2280     foreach fix $fix_list {
     2302    foreach fix $fixlist {
    22812303        incr k
    22822304        append line $fix
Note: See TracChangeset for help on using the changeset viewer.