source: trunk/packages/vizservers/nanovis/test/flowvis/flowtest.tcl @ 1443

Last change on this file since 1443 was 1443, checked in by gah, 15 years ago

Initial commit of new flow visualization command structure

File size: 1.9 KB
Line 
1
2# Example of using unirect2d meshes in a field object in Rappture.
3
4package require Rappture
5
6# Read in the data since we're not simulating anything...
7set f [open vectorfield.tcl "r"]
8set data [read $f]
9close $f
10
11# Open an XML run file to write into
12set driver [Rappture::library [lindex $argv 0]]
13
14# Create a "field" object to display the substrate surface.
15
16set flowdemo {
17    about.label "Jwire example"
18    component(vf1).flow.axis z
19    component(vf1).flow.position 0%
20    component(vf1).flow.volume yes
21    component(vf1).flow.streams no
22    component(vf1).flow.outline no
23    component(vf1).flow.particles(left).axis x
24    component(vf1).flow.particles(left).color lightgreen
25    component(vf1).flow.particles(left).position 10%
26    component(vf1).flow.particles(right).axis x
27    component(vf1).flow.particles(right).color khaki
28    component(vf1).flow.particles(right).position 90%
29    component(vf1).style  "-color blue:red -levels 6 -opacity 1"
30    component(vf1).flow.box(one).color cyan
31    component(vf1).flow.box(one).corner(1) "0 -100 -100"
32    component(vf1).flow.box(one).corner(2) "3000 400 400"
33    component(vf1).flow.box(two).color yellow
34    component(vf1).flow.box(two).corner(1) "1000 -150 -100"
35    component(vf1).flow.box(two).corner(2) "3000 3000 3000"
36    component(vf1).flow.box(three).color magenta
37    component(vf1).flow.box(three).corner(1) "1000 -150 -100"
38    component(vf1).flow.box(three).corner(2) "2000 450 450"
39    camera.xposition {
40        theta 142.84 phi 339.32 psi 0 pan-x -0.216 pan-y -0.128 zoom 0.64
41    }
42}
43
44foreach {key value} $flowdemo {
45    $driver put output.field.$key $value
46}
47
48$driver put output.field.component(vf1).extents 3
49set data [Rappture::encoding::encode -as zb64 $data]
50$driver put output.field.component(vf1).dx $data
51# save the updated XML describing the run...
52Rappture::result $driver
53puts stdout "done"
54flush stdout
55exit 0
56
Note: See TracBrowser for help on using the repository browser.