Changeset 4395
- Timestamp:
- Jun 18, 2014, 11:22:33 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mesh.tcl
r4393 r4395 63 63 return $_numPoints 64 64 } 65 65 public method numcells {} { 66 return $_numCells 67 } 66 68 67 69 private common _xp2obj ; # used for fetch/release ref counting … … 551 553 set _dim 3 552 554 set _numPoints [expr $xNum * $yNum * $zNum] 555 set _numCells [expr ($xNum - 1) * ($yNum - 1) * ($zNum - 1)] 553 556 if { ($_numPoints*3) != $numCoords } { 554 557 puts stderr "WARNING: bad grid \"$path\": invalid grid: \# of points does not match dimensions <xdim> * <ydim> * <zdim>" … … 573 576 set _dim 2 574 577 set _numPoints [expr $xNum * $yNum] 578 set _numCells [expr ($xNum - 1) * ($yNum - 1)] 575 579 if { ($_numPoints*2) != $numCoords } { 576 580 puts stderr "WARNING: bad grid \"$path\": \# of points does not match dimensions <xdim> * <ydim>" … … 597 601 set _dim 1 598 602 set _numPoints $xNum 603 set _numCells [expr $xNum - 1] 599 604 if { $_numPoints != $numCoords } { 600 605 puts stderr "WARNING: bad grid \"$path\": \# of points does not match <xdim>" … … 623 628 set xSpace [expr ($xMax - $xMin) / double($xNum - 1)] 624 629 set _numPoints $xNum 630 set _numCells [expr $xNum - 1] 625 631 append out "DATASET STRUCTURED_POINTS\n" 626 632 append out "DIMENSIONS $xNum 1 1\n" … … 635 641 set ySpace [expr ($yMax - $yMin) / double($yNum - 1)] 636 642 set _numPoints [expr $xNum * $yNum] 643 set _numCells [expr ($xNum - 1) * ($yNum - 1)] 637 644 append out "DATASET STRUCTURED_POINTS\n" 638 645 append out "DIMENSIONS $xNum $yNum 1\n" … … 649 656 set zSpace [expr ($zMax - $zMin) / double($zNum - 1)] 650 657 set _numPoints [expr $xNum * $yNum * $zNum] 658 set _numCells [expr ($xNum - 1) * ($yNum - 1) * ($zNum - 1)] 651 659 append out "DATASET STRUCTURED_POINTS\n" 652 660 append out "DIMENSIONS $xNum $yNum $zNum\n" … … 701 709 if { $_dim == 3 } { 702 710 set _numPoints [expr $xNum * $yNum * $zNum] 711 set _numCells [expr ($xNum - 1) * ($yNum - 1) * ($zNum - 1)] 703 712 append out "DATASET RECTILINEAR_GRID\n" 704 713 append out "DIMENSIONS $xNum $yNum $zNum\n" … … 720 729 } elseif { $_dim == 2 } { 721 730 set _numPoints [expr $xNum * $yNum] 731 set _numCells [expr ($xNum - 1) * ($yNum - 1)] 722 732 append out "DATASET RECTILINEAR_GRID\n" 723 733 append out "DIMENSIONS $xNum $yNum 1\n" … … 739 749 } elseif { $_dim == 1 } { 740 750 set _numPoints $xNum 751 set _numCells [expr $xNum - 1] 741 752 append out "DATASET RECTILINEAR_GRID\n" 742 753 append out "DIMENSIONS $xNum 1 1\n" … … 1160 1171 } 1161 1172 } 1173 set _numPoints [$xv length] 1174 1162 1175 # Step 3: Write the points and cells as vtk data. 1163 1176 if { $numCells == 0 } {
Note: See TracChangeset
for help on using the changeset viewer.