Changeset 4473 for branches/1.3


Ignore:
Timestamp:
Jul 9, 2014 6:47:42 PM (6 years ago)
Author:
ldelgass
Message:

merge r4394 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

    • Property svn:mergeinfo changed
      /trunkmerged: 4394
  • branches/1.3/gui/scripts/field.tcl

    r4471 r4473  
    14861486        }
    14871487        set numFieldValues [$v length]
    1488         set numComponentsPerPoint [numComponents $cname]
    1489         set numPoints [$mesh numpoints]
    1490         set numExpectedPoints [expr $numPoints * $numComponentsPerPoint]
    1491         if { $numExpectedPoints != $numFieldValues } {
    1492             puts stderr "ERROR: Number of points in mesh ($numExpectedPoints) and number of field values ($numFieldValues) don't agree"
     1488        set numComponentsPerTuple [numComponents $cname]
     1489        if { [expr $numFieldValues % $numComponentsPerTuple] != 0 } {
     1490            puts stderr "ERROR: Number of field values ($numFieldValues) not divisble by elemsize ($numComponentsPerTuple)"
    14931491            return 0
    14941492        }
    1495 
     1493        set numFieldTuples [expr $numFieldValues / $numComponentsPerTuple]
     1494        if { $_comp2assoc($cname) == "pointdata" } {
     1495            set numPoints [$mesh numpoints]
     1496            if { $numPoints != $numFieldTuples } {
     1497                puts stderr "ERROR: Number of points in mesh ($numPoints) and number of field tuples ($numFieldTuples) don't agree"
     1498                return 0
     1499            }
     1500        } elseif { $_comp2assoc($cname) == "celldata" } {
     1501            set numCells [$mesh numcells]
     1502            if { $numCells != $numFieldTuples } {
     1503                puts stderr "ERROR: Number of cells in mesh ($numCells) and number of field tuples ($numFieldTuples) don't agree"
     1504                return 0
     1505            }
     1506        }
    14961507        set _comp2dims($cname) "[$mesh dimensions]D"
    14971508        set _comp2mesh($cname) [list $mesh $v]
     
    15171528        }
    15181529        set numFieldValues [$v length]
    1519         set numComponentsPerPoint [numComponents $cname]
    1520         set numPoints [$mesh numpoints]
    1521         set numExpectedPoints [expr $numPoints * $numComponentsPerPoint]
    1522         if { $numExpectedPoints != $numFieldValues } {
    1523             puts stderr "ERROR: Number of points in mesh ($numExpectedPoints) and number of field values ($numFieldValues) don't agree"
     1530        set numComponentsPerTuple [numComponents $cname]
     1531        if { [expr $numFieldValues % $numComponentsPerTuple] != 0 } {
     1532            puts stderr "ERROR: Number of field values ($numFieldValues) not divisble by elemsize ($numComponentsPerTuple)"
    15241533            return 0
     1534        }
     1535        set numFieldTuples [expr $numFieldValues / $numComponentsPerTuple]
     1536        if { $_comp2assoc($cname) == "pointdata" } {
     1537            set numPoints [$mesh numpoints]
     1538            if { $numPoints != $numFieldTuples } {
     1539                puts stderr "ERROR: Number of points in mesh ($numPoints) and number of field tuples ($numFieldTuples) don't agree"
     1540                return 0
     1541            }
     1542        } elseif { $_comp2assoc($cname) == "celldata" } {
     1543            set numCells [$mesh numcells]
     1544            if { $numCells != $numFieldTuples } {
     1545                puts stderr "ERROR: Number of cells in mesh ($numCells) and number of field tuples ($numFieldTuples) don't agree"
     1546                return 0
     1547            }
    15251548        }
    15261549        set _comp2dims($cname) "[$mesh dimensions]D"
Note: See TracChangeset for help on using the changeset viewer.