Changeset 5693
- Timestamp:
- Jun 13, 2015 1:36:08 PM (9 years ago)
- Location:
- trunk/examples/zoo/field
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/zoo/field/field.py
r5681 r5693 141 141 """ 142 142 143 if vizmethod == "dx":144 #145 # Generate a uniform 3D mesh in OpenDX format...146 #147 f3d = rx['output.field(f3d)']148 f3d['about.label'] = "3D Field"149 f3d['component.style'] = "-color blue:yellow:red -levels 6"150 151 dx = """object 1 class gridpositions counts 5 5 2152 origin 0 0 0153 delta 1 0 0154 delta 0 1 0155 delta 0 0 1156 object 2 class gridconnections counts 5 5 2157 object 3 class array type double rank 0 items 50 data follows158 """159 160 xx, yy, zz = np.mgrid[xmin:xmax:5j, ymin:ymax:5j, 0:1:2j]161 pts = formula(xx, yy, zz)162 # Axis ordering for OpenDX is reversed (z fastest)163 dx += '\n'.join(map(str, (pts.ravel())))164 165 dx += """attribute "dep" string "positions"166 object "regular positions regular connections" class field167 component "positions" value 1168 component "connections" value 2169 component "data" value 3"""170 171 data = Rappture.encoding.encode(dx, Rappture.RPENC_ZB64)172 f3d['component.dx'] = data173 174 175 143 rx.close() -
trunk/examples/zoo/field/field.tcl
r3692 r5693 115 115 } 116 116 117 if {$vizmethod == "dx"} {118 #119 # Generate a uniform 3D mesh in OpenDX format...120 #121 $driver put output.field(f3d).about.label "3D Field"122 $driver put output.field(f3d).component.style "-color blue:yellow:red -levels 6"123 124 set dx "object 1 class gridpositions counts 5 5 2125 origin 0 0 0126 delta 1 0 0127 delta 0 1 0128 delta 0 0 1129 object 2 class gridconnections counts 5 5 2130 object 3 class array type double rank 0 items 50 data follows131 "132 # Axis ordering for OpenDX is reversed (z fastest)133 for {set x 0} {$x < 5} {incr x} {134 for {set y 0} {$y < 5} {incr y} {135 for {set z 0} {$z < 2} {incr z} {136 set fval [expr $formula]137 append dx "$fval\n"138 }139 }140 }141 append dx {attribute "dep" string "positions"142 object "regular positions regular connections" class field143 component "positions" value 1144 component "connections" value 2145 component "data" value 3}146 147 set data [Rappture::encoding::encode -as zb64 $dx]148 $driver put output.field(f3d).component.dx $data149 }150 151 117 # 152 118 # Save the updated XML describing the run... -
trunk/examples/zoo/field/tool.xml
r5681 r5693 46 46 <value>unstructured</value> 47 47 </option> 48 <option>49 <about>50 <label>Volume (OpenDX)</label>51 <description>Renders a 3D volume using the deprecated OpenDX mesh/field format.</description>52 </about>53 <value>dx</value>54 </option>55 48 <default>grid</default> 56 49 </choice>
Note: See TracChangeset
for help on using the changeset viewer.