Changeset 15816


Ignore:
Timestamp:
08/13/13 10:49:51 (12 years ago)
Author:
Mathieu Morlighem
Message:

BUG: hopefully fixed python spc

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py

    r15815 r15816  
    5353                segments=numpy.nonzero(numpy.sum(segmentsfront,axis=1)!=numbernodesfront)[0]
    5454                #Find all nodes for these segments and spc them
    55                 pos=md.mesh.segments[segments,0:-1]
     55                pos=md.mesh.segments[segments,0:-1]-1
    5656        else:
    5757                pos=numpy.nonzero(md.mesh.vertexonboundary)[0]
    58         md.stressbalance.spcvx[pos[:]-1]=0
    59         md.stressbalance.spcvy[pos[:]-1]=0
    60         md.stressbalance.spcvz[pos[:]-1]=0
     58        md.stressbalance.spcvx[pos[:]]=0
     59        md.stressbalance.spcvy[pos[:]]=0
     60        md.stressbalance.spcvz[pos[:]]=0
    6161                                                                                                                                                                                                                                           
    62         if md.mesh.dimension==2:
    63                 numbernodesfront=2
    64         else:
    65                 numbernodesfront=4
    66         if any(md.mask.icelevelset<=0):
    67                 values=md.mask.icelevelset[md.mesh.segments[:,0:-1]-1]
    68                 segmentsfront=1-values
    69                 numpy.sum(segmentsfront,axis=1)!=numbernodesfront
    70                 segments=numpy.nonzero(numpy.sum(segmentsfront,axis=1)!=numbernodesfront)[0]
    71                 print segments
    72                 #Find all nodes for these segments and spc them
    73                 pos=md.mesh.segments[segments,0:-1]
    74                 print pos
    75         else:
    76                 pos=numpy.nonzero(md.mesh.vertexonboundary)[0]
    77         md.stressbalance.spcvx[pos[:]-1]=0
    78         md.stressbalance.spcvy[pos[:]-1]=0
    79         md.stressbalance.spcvz[pos[:]-1]=0
    80 
    8162        #Dirichlet Values
    8263        if isinstance(md.inversion.vx_obs,numpy.ndarray) and numpy.size(md.inversion.vx_obs,axis=0)==md.mesh.numberofvertices and isinstance(md.inversion.vy_obs,numpy.ndarray) and numpy.size(md.inversion.vy_obs,axis=0)==md.mesh.numberofvertices:
  • issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py

    r15815 r15816  
    6161                segments=numpy.nonzero(numpy.sum(segmentsfront,axis=1)!=numbernodesfront)[0]
    6262                #Find all nodes for these segments and spc them
    63                 pos=md.mesh.segments[segments,0:-1]
     63                pos=md.mesh.segments[segments,0:-1]-1
    6464        else:
    6565                pos=numpy.nonzero(md.mesh.vertexonboundary)[0]
    66         md.stressbalance.spcvx[pos[:]-1]=0
    67         md.stressbalance.spcvy[pos[:]-1]=0
    68         md.stressbalance.spcvz[pos[:]-1]=0
     66        md.stressbalance.spcvx[pos[:]]=0
     67        md.stressbalance.spcvy[pos[:]]=0
     68        md.stressbalance.spcvz[pos[:]]=0
    6969
    7070        #Dirichlet Values
Note: See TracChangeset for help on using the changeset viewer.