Changeset 15796


Ignore:
Timestamp:
08/12/13 14:18:56 (12 years ago)
Author:
seroussi
Message:

CHG: trying to add boundary condition change in python

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

Legend:

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

    r15795 r15796  
    4646segments=find(sum(segmentsfront,2)~=numbernodesfront);
    4747%Find all nodes for these segments and spc them
    48 pos=[md.mesh.segments(segments,1:numbernodesfront)];
     48pos=md.mesh.segments(segments,1:numbernodesfront);
    4949md.stressbalance.spcvx(pos(:))=0;
    5050md.stressbalance.spcvy(pos(:))=0;
  • issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m

    r15795 r15796  
    4141md.stressbalance.loadingforce=0*ones(md.mesh.numberofvertices,3);
    4242
    43 
    4443%Position of ice front
    4544md.mask.icelevelset(find(vertexonicefront))=0;
     
    5453segments=find(sum(segmentsfront,2)~=numbernodesfront);
    5554%Find all nodes for these segments and spc them
    56 pos=[md.mesh.segments(segments,1:numbernodesfront)];
     55pos=md.mesh.segments(segments,1:numbernodesfront);
    5756md.stressbalance.spcvx(pos(:))=0;
    5857md.stressbalance.spcvy(pos(:))=0;
  • issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py

    r15771 r15796  
    4343        md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
    4444        md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
    45         md.stressbalance.spcvx[pos]=0
    46         md.stressbalance.spcvy[pos]=0
    47         md.stressbalance.spcvz[pos]=0
    4845        md.stressbalance.referential=float('nan')*numpy.ones((md.mesh.numberofvertices,6))
    4946        md.stressbalance.loadingforce=0*numpy.ones((md.mesh.numberofvertices,3))
     47
     48        #Position of ice front
     49        pos=numpy.nonzero(vertexonicefront)[0]
     50        md.mask.icelevelset[pos]=0
     51
     52        #First find segments that are not completely on the front
     53        if md.mesh.dimension==2:
     54                numbernodesfront=2
     55        else:
     56                numbernodesfront=4
     57        segmentsfront=numpy.nonzeros(md.mask.icelevelset(md.mesh.segments(:,0:-1)))
     58        segments=numpy.sum(segmentsfront,axis=1)!=numbernodesfront).astype(int)
     59        #Find all nodes for these segments and spc them
     60        pos=md.mesh.segments[segments,0:-1]
     61        md.stressbalance.spcvx[pos[:]]=0
     62        md.stressbalance.spcvy[pos[:]]=0
     63        md.stressbalance.spcvz[pos[:]]=0
    5064
    5165        #Dirichlet Values
     
    6074        pos=numpy.nonzero(md.mesh.vertexonboundary)[0]
    6175        md.hydrology.spcwatercolumn[pos,0]=1
    62 
    63         #Position of ice front
    64         pos=numpy.nonzero(vertexonicefront)[0]
    65         md.mask.icelevelset[pos]=0
    6676
    6777        #Create zeros basalforcings and surfaceforcings
Note: See TracChangeset for help on using the changeset viewer.