Changeset 3732 for trunk/examples/zoo/mesh
- Timestamp:
- Jul 1, 2013 3:31:32 PM (11 years ago)
- Location:
- trunk/examples/zoo/mesh
- Files:
-
- 6 added
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/zoo/mesh/mesh.tcl
r3690 r3732 6 6 7 7 # Read in the data since we're not simulating anything... 8 source data.tcl9 source datatri.tcl10 8 11 9 # Open an XML run file to write into … … 129 127 $driver put $mesh.units "m" 130 128 $driver put $mesh.hide "yes" 131 132 $driver put $mesh.unstructured.points $points 133 $driver put $mesh.unstructured.triangles $triangles 129 130 $driver put -type file -compress no $mesh.unstructured.points \ 131 points.txt 132 $driver put -type file -compress no $mesh.unstructured.triangles \ 133 triangles.txt 134 134 } 135 135 "generic" { … … 142 142 143 143 set count 0 144 set f [open "points.txt" "r"] 145 set points [read $f] 146 close $f 144 147 foreach { x y } $points { 145 148 $driver put $mesh.node($count) "$x $y" … … 147 150 } 148 151 set count 0 152 set f [open "triangles.txt" "r"] 153 set triangles [read $f] 154 close $f 149 155 foreach { a b c } $triangles { 150 156 $driver put $mesh.element($count).nodes "$a $b $c" … … 160 166 $driver put $mesh.hide "yes" 161 167 162 $driver put $mesh.unstructured.points $points168 $driver put -type file -compress no $mesh.unstructured.points points.txt 163 169 set cells {} 170 set f [open "triangles.txt" "r"] 171 set triangles [read $f] 172 close $f 164 173 foreach { a b c } $triangles { 165 174 append cells "$a $b $c\n" … … 171 180 set mesh output.mesh 172 181 173 $driver put $mesh.about.label "unstructured grid with heterogeneous cells" 182 $driver put $mesh.about.label \ 183 "Unstructured Grid with Heterogeneous Cells" 174 184 $driver put $mesh.dim 2 175 185 $driver put $mesh.units "m" … … 177 187 178 188 set celltypes {} 189 set f [open "triangles.txt" "r"] 190 set triangles [read $f] 191 close $f 179 192 foreach { a b c } $triangles { 180 193 append cells "$a $b $c\n" 181 194 append celltypes "triangle\n" 182 195 } 183 $driver put $mesh.unstructured.points $points196 $driver put -type file -compress no $mesh.unstructured.points points.txt 184 197 $driver put $mesh.unstructured.celltypes "triangle" 185 198 $driver put $mesh.unstructured.cells $cells … … 188 201 set mesh output.mesh 189 202 190 set f [open "mesh.vtk" "r"]191 set data [read $f]192 close $f193 194 203 $driver put $mesh.about.label "vtk mesh" 195 204 $driver put $mesh.dim 2 196 205 $driver put $mesh.units "m" 197 206 $driver put $mesh.hide "yes" 198 $driver put $mesh.vtk $data207 $driver put -type file -compress no $mesh.vtk mesh.vtk 199 208 } 200 209 "vtkfield" { 201 210 202 203 211 $driver put output.field(substrate).about.label "Substrate Surface" 204 set f [open "file.vtk" "r"] 205 set data [read $f] 206 close $f 207 $driver put output.field(substrate).component.vtk "$data" 212 $driver put -type file -compress no \ 213 output.field(substrate).component.vtk file.vtk 208 214 $driver put output.string.current "" 209 215 Rappture::result $driver … … 218 224 #$driver put output.field(substrate).about.type "contour" 219 225 $driver put output.field(substrate).component.mesh $mesh 220 $driver put output.field(substrate).component.values $substrate_data 226 $driver put -type file -compress no output.field(substrate).component.values \ 227 substrate_data.txt 221 228 222 229 $driver put output.field(particle).about.label "Particle Surface" 223 230 #$driver put output.field(particle).about.type "contour" 224 231 $driver put output.field(particle).component.mesh $mesh 225 $driver put output.field(particle).component.values $particle_data 232 $driver put -type file -compress no output.field(particle).component.values \ 233 particle_data.txt 226 234 227 235 $driver put output.string.about.label "Mesh XML definition"
Note: See TracChangeset
for help on using the changeset viewer.