Changeset 20280


Ignore:
Timestamp:
03/01/16 20:16:04 (9 years ago)
Author:
Eric.Larour
Message:

CHG: fixed issue with loading force, which can be NaN!

File:
1 edited

Legend:

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

    r19903 r20280  
    195195                WriteData(fid,'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1)
    196196
    197                 WriteData(fid,'data',self.loadingforce[:,0],'format','DoubleMat','mattype',1,'enum',LoadingforceXEnum())
    198                 WriteData(fid,'data',self.loadingforce[:,1],'format','DoubleMat','mattype',1,'enum',LoadingforceYEnum())
    199                 WriteData(fid,'data',self.loadingforce[:,2],'format','DoubleMat','mattype',1,'enum',LoadingforceZEnum())
     197                if numpy.isnan(self.loadingforce):
     198                        lx=float('NaN'); ly=float('NaN'); lz=float('NaN');
     199                else:
     200                        lx=self.loadingforce[:,0];
     201                        ly=self.loadingforce[:,1];
     202                        lz=self.loadingforce[:,2];
     203
     204                WriteData(fid,'data',lx,'format','DoubleMat','mattype',1,'enum',LoadingforceXEnum())
     205                WriteData(fid,'data',ly,'format','DoubleMat','mattype',1,'enum',LoadingforceYEnum())
     206                WriteData(fid,'data',lz,'format','DoubleMat','mattype',1,'enum',LoadingforceZEnum())
    200207
    201208                #process requested outputs
Note: See TracChangeset for help on using the changeset viewer.