Ignore:
Timestamp:
03/09/21 23:52:41 (4 years ago)
Author:
jdquinn
Message:

CHG: MATLAB -> Python API translations for recent SE changes; clean up

File:
1 edited

Legend:

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

    r25169 r26059  
    3131        self.rheology_law = ''
    3232
    33     #giaivins:
    34         self.lithosphere_shear_modulus = 0.
    35         self.lithosphere_density = 0.
    36         self.mantle_shear_modulus = 0.
    37         self.mantle_density = 0.
     33        #SLC
     34        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
    3835
    39     #SLR
    40         self.earth_density = 5512  # average density of the Earth, (kg / m^3)
    4136        self.setdefaultparameters()
    4237    #}}}
    4338
    4439    def __repr__(self):  # {{{
     40        # TODO:
     41        # - Convert all formatting to calls to <string>.format (see any
     42        #   already converted <class>.__repr__ method for examples)
     43        #
    4544        string = "   Materials:"
    4645        string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
     
    6059        string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
    6160        string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
    62         string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
    63         string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_density", "Lithosphere density [g / cm^ - 3]"))
    64         string = "%s\n%s" % (string, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
    65         string = "%s\n%s" % (string, fielddisplay(self, "mantle_density", "Mantle density [g / cm^ - 3]"))
    6661        string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "Mantle density [kg / m^ - 3]"))
    6762        return string
     
    105100        self.rheology_law = 'Paterson'
    106101
    107         # GIA:
    108         self.lithosphere_shear_modulus = 6.7e10  # (Pa)
    109         self.lithosphere_density = 3.32  # (g / cm^ - 3)
    110         self.mantle_shear_modulus = 1.45e11  # (Pa)
    111         self.mantle_density = 3.34  # (g / cm^ - 3)
    112 
    113         #SLR
     102        #SLC
    114103        self.earth_density = 5512  #average density of the Earth, (kg / m^3)
    115104        return self
     
    130119        md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])
    131120        md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
    132 
    133         if 'GiaAnalysis' in analyses:
    134             md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)
    135             md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)
    136             md = checkfield(md,'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)
    137             md = checkfield(md,'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)
    138121
    139122        if 'SealevelriseAnalysis' in analyses:
     
    161144        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
    162145        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
    163         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
    164         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10.**3.)
    165         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
    166         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10.**3.)
    167146        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
    168147
Note: See TracChangeset for help on using the changeset viewer.