Changeset 23526


Ignore:
Timestamp:
12/10/18 03:54:56 (6 years ago)
Author:
bdef
Message:

NEW:adding coupling ability in friction_hydro

Location:
issm/trunk-jpl/src/m
Files:
4 edited

Legend:

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

    r22267 r23526  
    1616
    1717        def __init__(self): # {{{
    18                
     18
    1919                self.isSIA                          = 0
    2020                self.isSSA                          = 0
     
    4949                string="%s\n%s"%(string,fielddisplay(self,'isFS',"are the Full-FS (FS) equations used ?"))
    5050                string="%s\n%s"%(string,fielddisplay(self,'fe_SSA',"Finite Element for SSA: 'P1', 'P1bubble' 'P1bubblecondensed' 'P2'"))
    51                 string="%s\n%s"%(string,fielddisplay(self,'fe_HO' ,"Finite Element for HO:  'P1' 'P1bubble' 'P1bubblecondensed' 'P1xP2' 'P2xP1' 'P2'"))
     51                string="%s\n%s"%(string,fielddisplay(self,'fe_HO' ,"Finite Element for HO:  'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'"))
    5252                string="%s\n%s"%(string,fielddisplay(self,'fe_FS' ,"Finite Element for FS:  'P1P1' (debugging only) 'P1P1GLS' 'MINIcondensed' 'MINI' 'TaylorHood' 'LATaylorHood' 'XTaylorHood'"))
    5353                string="%s\n%s"%(string,fielddisplay(self,'vertex_equation',"flow equation for each vertex"))
  • TabularUnified issm/trunk-jpl/src/m/classes/friction.py

    r22875 r23526  
    2929                string="%s\n%s"%(string,fielddisplay(self,"p","p exponent"))
    3030                string="%s\n%s"%(string,fielddisplay(self,"q","q exponent"))
    31                 string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
     31                string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
    3232                string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
    3333                return string
  • TabularUnified issm/trunk-jpl/src/m/classes/frictionhydro.py

    r23422 r23526  
    2626        def __repr__(self): # {{{
    2727                string='Effective Pressure based friction law described in Gagliardini 2007'
    28                 string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
     28                string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
    2929                string="%s\n%s"%(string,fielddisplay(self,'q','friction law exponent q>=1'))
    3030                string="%s\n%s"%(string,fielddisplay(self,'C','friction law max value (Iken bound)'))
     
    3939                self.C=project3d(md,'vector',self.C,'type','element')
    4040                self.As=project3d(md,'vector',self.As,'type','element')
    41                 if self.coupling==1:
     41                if self.coupling in[3,4]:
    4242                        self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1)
    43                 elif self.coupling==2:
    44                         raise ValueError('coupling not supported yet')
    45                 elif self.coupling > 2:
    46                         raise ValueError('md.friction.coupling larger than 2, not supported yet')
     43                elif self.coupling > 4:
     44                        raise ValueError('md.friction.coupling larger than 4, not supported yet')
    4745                return self
    4846        # }}}
     
    6260                        return md
    6361
    64                 md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0,1,2])
     62                md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0,1,2,3,4])
    6563                md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
    6664                md = checkfield(md,'fieldname','friction.C','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
    6765                md = checkfield(md,'fieldname','friction.As','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
    68                 if self.coupling==1:
     66                if self.coupling==3:
    6967                        md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
    70                 elif self.coupling==2:
    71                         raise ValueError('coupling not supported yet')
    72                 elif self.coupling > 2:
    73                         raise ValueError('md.friction.coupling larger than 2, not supported yet')
     68                elif self.coupling > 4:
     69                        raise ValueError('md.friction.coupling larger than 4, not supported yet')
    7470        # }}}
    7571
     
    8076                WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',2)
    8177                WriteData(fid,prefix,'class','friction','object',self,'fieldname','As','format','DoubleMat','mattype',2)
    82                 if self.coupling==1:
     78                if self.coupling in[3,4]:
    8379                        WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
    84                 elif self.coupling==2:
    85                         raise ValueError('coupling not supported yet')
    86                 elif self.coupling > 2:
    87                         raise ValueError('md.friction.coupling larger than 2, not supported yet')
     80                elif self.coupling > 4:
     81                        raise ValueError('md.friction.coupling larger than 4, not supported yet')
    8882        #}}}
  • TabularUnified issm/trunk-jpl/src/m/contrib/defleurian/paraview/enveloppeVTK.py

    r23365 r23526  
    124124
    125125                                #getting the  fields in the solution
    126                                 if(np.size(res_struct.__dict__[sol])>1):
     126                                if(type(res_struct.__dict__[sol])==list):
    127127                                        fieldnames=dict.keys(res_struct.__dict__[sol].__getitem__(timestep).__dict__)
    128128                                else:
     
    130130                                #check which field is a real result and print
    131131                                for field in fieldnames:
    132                                         if(np.size(res_struct.__dict__[sol])>1):
     132                                        if(type(res_struct.__dict__[sol])==list):
    133133                                                fieldstruct=res_struct.__dict__[sol].__getitem__(timestep).__dict__[field]
    134134                                        else:
Note: See TracChangeset for help on using the changeset viewer.