Changeset 27492


Ignore:
Timestamp:
01/02/23 01:24:30 (2 years ago)
Author:
jdquinn
Message:

CHG: MATLAB -> Python

File:
1 edited

Legend:

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

    r27458 r27492  
    88
    99class friction(object):
    10     """FRICTION class definition
     10    """friction class definition
    1111
    1212    Usage:
     
    1919        self.q = np.nan
    2020        self.coupling = 0
     21        self.linearize = 0
    2122        self.effective_pressure = np.nan
    2223        self.effective_pressure_limit = 0
     
    2627        s = 'Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b,\n'
    2728        s += '(effective stress Neff = rho_ice * g * thickness + rho_water * g * base, r = q / p and s = 1 / p)\n'
    28         s += '{}\n'.format(fielddisplay(self, "coefficient", "friction coefficient [SI]"))
    29         s += '{}\n'.format(fielddisplay(self, "p", "p exponent"))
    30         s += '{}\n'.format(fielddisplay(self, "q", "q exponent"))
     29        s += '{}\n'.format(fielddisplay(self, 'coefficient', 'friction coefficient [SI]'))
     30        s += '{}\n'.format(fielddisplay(self, 'p', 'p exponent'))
     31        s += '{}\n'.format(fielddisplay(self, 'q', 'q exponent'))
    3132        s += '{}\n'.format(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)'))
     33        s += '{}\n'.format(fielddisplay(self, 'linearize', '0: not linearized, 1: interpolated linearly, 2: constant per element (default is 0)'))
    3234        s += '{}\n'.format(fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
    3335        s += '{}\n'.format(fielddisplay(self, 'effective_pressure_limit', 'Neff do not allow to fall below a certain limit: effective_pressure_limit * rho_ice * g * thickness (default 0)'))
     
    3537    # }}}
    3638    def setdefaultparameters(self):  # {{{
     39        self.linearize = 0
     40        self.coupling = 0
    3741        self.effective_pressure_limit = 0
    3842        return self
     
    5963        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
    6064        md = checkfield(md, 'fieldname', 'friction.p', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
     65        md = checkfield(md, 'fieldname', 'friction.linearize', 'numel', [1], 'values', [0, 1, 2])
    6166        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
    6267        md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
     
    7782        WriteData(fid, prefix, 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
    7883        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
     84        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'linearize', 'format', 'Integer')
    7985        WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
    8086        if self.coupling == 3 or self.coupling == 4:
Note: See TracChangeset for help on using the changeset viewer.