Ignore:
Timestamp:
12/19/23 21:01:48 (15 months ago)
Author:
jdquinn
Message:

CHG: MATLAB -> Python; cleanup

File:
1 edited

Legend:

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

    r27458 r28030  
    77
    88
    9 class frictioncoulomb(object):
    10     """FRICTIONCOULOMB class definition
     9class frictioncoulomb():
     10    """frictioncoulomb class definition
    1111
    1212    Usage:
     
    1414    """
    1515
    16     def __init__(self):  # {{{
     16    def __init__(self, *args):  # {{{
    1717        self.coefficient = np.nan
    1818        self.coefficientcoulomb = np.nan
     
    2323        self.effective_pressure_limit = 0
    2424
    25         self.setdefaultparameters()
     25        nargs = len(args)
     26
     27        if nargs == 0:
     28            self.setdefaultparameters()
     29        else:
     30            raise Exception('constructor not supported')
    2631    # }}}
    2732
     
    7782
    7883    def marshall(self, prefix, md, fid):  # {{{
     84        yts = md.constants.yts
     85
    7986        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 7, 'format', 'Integer')
    80         WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
     87        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
    8188        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficientcoulomb', 'format', 'DoubleMat', 'mattype', 1)
    8289        WriteData(fid, prefix, 'object', self, 'fieldname', 'p', 'format', 'DoubleMat', 'mattype', 2)
     
    8592        WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
    8693        if self.coupling == 1:
    87             WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
     94            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
    8895        elif self.coupling == 2:
    8996            raise ValueError('not implemented yet')
Note: See TracChangeset for help on using the changeset viewer.