Changeset 3702 for trunk/gui/scripts


Ignore:
Timestamp:
Jun 20, 2013 5:36:22 PM (11 years ago)
Author:
ldelgass
Message:

Fix old mesh/node format: names returned for XML children of mesh for
node/element include the id, so weren't found by comparing to element name.
Just search for 'node' or 'element' using element method instead of using
children method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/mesh.tcl

    r3687 r3702  
    176176        }
    177177    }
    178     set elemcount 0
    179     foreach cname [$_mesh children] {
    180         foreach type { node element } {
    181             if { $cname == $type } {
    182                 incr elemcount
    183                 break
    184             }
    185         }
    186     }
    187     if { $elemcount > 0 } {
    188         incr $subcount
    189     }
    190     if { $subcount ==  0 } {
     178    if {[$_mesh element "node"] != "" ||
     179        [$_mesh element "element"] != ""} {
     180        incr subcount
     181    }
     182
     183    if { $subcount == 0 } {
    191184        puts stderr "WARNING: no mesh specified for \"$path\"."
    192185        return
     
    203196    } elseif {[$_mesh element "unstructured"] != "" } {
    204197        set result [ReadUnstructuredGrid $path]
    205     } elseif {[$_mesh element "node"] != "" && [$_mesh element "element"]!=""} {
     198    } elseif {[$_mesh element "node"] != "" && [$_mesh element "element"] != ""} {
    206199        set result [ReadNodesElements $path]
    207200    }
Note: See TracChangeset for help on using the changeset viewer.