- Timestamp:
- Jun 13, 2015, 1:15:37 PM (9 years ago)
- Location:
- trunk/examples/zoo/mesh
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/zoo/mesh/mesh.m
r3750 r5692 93 93 0, 0); 94 94 95 case 'generic'96 mesh = 'output.mesh';97 rpLibPutString(lib, 'output.mesh.about.label', \98 'nodes and elements mesh', 0);99 rpLibPutString(lib, 'output.mesh.dim', '2', 0);100 rpLibPutString(lib, 'output.mesh.units', 'm', 0);101 rpLibPutString(lib, 'output.mesh.hide', 'yes', 0);102 103 f = fopen('triangles.txt');104 triangles = fscanf(f, '%d');105 fclose(f);106 107 % TO BE COMPLETED108 109 95 case 'unstructured' 110 96 mesh = 'output.mesh'; -
trunk/examples/zoo/mesh/mesh.py
r5681 r5692 84 84 mesh.put('unstructured.triangles', 'triangles.txt', type='file') 85 85 86 if meshtype == 'generic':87 mesh['about.label'] = "nodes and elements mesh"88 with open('points.txt') as f:89 data = f.read()90 for i, line in enumerate(data.split('\n')):91 if line == '':92 break93 x, y = line.split()94 mesh['node(%s)' % i] = "%s %s" % (x, y)95 with open('triangles.txt') as f:96 data = f.read()97 for i, line in enumerate(data.split('\n')):98 if line == '':99 break100 x, y, z = line.split()101 mesh['element(%s).nodes' % i] = "%s %s %s" % (x, y, z)102 103 86 if meshtype == 'unstructured': 104 87 mesh['about.label'] = "Unstructured Grid" -
trunk/examples/zoo/mesh/mesh.tcl
r5636 r5692 117 117 triangles.txt 118 118 } 119 "generic" {120 set mesh output.mesh121 122 $driver put $mesh.about.label "Mesh"123 $driver put $mesh.about.description "nodes and elements mesh"124 $driver put $mesh.dim 2125 $driver put $mesh.units "m"126 $driver put $mesh.hide $hide127 128 set count 0129 set f [open "points.txt" "r"]130 set points [read $f]131 close $f132 foreach { x y } $points {133 $driver put $mesh.node($count) "$x $y"134 incr count135 }136 set count 0137 set f [open "triangles.txt" "r"]138 set triangles [read $f]139 close $f140 foreach { a b c } $triangles {141 $driver put $mesh.element($count).nodes "$a $b $c"142 incr count143 }144 }145 119 "unstructured" { 146 120 set mesh output.mesh -
trunk/examples/zoo/mesh/tool.xml
r5681 r5692 65 65 <option> 66 66 <about> 67 <label>general nodes and elements description</label>68 <description>Unstructured 2 dimensional grid of cells using nodes and elements.</description>69 </about>70 <value>generic</value>71 </option>72 <option>73 <about>74 67 <label>VTK mesh</label> 75 68 <description>Partial VTK file representing the mesh.</description> -
trunk/examples/zoo/mesh/tool_octave.xml
- Property svn:mime-type changed from application/xml to text/xml
r3751 r5692 58 58 <option> 59 59 <about> 60 <label>general nodes and elements description</label>61 <description>Unstructured 2 dimensional grid of cells using nodes and elements.</description>62 </about>63 <value>generic</value>64 </option>65 <option>66 <about>67 60 <label>VTK mesh</label> 68 61 <description>Partial VTK file representing the mesh.</description>
Note: See TracChangeset
for help on using the changeset viewer.