Changeset 14149


Ignore:
Timestamp:
12/12/12 14:58:02 (12 years ago)
Author:
Mathieu Morlighem
Message:

BUG: extrude was blowing up when md.diagnostic.icefront = NaN

Location:
issm/trunk-jpl/src/m/classes/model
Files:
2 edited

Legend:

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

    r13857 r14149  
    708708
    709709                        %in 3d, pressureload: [node1 node2 node3 node4 element]
    710                         pressureload_layer1=[md.diagnostic.icefront(:,1:2)  md.diagnostic.icefront(:,2)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,1)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,3:4)]; %Add two columns on the first layer
    711                         pressureload=[];
    712                         for i=1:numlayers-1,
    713                                 pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d pressureload_layer1(:,6)];
    714                         end
    715                         md.diagnostic.icefront=pressureload;
     710                        if ~isnan(md.diagnostic.icefront)
     711                                pressureload_layer1=[md.diagnostic.icefront(:,1:2)  md.diagnostic.icefront(:,2)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,1)+md.mesh.numberofvertices2d  md.diagnostic.icefront(:,3:4)]; %Add two columns on the first layer
     712                                pressureload=[];
     713                                for i=1:numlayers-1,
     714                                        pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.mesh.numberofvertices2d pressureload_layer1(:,5)+(i-1)*md.mesh.numberofelements2d pressureload_layer1(:,6)];
     715                                end
     716                                md.diagnostic.icefront=pressureload;
     717                        end
    716718
    717719                        %connectivity
  • issm/trunk-jpl/src/m/classes/model/model.py

    r14018 r14149  
    635635
    636636                #in 3d, pressureload: [node1 node2 node3 node4 element]
    637                 pressureload_layer1=numpy.hstack((md.diagnostic.icefront[:,0:2],md.diagnostic.icefront[:,1:2]+md.mesh.numberofvertices2d,md.diagnostic.icefront[:,0:1]+md.mesh.numberofvertices2d,md.diagnostic.icefront[:,2:4]))    #Add two columns on the first layer
    638                 pressureload=numpy.empty((0,6),int)
    639                 for i in xrange(numlayers-1):
    640                         pressureload=numpy.vstack((pressureload,numpy.hstack((pressureload_layer1[:,0:4]+i*md.mesh.numberofvertices2d,pressureload_layer1[:,4:5]+i*md.mesh.numberofelements2d,pressureload_layer1[:,5:6]))))
    641                 md.diagnostic.icefront=pressureload
     637                if not numpy.any(numpy.isnan(md.diagnostic.icefront)):
     638                        pressureload_layer1=numpy.hstack((md.diagnostic.icefront[:,0:2],md.diagnostic.icefront[:,1:2]+md.mesh.numberofvertices2d,md.diagnostic.icefront[:,0:1]+md.mesh.numberofvertices2d,md.diagnostic.icefront[:,2:4]))    #Add two columns on the first layer
     639                        pressureload=numpy.empty((0,6),int)
     640                        for i in xrange(numlayers-1):
     641                                pressureload=numpy.vstack((pressureload,numpy.hstack((pressureload_layer1[:,0:4]+i*md.mesh.numberofvertices2d,pressureload_layer1[:,4:5]+i*md.mesh.numberofelements2d,pressureload_layer1[:,5:6]))))
     642                        md.diagnostic.icefront=pressureload
    642643
    643644                #connectivity
Note: See TracChangeset for help on using the changeset viewer.