Changeset 3483


Ignore:
Timestamp:
Mar 11, 2013 3:00:50 PM (8 years ago)
Author:
gah
Message:

update example for meshes

Location:
trunk/examples/zoo/mesh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/zoo/mesh/mesh.tcl

    r3456 r3483  
    2121        set mesh "output.unirect2d"
    2222
     23        $driver put $mesh.dim  2
    2324        $driver put $mesh.about.label "unirect2d mesh"
    2425        $driver put $mesh.units "m"
     
    4849    "oldcloud" {
    4950        set mesh output.cloud
     51        $driver put $mesh.dim  2
    5052        $driver put $mesh.about.label "cloud (deprecated)"
    5153        $driver put $mesh.units "m"
     
    6668        set mesh output.mesh
    6769
    68         $driver put $mesh.about.label "cloud in mesh"
     70        $driver put $mesh.dim  2
     71        $driver put $mesh.about.label "cloud in unstructured mesh"
    6972        $driver put $mesh.units "m"
    7073        $driver put $mesh.hide "yes"
     
    7679            }
    7780        }
    78         $driver put $mesh.cloud.points $points
     81        $driver put $mesh.unstructured.points $points
     82        $driver put $mesh.unstructured.celltypes ""
    7983    }
    8084    "regular" {
    8185        set mesh output.mesh
    8286
     87        $driver put $mesh.dim  2
    8388        $driver put $mesh.about.label "uniform grid mesh"
    8489        $driver put $mesh.units "m"
     
    95100        set mesh output.mesh
    96101
     102        $driver put $mesh.dim  2
    97103        $driver put $mesh.about.label "irregular grid mesh"
    98104        $driver put $mesh.units "m"
     
    105111        set mesh output.mesh
    106112
     113        $driver put $mesh.dim  2
    107114        $driver put $mesh.about.label "hybrid regular and irregular grid mesh"
    108115        $driver put $mesh.units "m"
     
    118125        set mesh output.mesh
    119126
    120         $driver put $mesh.about.label "triangular mesh"
    121         $driver put $mesh.units "m"
    122         $driver put $mesh.hide "yes"
    123 
    124         $driver put $mesh.triangles.points $points
    125         $driver put $mesh.triangles.indices $triangles
     127        $driver put $mesh.dim  2
     128        $driver put $mesh.about.label "triangles in unstructured mesh"
     129        $driver put $mesh.units "m"
     130        $driver put $mesh.hide "yes"
     131
     132        $driver put $mesh.unstructured.points $points
     133        $driver put $mesh.unstructured.triangles $triangles
    126134    }
    127135    "generic" {
    128136        set mesh output.mesh
    129137
     138        $driver put $mesh.dim  2
    130139        $driver put $mesh.about.label "nodes and elements mesh"
    131140        $driver put $mesh.units "m"
     
    146155        set mesh output.mesh
    147156
     157        $driver put $mesh.dim  2
    148158        $driver put $mesh.about.label "Unstructured Grid"
    149159        $driver put $mesh.units "m"
     
    151161
    152162        $driver put $mesh.unstructured.points $points
    153         set celltypes {}
    154163        set cells {}
    155164        foreach { a b c } $triangles {
    156             lappend celltypes "5"
    157             append cells "3 $a $b $c\n"
     165            append cells "$a $b $c\n"
    158166        }
    159167        $driver put $mesh.unstructured.cells $cells
    160         $driver put $mesh.unstructured.celltypes $celltypes
     168        $driver put $mesh.unstructured.celltypes "triangle"
    161169    }
    162170    "cells" {
    163171        set mesh output.mesh
    164172
    165         $driver put $mesh.about.label "homogeneous cells"
    166         $driver put $mesh.units "m"
    167         $driver put $mesh.hide "yes"
    168 
    169         $driver put $mesh.cells.points $points
    170         $driver put $mesh.cells.triangles $triangles
     173        $driver put $mesh.dim  2
     174        $driver put $mesh.about.label "unstructured grid with heterogeneous cells"
     175        $driver put $mesh.units "m"
     176        $driver put $mesh.hide "yes"
     177
     178        set celltypes {}
     179        foreach { a b c } $triangles {
     180            append cells "$a $b $c\n"
     181            append celltypes "triangle\n"
     182        }
     183        $driver put $mesh.unstructured.points $points
     184        $driver put $mesh.unstructured.celltypes "triangle"
     185        $driver put $mesh.unstructured.cells $cells
    171186    }
    172187    "vtkmesh" {
     
    177192        close $f
    178193
     194        $driver put $mesh.dim  2
    179195        $driver put $mesh.about.label "vtk mesh"
    180196        $driver put $mesh.units "m"
     
    190206        close $f
    191207        $driver put output.field(substrate).component.vtk "$data"
    192         #$driver put output.field(substrate).about.view "contour"
    193         # save the updated XML describing the run...
     208        $driver put output.string.current ""
    194209        Rappture::result $driver
    195210        exit 0
  • trunk/examples/zoo/mesh/tool.xml

    r3456 r3483  
    22<run>
    33 <tool>
    4     <title>mesh</title>
    5       <about>Example of a Rappture &lt;mesh&gt; object.
    6 
    7 Meshes define the geometry for field.  Here are variety of 2D mesh types.
    8 See &lt;mesh&gt; and &lt;field&gt; elements for details.
    9 
    10 When you click the Simulate button, the inputs will be used to generate output fields.
    11         </about>
    12 
    134  <about>Press Simulate to view results.</about>
    145  <command>tclsh @tool/mesh.tcl @driver</command>
     
    6758    <option>
    6859     <about>
    69       <label>mesh as cell types</label>
    70       <description>Unstructured 2 dimensional grid of cells.</description>
     60      <label>mesh as hybid cell types</label>
     61      <description>Unstructured 2D grid of (possibly) hybrid cells.</description>
    7162     </about>
    7263     <value>cells</value>
Note: See TracChangeset for help on using the changeset viewer.