Changeset 13052


Ignore:
Timestamp:
08/15/12 17:22:09 (13 years ago)
Author:
Mathieu Morlighem
Message:

BUG: Echo was not displaying ncols but nrows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/parameterization/setflowequation.py

    r13032 r13052  
    5757
    5858        #check that each element has at least one flag
    59         if not any(hutterflag+macayealflag+pattynflag+stokesflag):
    60                 raise TypeError("setflowequation error message: elements type not assigned, must be specified")
     59        if not any(hutterflag+macayealflag+l1l2flag+pattynflag+stokesflag):
     60                raise TypeError("elements type not assigned, must be specified")
    6161
    6262        #check that each element has only one flag
    63         if any(hutterflag+macayealflag+pattynflag+stokesflag>1):
     63        if any(hutterflag+macayealflag+l1l2flag+pattynflag+stokesflag>1):
    6464                print "setflowequation warning message: some elements have several types, higher order type is used for them"
    6565                hutterflag[numpy.nonzero(numpy.logical_and(hutterflag,macayealflag))]=0
     
    6969        #Check that no pattyn or stokes for 2d mesh
    7070        if md.mesh.dimension==2:
    71                 if numpy.any(numpy.logical_or(stokesflag,pattynflag)):
    72                         raise TypeError("setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first")
     71                if numpy.any(numpy.logical_or(l1l2flag,stokesflag,pattynflag)):
     72                        raise TypeError("stokes and pattyn elements not allowed in 2d mesh, extrude it first")
    7373
    7474        #Stokes can only be used alone for now:
    7575        if any(stokesflag) and any(hutterflag):
    76                 raise TypeError("setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere")
     76                raise TypeError("stokes cannot be used with any other model for now, put stokes everywhere")
    7777
    7878        #Initialize node fields
     
    8181        nodeonmacayeal=numpy.zeros(md.mesh.numberofvertices)
    8282        nodeonmacayeal[md.mesh.elements[numpy.nonzero(macayealflag),:].astype(int)-1]=1
     83        nodeonl1l2=numpy.zeros(md.mesh.numberofvertices)
     84        nodeonl1l2[md.mesh.elements[numpy.nonzero(l1l2flag),:].astype(int)-1]=1
    8385        nodeonpattyn=numpy.zeros(md.mesh.numberofvertices)
    8486        nodeonpattyn[md.mesh.elements[numpy.nonzero(pattynflag),:].astype(int)-1]=1
     
    235237        md.flowequation.element_equation[numpy.nonzero(hutterflag)]=1
    236238        md.flowequation.element_equation[numpy.nonzero(macayealflag)]=2
     239        md.flowequation.element_equation[numpy.nonzero(l1l2flag)]=8
    237240        md.flowequation.element_equation[numpy.nonzero(pattynflag)]=3
    238241        md.flowequation.element_equation[numpy.nonzero(stokesflag)]=4
     
    252255        pos=numpy.nonzero(nodeonmacayeal)
    253256        md.flowequation.vertex_equation[pos]=2
     257        pos=numpy.nonzero(nodeonl1l2)
     258        md.flowequation.vertex_equation[pos]=8
    254259        pos=numpy.nonzero(nodeonpattyn)
    255260        md.flowequation.vertex_equation[pos]=3
    256         pos=numpy.nonzero(nodeonhutter)
    257         md.flowequation.vertex_equation[pos]=1
    258261        pos=numpy.nonzero(nodeonmacayealpattyn)
    259262        md.flowequation.vertex_equation[pos]=5
     
    272275        md.flowequation.ishutter=float(any(md.flowequation.element_equation==1))
    273276        md.flowequation.ismacayealpattyn=float(numpy.any(numpy.logical_or(md.flowequation.element_equation==2,md.flowequation.element_equation==3)))
     277        md.flowequation.isl1l2=float(any(md.flowequation.element_equation==8))
    274278        md.flowequation.isstokes=float(any(md.flowequation.element_equation==4))
    275279
Note: See TracChangeset for help on using the changeset viewer.