Changeset 14211
- Timestamp:
- 01/07/13 10:11:26 (12 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/model/model.py
r14151 r14211 45 45 from ElementConnectivity import * 46 46 from contourenvelope import * 47 from PythonFuncs import * 47 48 #}}} 48 49 … … 407 408 md2.diagnostic.icefront[:,2]=Pnode[md1.diagnostic.icefront[:,2].astype(int)-1] 408 409 md2.diagnostic.icefront[:,3]=Pnode[md1.diagnostic.icefront[:,3].astype(int)-1] 409 md2.diagnostic.icefront=md2.diagnostic.icefront[numpy.nonzero( numpy.logical_and(numpy.logical_and(md2.diagnostic.icefront[:,0],md2.diagnostic.icefront[:,1]),md2.diagnostic.icefront[:,-1]))[0],:]410 md2.diagnostic.icefront=md2.diagnostic.icefront[numpy.nonzero(logical_and_n(md2.diagnostic.icefront[:,0],md2.diagnostic.icefront[:,1],md2.diagnostic.icefront[:,-1]))[0],:] 410 411 411 412 #Results fields -
issm/trunk-jpl/src/m/geometry/FlagElements.py
r14098 r14211 4 4 from ContourToMesh import * 5 5 from MatlabFuncs import * 6 from PythonFuncs import * 6 7 7 8 def FlagElements(md,region): … … 43 44 raise RuntimeError("FlagElements.py calling basinzoom.py is not complete.") 44 45 xlim,ylim=basinzoom('basin',region) 45 flag_nodes= numpy.logical_and(numpy.logical_and(md.mesh.x<xlim[1],md.mesh.x>xlim[0]),numpy.logical_and(md.mesh.y<ylim[1],md.mesh.y>ylim[0]))46 flag_nodes=logical_and_n(md.mesh.x<xlim[1],md.mesh.x>xlim[0],md.mesh.y<ylim[1],md.mesh.y>ylim[0]) 46 47 flag=numpy.prod(flag_nodes[md.mesh.elements],axis=1).astype(bool) 47 48 else: -
issm/trunk-jpl/src/m/mesh/ElementsFromEdge.py
r13524 r14211 1 1 import numpy 2 from PythonFuncs import * 2 3 3 4 def ElementsFromEdge(elements,A,B): … … 12 13 13 14 edgeelements=numpy.nonzero(\ 14 numpy.logical_or( \ 15 numpy.logical_or( \ 16 numpy.logical_or(numpy.logical_and(elements[:,0]==A,elements[:,1]==B), \ 17 numpy.logical_and(elements[:,0]==A,elements[:,2]==B)) \ 18 , \ 19 numpy.logical_or(numpy.logical_and(elements[:,1]==A,elements[:,2]==B), \ 20 numpy.logical_and(elements[:,1]==A,elements[:,0]==B)) \ 21 ), \ 22 numpy.logical_or(numpy.logical_and(elements[:,2]==A,elements[:,0]==B), \ 23 numpy.logical_and(elements[:,2]==A,elements[:,1]==B)) \ 15 logical_or_n(numpy.logical_and(elements[:,0]==A,elements[:,1]==B), \ 16 numpy.logical_and(elements[:,0]==A,elements[:,2]==B), \ 17 numpy.logical_and(elements[:,1]==A,elements[:,2]==B), \ 18 numpy.logical_and(elements[:,1]==A,elements[:,0]==B), \ 19 numpy.logical_and(elements[:,2]==A,elements[:,0]==B), \ 20 numpy.logical_and(elements[:,2]==A,elements[:,1]==B), \ 24 21 ))[0]+1 25 22 -
issm/trunk-jpl/src/m/parameterization/setflowequation.py
r14020 r14211 3 3 from pairoptions import * 4 4 from MatlabFuncs import * 5 from PythonFuncs import * 5 6 from FlagElements import * 6 7 … … 50 51 #Flag the elements that have not been flagged as filltype 51 52 if strcmpi(filltype,'hutter'): 52 hutterflag[numpy.nonzero(numpy.logical_not( numpy.logical_or(macayealflag,pattynflag)))]=True53 hutterflag[numpy.nonzero(numpy.logical_not(logical_or_n(macayealflag,pattynflag)))]=True 53 54 elif strcmpi(filltype,'macayeal'): 54 macayealflag[numpy.nonzero(numpy.logical_not( numpy.logical_or(hutterflag,numpy.logical_or(pattynflag,stokesflag))))]=True55 macayealflag[numpy.nonzero(numpy.logical_not(logical_or_n(hutterflag,pattynflag,stokesflag)))]=True 55 56 elif strcmpi(filltype,'pattyn'): 56 pattynflag[numpy.nonzero(numpy.logical_not( numpy.logical_or(hutterflag,numpy.logical_or(macayealflag,stokesflag))))]=True57 pattynflag[numpy.nonzero(numpy.logical_not(logical_or_n(hutterflag,macayealflag,stokesflag)))]=True 57 58 58 59 #check that each element has at least one flag … … 69 70 #Check that no pattyn or stokes for 2d mesh 70 71 if md.mesh.dimension==2: 71 if numpy.any( numpy.logical_or(l1l2flag,stokesflag,pattynflag)):72 if numpy.any(logical_or_n(l1l2flag,stokesflag,pattynflag)): 72 73 raise TypeError("stokes and pattyn elements not allowed in 2d mesh, extrude it first") 73 74
Note:
See TracChangeset
for help on using the changeset viewer.