Ignore:
Timestamp:
11/19/12 14:11:00 (12 years ago)
Author:
jschierm
Message:

CHG: Change properties in python md.mesh and md.mask to int or bool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py

    r13970 r13984  
    2525                if not os.path.exists(icefrontfile):
    2626                        raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
    27                 [nodeinsideicefront,dum]=ContourToMesh(md.mesh.elements,md.mesh.x.reshape(-1,1),md.mesh.y.reshape(-1,1),icefrontfile,'node',2)
    28                 nodeonicefront=numpy.logical_and(md.mesh.vertexonboundary,nodeinsideicefront.reshape(-1)).astype(float)
     27                [nodeinsideicefront,dum]=ContourToMesh(md.mesh.elements.astype(float),md.mesh.x.reshape(-1,1),md.mesh.y.reshape(-1,1),icefrontfile,'node',2)
     28                nodeonicefront=numpy.logical_and(md.mesh.vertexonboundary,nodeinsideicefront.reshape(-1))
    2929        else:
    30                 nodeonicefront=numpy.zeros((md.mesh.numberofvertices))
     30                nodeonicefront=numpy.zeros((md.mesh.numberofvertices),bool)
    3131
    3232#       pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
     
    5656        #segment on Neumann (Ice Front)
    5757#       pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
    58         pos=numpy.nonzero(numpy.logical_or(nodeonicefront[md.mesh.segments[:,0].astype(int)-1],nodeonicefront[md.mesh.segments[:,1].astype(int)-1]))[0]
     58        pos=numpy.nonzero(numpy.logical_or(nodeonicefront[md.mesh.segments[:,0]-1],nodeonicefront[md.mesh.segments[:,1]-1]))[0]
    5959        if   md.mesh.dimension==2:
    6060                pressureload=md.mesh.segments[pos,:]
     
    6262#               pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.mesh.numberofvertices2d  md.mesh.segments(pos,1)+md.mesh.numberofvertices2d  md.mesh.segments(pos,3)];
    6363                pressureload_layer1=numpy.hstack((md.mesh.segments[pos,0:2],md.mesh.segments[pos,1]+md.mesh.numberofvertices2d,md.mesh.segments[pos,0]+md.mesh.numberofvertices2d,md.mesh.segments[pos,2]))
    64                 pressureload=numpy.zeros((0,5))
     64                pressureload=numpy.zeros((0,5),int)
    6565                for i in xrange(1,md.mesh.numberoflayers):
    6666#                       pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d ];
     
    6969        #Add water or air enum depending on the element
    7070#       pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end))];
    71         pressureload=numpy.hstack((pressureload,1.*md.mask.elementonfloatingice[pressureload[:,-1].astype('int')-1].reshape(-1,1)))
     71        pressureload=numpy.hstack((pressureload,1*md.mask.elementonfloatingice[pressureload[:,-1]-1].reshape(-1,1)))
    7272
    7373        #plug onto model
Note: See TracChangeset for help on using the changeset viewer.