Changeset 4394
- Timestamp:
- Jun 18, 2014, 11:08:12 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/field.tcl
r4390 r4394 1556 1556 } 1557 1557 set numFieldValues [$v length] 1558 set numComponentsPerPoint [numComponents $cname] 1559 set numPoints [$mesh numpoints] 1560 set numExpectedPoints [expr $numPoints * $numComponentsPerPoint] 1561 if { $numExpectedPoints != $numFieldValues } { 1562 puts stderr "ERROR: Number of points in mesh ($numExpectedPoints) and number of field values ($numFieldValues) don't agree" 1558 set numComponentsPerTuple [numComponents $cname] 1559 if { [expr $numFieldValues % $numComponentsPerTuple] != 0 } { 1560 puts stderr "ERROR: Number of field values ($numFieldValues) not divisble by elemsize ($numComponentsPerTuple)" 1563 1561 return 0 1564 1562 } 1565 1563 set numFieldTuples [expr $numFieldValues / $numComponentsPerTuple] 1564 if { $_comp2assoc($cname) == "pointdata" } { 1565 set numPoints [$mesh numpoints] 1566 if { $numPoints != $numFieldTuples } { 1567 puts stderr "ERROR: Number of points in mesh ($numPoints) and number of field tuples ($numFieldTuples) don't agree" 1568 return 0 1569 } 1570 } elseif { $_comp2assoc($cname) == "celldata" } { 1571 set numCells [$mesh numcells] 1572 if { $numCells != $numFieldTuples } { 1573 puts stderr "ERROR: Number of cells in mesh ($numCells) and number of field tuples ($numFieldTuples) don't agree" 1574 return 0 1575 } 1576 } 1566 1577 set _comp2dims($cname) "[$mesh dimensions]D" 1567 1578 set _comp2mesh($cname) [list $mesh $v] … … 1592 1603 } 1593 1604 set numFieldValues [$v length] 1594 set numComponentsPerPoint [numComponents $cname] 1595 set numPoints [$mesh numpoints] 1596 set numExpectedPoints [expr $numPoints * $numComponentsPerPoint] 1597 if { $numExpectedPoints != $numFieldValues } { 1598 puts stderr "ERROR: Number of points in mesh ($numExpectedPoints) and number of field values ($numFieldValues) don't agree" 1605 set numComponentsPerTuple [numComponents $cname] 1606 if { [expr $numFieldValues % $numComponentsPerTuple] != 0 } { 1607 puts stderr "ERROR: Number of field values ($numFieldValues) not divisble by elemsize ($numComponentsPerTuple)" 1599 1608 return 0 1609 } 1610 set numFieldTuples [expr $numFieldValues / $numComponentsPerTuple] 1611 if { $_comp2assoc($cname) == "pointdata" } { 1612 set numPoints [$mesh numpoints] 1613 if { $numPoints != $numFieldTuples } { 1614 puts stderr "ERROR: Number of points in mesh ($numPoints) and number of field tuples ($numFieldTuples) don't agree" 1615 return 0 1616 } 1617 } elseif { $_comp2assoc($cname) == "celldata" } { 1618 set numCells [$mesh numcells] 1619 if { $numCells != $numFieldTuples } { 1620 puts stderr "ERROR: Number of cells in mesh ($numCells) and number of field tuples ($numFieldTuples) don't agree" 1621 return 0 1622 } 1600 1623 } 1601 1624 set _comp2dims($cname) "[$mesh dimensions]D"
Note: See TracChangeset
for help on using the changeset viewer.