Ignore:
Timestamp:
10/21/16 08:49:08 (8 years ago)
Author:
bdef
Message:

CHG: major cosmetic clean up we now ask shape (N,) rather than (N,1) also uniformised numpy imports

File:
1 edited

Legend:

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

    r21049 r21303  
    1 import numpy
     1import numpy as np
    22from fielddisplay import fielddisplay
    33from checkfield import checkfield
     
    8585                md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
    8686                md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
    87                 md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',numpy.arange(1,md.mesh.numberofvertices+1))
     87                md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',np.arange(1,md.mesh.numberofvertices+1))
    8888                md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements,3])
    89                 if numpy.any(numpy.logical_not(m.ismember(numpy.arange(1,md.mesh.numberofvertices+1),md.mesh.elements))):
     89                if np.any(np.logical_not(m.ismember(np.arange(1,md.mesh.numberofvertices+1),md.mesh.elements))):
    9090                        md.checkmessage("orphan nodes have been found. Check the mesh outline")
    9191                md = checkfield(md,'fieldname','mesh.numberofelements','>',0)
     
    112112                WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1)
    113113                WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1)
    114                 WriteData(fid,prefix,'name','md.mesh.z','data',numpy.zeros(self.numberofvertices),'format','DoubleMat','mattype',1);
     114                WriteData(fid,prefix,'name','md.mesh.z','data',np.zeros(self.numberofvertices),'format','DoubleMat','mattype',1);
    115115                WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2)
    116116                WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer')
Note: See TracChangeset for help on using the changeset viewer.