Changeset 16560 for issm/trunk/src/m/mesh/meshconvert.py
- Timestamp:
- 10/28/13 14:43:03 (11 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 16138-16453,16455-16554
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/mesh/meshconvert.py
r14067 r16560 18 18 19 19 if not len(args): 20 x=md.mesh.x21 y=md.mesh.y22 index=md.mesh.elements20 index = md.mesh.elements 21 x = md.mesh.x 22 y = md.mesh.y 23 23 else: 24 x=args[0]25 y=args[1]26 index=args[2]24 index = args[0] 25 x = args[1] 26 y = args[2] 27 27 28 28 #call Bamg … … 30 30 31 31 # plug results onto model 32 md.private.bamg =OrderedDict()33 md.private.bamg['mesh'] =bamgmesh(bamgmesh_out)34 md.private.bamg['geometry'] =bamggeom(bamggeom_out)35 md.mesh.x =bamgmesh_out['Vertices'][:,0].copy()36 md.mesh.y =bamgmesh_out['Vertices'][:,1].copy()37 md.mesh.elements =bamgmesh_out['Triangles'][:,0:3].astype(int)38 md.mesh.edges =bamgmesh_out['IssmEdges'].astype(int)39 md.mesh.segments =bamgmesh_out['IssmSegments'][:,0:3].astype(int)40 md.mesh.segmentmarkers =bamgmesh_out['IssmSegments'][:,3].astype(int)32 md.private.bamg = OrderedDict() 33 md.private.bamg['mesh'] = bamgmesh(bamgmesh_out) 34 md.private.bamg['geometry'] = bamggeom(bamggeom_out) 35 md.mesh.x = bamgmesh_out['Vertices'][:,0].copy() 36 md.mesh.y = bamgmesh_out['Vertices'][:,1].copy() 37 md.mesh.elements = bamgmesh_out['Triangles'][:,0:3].astype(int) 38 md.mesh.edges = bamgmesh_out['IssmEdges'].astype(int) 39 md.mesh.segments = bamgmesh_out['IssmSegments'][:,0:3].astype(int) 40 md.mesh.segmentmarkers = bamgmesh_out['IssmSegments'][:,3].astype(int) 41 41 42 42 #Fill in rest of fields: 43 md.mesh.dimension =244 md.mesh.numberofelements =numpy.size(md.mesh.elements,axis=0)45 md.mesh.numberofvertices =numpy.size(md.mesh.x)46 md.mesh.numberofedges =numpy.size(md.mesh.edges,axis=0)47 md.mesh.z =numpy.zeros(md.mesh.numberofvertices)48 md.mesh.vertexonbed =numpy.ones(md.mesh.numberofvertices,bool)49 md.mask.vertexonwater =numpy.zeros(md.mesh.numberofvertices,bool)50 md.mesh.vertexonsurface =numpy.ones(md.mesh.numberofvertices,bool)51 md.mesh.elementonbed =numpy.ones(md.mesh.numberofelements,bool)52 md.mesh.elementonsurface =numpy.ones(md.mesh.numberofelements,bool)53 md.mesh.vertexonboundary =numpy.zeros(md.mesh.numberofvertices,bool)54 md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1] =True43 md.mesh.dimension = 2 44 md.mesh.numberofelements = numpy.size(md.mesh.elements,axis=0) 45 md.mesh.numberofvertices = numpy.size(md.mesh.x) 46 md.mesh.numberofedges = numpy.size(md.mesh.edges,axis=0) 47 md.mesh.z = numpy.zeros(md.mesh.numberofvertices) 48 md.mesh.vertexonbed = numpy.ones(md.mesh.numberofvertices,bool) 49 md.mask.vertexonwater = numpy.zeros(md.mesh.numberofvertices,bool) 50 md.mesh.vertexonsurface = numpy.ones(md.mesh.numberofvertices,bool) 51 md.mesh.elementonbed = numpy.ones(md.mesh.numberofelements,bool) 52 md.mesh.elementonsurface = numpy.ones(md.mesh.numberofelements,bool) 53 md.mesh.vertexonboundary = numpy.zeros(md.mesh.numberofvertices,bool) 54 md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1] = True 55 55 56 56 return md
Note:
See TracChangeset
for help on using the changeset viewer.