Changeset 4390


Ignore:
Timestamp:
Jun 17, 2014, 1:32:05 PM (10 years ago)
Author:
ldelgass
Message:

Fill number of points/cells in mesh obj when reading from VTK file. Also,
report number of mesh points and number of field values in error msg when they
don't match.

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r4389 r4390  
    15581558        set numComponentsPerPoint [numComponents $cname]
    15591559        set numPoints [$mesh numpoints]
    1560         if { ($numPoints * $numComponentsPerPoint) != $numFieldValues } {
    1561             puts stderr "ERROR: Number of points in mesh and field values don't agree"
     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"
    15621563            return 0
    15631564        }
     
    15931594        set numComponentsPerPoint [numComponents $cname]
    15941595        set numPoints [$mesh numpoints]
    1595         if { ($numPoints * $numComponentsPerPoint) != $numFieldValues } {
    1596             puts stderr "ERROR: Number of points in mesh and field values don't agree"
     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"
    15971599            return 0
    15981600        }
  • trunk/gui/scripts/mesh.tcl

    r4259 r4390  
    482482    $reader Update
    483483    set output [$reader GetOutput]
     484    set _numPoints [$output GetNumberOfPoints]
     485    set _numCells [$output GetNumberOfCells]
    484486    foreach { xmin xmax ymin ymax zmin zmax } [$output GetBounds] break
    485487    set _limits(x) [list $xmin $xmax]
Note: See TracChangeset for help on using the changeset viewer.