Changeset 22052


Ignore:
Timestamp:
09/06/17 05:04:18 (8 years ago)
Author:
sjohnsen
Message:

NEW: added CoupledFlag(Neff) for frictionlaw 7, coulomb

File:
1 edited

Legend:

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

    r21591 r22052  
    1717        self.p = float('NaN')
    1818        self.q = float('NaN')
    19 
     19        self.coupling    = 0
     20        self.effective_pressure = float('NaN')
    2021        #set defaults
    2122        self.setdefaultparameters()
     
    2930        string="%s\n%s"%(string,fielddisplay(self,"p","p exponent"))
    3031        string="%s\n%s"%(string,fielddisplay(self,"q","q exponent"))
     32        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)'))
     33        string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
    3134        return string
    3235    #}}}
     
    3639        self.p=project3d(md,'vector',self.p,'type','element')
    3740        self.q=project3d(md,'vector',self.q,'type','element')
     41        if self.coupling==1:
     42                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')       
    3847        return self
    3948    #}}}
     
    5160        md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
    5261        md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
     62        if self.coupling==1:
     63                md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
     64        elif self.coupling==2:
     65                raise ValueError('coupling not supported yet')
     66        elif self.coupling > 2:
     67                raise ValueError('md.friction.coupling larger than 2, not supported yet')
     68        return md
    5369
    54         return md
    5570    # }}}
    5671    def marshall(self,prefix,md,fid):    # {{{
     
    6075        WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2)
    6176        WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2)
     77        WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer')
     78        if self.coupling==1:
     79                WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
     80        elif self.coupling==2:
     81                raise ValueError('coupling not supported yet')
     82        elif self.coupling > 2:
     83                raise ValueError('md.friction.coupling larger than 2, not supported yet')       
    6284    # }}}
Note: See TracChangeset for help on using the changeset viewer.