Changeset 14007


Ignore:
Timestamp:
11/27/12 10:07:53 (12 years ago)
Author:
jschierm
Message:

CHG: Remove extra (and ugly) conversions for python md.mesh.elementconnectivity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/model/model.py

    r14006 r14007  
    22import numpy
    33import copy
     4import sys
    45from mesh import mesh
    56from mask import mask
     
    648649                #connectivity
    649650                md.mesh.elementconnectivity=numpy.tile(md.mesh.elementconnectivity,(numlayers-1,1))
    650                 md.mesh.elementconnectivity=md.mesh.elementconnectivity.astype(float)
    651                 md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity==0)]=float('NaN')
     651                md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity==0)]=-sys.maxint-1
    652652                for i in xrange(1,numlayers-1):
    653653                        md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:] \
    654654                                =md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
    655                 md.mesh.elementconnectivity[numpy.nonzero(numpy.isnan(md.mesh.elementconnectivity))]=0
    656                 md.mesh.elementconnectivity=md.mesh.elementconnectivity.astype(int)
     655                md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity<0)]=0
    657656
    658657                #materials
Note: See TracChangeset for help on using the changeset viewer.