Changeset 14751


Ignore:
Timestamp:
04/25/13 08:02:02 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: extended matlab GIA materials to python

Location:
issm/trunk-jpl/src/m/classes
Files:
5 edited

Legend:

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

    r14734 r14751  
    9090                       
    9191                        %GIA:
    92                         obj.lithosphere_shear_modulus  = 6.7*10^10; %(Pa)
    93                         obj.lithosphere_density        = 3.32; %(g/cm^-3)
    94                         obj.mantle_shear_modulus       = 1.45*10^11; %(Pa)
    95                         obj.mantle_viscosity           = 10^21; %(Pa.s)
    96                         obj.mantle_density             = 3.34; %(g/cm^-3)
     92                        obj.lithosphere_shear_modulus  = 6.7*10^10;  % (Pa)
     93                        obj.lithosphere_density        = 3.32;       % (g/cm^-3)
     94                        obj.mantle_shear_modulus       = 1.45*10^11; % (Pa)
     95                        obj.mantle_viscosity           = 10^21;      % (Pa.s)
     96                        obj.mantle_density             = 3.34;       % (g/cm^-3)
    9797
    9898                end % }}}
     
    106106                        md = checkfield(md,'materials.rheology_Z','>',0,'size',[md.mesh.numberofvertices 1]);
    107107                        md = checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
    108                         md = checkfield(md,'materials.lithosphere_shear_modulus','>',0);
    109                         md = checkfield(md,'materials.lithosphere_density','>',0);
    110                         md = checkfield(md,'materials.mantle_shear_modulus','>',0);
    111                         md = checkfield(md,'materials.mantle_viscosity','>',0);
    112                         md = checkfield(md,'materials.mantle_density','>',0);
     108                        md = checkfield(md,'materials.lithosphere_shear_modulus','>',0,'numel',1);
     109                        md = checkfield(md,'materials.lithosphere_density','>',0,'numel',1);
     110                        md = checkfield(md,'materials.mantle_shear_modulus','>',0,'numel',1);
     111                        md = checkfield(md,'materials.mantle_viscosity','>',0,'numel',1);
     112                        md = checkfield(md,'materials.mantle_density','>',0,'numel',1);
    113113
    114114                end % }}}
     
    134134                        fielddisplay(obj,'lithosphere_density','Lithosphere density [g/cm^-3]');
    135135                        fielddisplay(obj,'mantle_shear_modulus','Mantle shear modulus [Pa]');
    136                         fielddisplay(obj,'mantle_viscosity','Mantle viscosity [Pa.s]');
     136                        fielddisplay(obj,'mantle_viscosity','Mantle viscosity [Pa s]');
    137137                        fielddisplay(obj,'mantle_density','Mantle density [g/cm^-3]');
    138138
  • issm/trunk-jpl/src/m/classes/matdamageice.py

    r14640 r14751  
    3030                self.rheology_law = ''
    3131
     32                #gia:
     33                self.lithosphere_shear_modulus  = 0.
     34                self.lithosphere_density        = 0.
     35                self.mantle_shear_modulus       = 0.
     36                self.mantle_viscosity           = 0.
     37                self.mantle_density             = 0.
     38
    3239                if not len(args):
    3340                        self.setdefaultparameters()
     
    5461                s+="%s\n" % fielddisplay(self,"rheology_Z","rheology multiplier")
    5562                s+="%s\n" % fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'Paterson' or 'Arrhenius'")
     63                s+="%s\n" % fielddisplay(self,"lithosphere_shear_modulus","Lithosphere shear modulus [Pa]")
     64                s+="%s\n" % fielddisplay(self,"lithosphere_density","Lithosphere density [g/cm^-3]")
     65                s+="%s\n" % fielddisplay(self,"mantle_shear_modulus","Mantle shear modulus [Pa]")
     66                s+="%s\n" % fielddisplay(self,"mantle_viscosity","Mantle viscosity [Pa s]")
     67                s+="%s\n" % fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]")
    5668
    5769                return s
     
    95107                #available: none, paterson and arrhenius
    96108                self.rheology_law='Paterson'
     109
     110                # GIA:
     111                self.lithosphere_shear_modulus  = 6.7*10**10;  # (Pa)
     112                self.lithosphere_density        = 3.32;       # (g/cm^-3)
     113                self.mantle_shear_modulus       = 1.45*10**11; # (Pa)
     114                self.mantle_viscosity           = 10**21;      # (Pa.s)
     115                self.mantle_density             = 3.34;       # (g/cm^-3)
    97116        # }}}
    98117        def checkconsistency(self,md,solution,analyses):    # {{{
     
    105124                md = checkfield(md,'materials.rheology_Z','>',0,'size',[md.mesh.numberofvertices,1])
    106125                md = checkfield(md,'materials.rheology_law','values',['None','Paterson','Arrhenius'])
     126                md = checkfield(md,'materials.lithosphere_shear_modulus','>',0,'numel',[1]);
     127                md = checkfield(md,'materials.lithosphere_density','>',0,'numel',[1]);
     128                md = checkfield(md,'materials.mantle_shear_modulus','>',0,'numel',[1]);
     129                md = checkfield(md,'materials.mantle_viscosity','>',0,'numel',[1]);
     130                md = checkfield(md,'materials.mantle_density','>',0,'numel',[1]);
    107131
    108132                return md
     
    125149                WriteData(fid,'object',self,'class','materials','fieldname','rheology_Z','format','DoubleMat','mattype',1)
    126150                WriteData(fid,'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer')
     151
     152                WriteData(fid,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
     153                WriteData(fid,'object',self,'class','materials','fieldname','lithosphere_density','format','Double');
     154                WriteData(fid,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
     155                WriteData(fid,'object',self,'class','materials','fieldname','mantle_viscosity','format','Double');
     156                WriteData(fid,'object',self,'class','materials','fieldname','mantle_density','format','Double');
    127157        # }}}
  • issm/trunk-jpl/src/m/classes/matice.m

    r14724 r14751  
    8787                        obj.rheology_law='Paterson';
    8888
    89                         %GIA:
    90                         obj.lithosphere_shear_modulus  = 6.7*10^10; %(Pa)
    91                         obj.lithosphere_density        = 3.32; %(g/cm^-3)
    92                         obj.mantle_shear_modulus       = 1.45*10^11; %(Pa)
    93                         obj.mantle_viscosity           = 10^21; %(Pa.s)
    94                         obj.mantle_density             = 3.34; %(g/cm^-3)
     89                        % GIA:
     90                        obj.lithosphere_shear_modulus  = 6.7*10^10;  % (Pa)
     91                        obj.lithosphere_density        = 3.32;       % (g/cm^-3)
     92                        obj.mantle_shear_modulus       = 1.45*10^11; % (Pa)
     93                        obj.mantle_viscosity           = 10^21;      % (Pa.s)
     94                        obj.mantle_density             = 3.34;       % (g/cm^-3)
    9595
    9696                end % }}}
     
    103103                        md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
    104104                        md = checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
    105                         md = checkfield(md,'materials.lithosphere_shear_modulus','>',0);
    106                         md = checkfield(md,'materials.lithosphere_density','>',0);
    107                         md = checkfield(md,'materials.mantle_shear_modulus','>',0);
    108                         md = checkfield(md,'materials.mantle_viscosity','>',0);
    109                         md = checkfield(md,'materials.mantle_density','>',0);
     105                        md = checkfield(md,'materials.lithosphere_shear_modulus','>',0,'numel',1);
     106                        md = checkfield(md,'materials.lithosphere_density','>',0,'numel',1);
     107                        md = checkfield(md,'materials.mantle_shear_modulus','>',0,'numel',1);
     108                        md = checkfield(md,'materials.mantle_viscosity','>',0,'numel',1);
     109                        md = checkfield(md,'materials.mantle_density','>',0,'numel',1);
    110110
    111111                end % }}}
     
    130130                        fielddisplay(obj,'lithosphere_density','Lithosphere density [g/cm^-3]');
    131131                        fielddisplay(obj,'mantle_shear_modulus','Mantle shear modulus [Pa]');
    132                         fielddisplay(obj,'mantle_viscosity','Mantle viscosity [Pa.s]');
     132                        fielddisplay(obj,'mantle_viscosity','Mantle viscosity [Pa s]');
    133133                        fielddisplay(obj,'mantle_density','Mantle density [g/cm^-3]');
    134134                end % }}}
  • issm/trunk-jpl/src/m/classes/matice.py

    r14640 r14751  
    1414
    1515        def __init__(self): # {{{
    16                 self.rho_ice                    = 0.
    17                 self.rho_water                  = 0.
    18                 self.rho_freshwater             = 0.
    19                 self.mu_water                   = 0.
    20                 self.heatcapacity               = 0.
    21                 self.latentheat                 = 0.
    22                 self.thermalconductivity        = 0.
    23                 self.meltingpoint               = 0.
    24                 self.beta                       = 0.
    25                 self.mixed_layer_capacity       = 0.
    26                 self.thermal_exchange_velocity  = 0.
    27                 self.rheology_B   = float('NaN')
    28                 self.rheology_n   = float('NaN')
    29                 self.rheology_law = ''
     16                self.rho_ice                   = 0.
     17                self.rho_water                 = 0.
     18                self.rho_freshwater            = 0.
     19                self.mu_water                  = 0.
     20                self.heatcapacity              = 0.
     21                self.latentheat                = 0.
     22                self.thermalconductivity       = 0.
     23                self.meltingpoint              = 0.
     24                self.beta                      = 0.
     25                self.mixed_layer_capacity      = 0.
     26                self.thermal_exchange_velocity = 0.
     27                self.rheology_B                = float('NaN')
     28                self.rheology_n                = float('NaN')
     29                self.rheology_law              = ''
     30
     31                #gia:
     32                self.lithosphere_shear_modulus  = 0.
     33                self.lithosphere_density        = 0.
     34                self.mantle_shear_modulus       = 0.
     35                self.mantle_viscosity           = 0.
     36                self.mantle_density             = 0.
    3037
    3138                self.setdefaultparameters()
     
    4855                string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
    4956                string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'Paterson' or 'Arrhenius'"))
     57                string="%s\n%s"%(string,fielddisplay(self,"lithosphere_shear_modulus","Lithosphere shear modulus [Pa]"))
     58                string="%s\n%s"%(string,fielddisplay(self,"lithosphere_density","Lithosphere density [g/cm^-3]"))
     59                string="%s\n%s"%(string,fielddisplay(self,"mantle_shear_modulus","Mantle shear modulus [Pa]"))
     60                string="%s\n%s"%(string,fielddisplay(self,"mantle_viscosity","Mantle viscosity [Pa s]"))
     61                string="%s\n%s"%(string,fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]"))
    5062
    5163                return string
     
    88100                #available: none, paterson and arrhenius
    89101                self.rheology_law='Paterson'
     102
     103                # GIA:
     104                self.lithosphere_shear_modulus  = 6.7*10**10  # (Pa)
     105                self.lithosphere_density        = 3.32        # (g/cm^-3)
     106                self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
     107                self.mantle_viscosity           = 10**21      # (Pa.s)
     108                self.mantle_density             = 3.34        # (g/cm^-3)
     109
    90110                return self
    91111                #}}}
     
    98118                md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
    99119                md = checkfield(md,'materials.rheology_law','values',['None','Paterson','Arrhenius'])
     120                md = checkfield(md,'materials.lithosphere_shear_modulus','>',0,'numel',[1]);
     121                md = checkfield(md,'materials.lithosphere_density','>',0,'numel',[1]);
     122                md = checkfield(md,'materials.mantle_shear_modulus','>',0,'numel',[1]);
     123                md = checkfield(md,'materials.mantle_viscosity','>',0,'numel',[1]);
     124                md = checkfield(md,'materials.mantle_density','>',0,'numel',[1]);
    100125                return md
    101126        # }}}
     
    116141                WriteData(fid,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
    117142                WriteData(fid,'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer')
     143
     144                WriteData(fid,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
     145                WriteData(fid,'object',self,'class','materials','fieldname','lithosphere_density','format','Double');
     146                WriteData(fid,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
     147                WriteData(fid,'object',self,'class','materials','fieldname','mantle_viscosity','format','Double');
     148                WriteData(fid,'object',self,'class','materials','fieldname','mantle_density','format','Double');
    118149        # }}}
  • issm/trunk-jpl/src/m/classes/surfaceforcings.py

    r14640 r14751  
    1313
    1414        def __init__(self): # {{{
    15                 self.precipitation = float('NaN')
    16                 self.mass_balance  = float('NaN')
    17                 self.ispdd = 0
    18                 self.issmbgradients = 0
    19                 self.isdelta18o = 0
    20                 self.href = float('NaN')
    21                 self.smbref = float('NaN')
    22                 self.b_pos = float('NaN')
    23                 self.b_neg = float('NaN')
    24                 self.monthlytemperatures = float('NaN')
    25                 self.delta18o = float('NaN')
    26                 self.delta18o_surface = float('NaN')
    27                 self.temperatures_presentday = float('NaN')
    28                 self.temperatures_lgm = float('NaN')
     15                self.precipitation             = float('NaN')
     16                self.mass_balance              = float('NaN')
     17                self.ispdd                     = 0
     18                self.issmbgradients            = 0
     19                self.isdelta18o                = 0
     20                self.href                      = float('NaN')
     21                self.smbref                    = float('NaN')
     22                self.b_pos                     = float('NaN')
     23                self.b_neg                     = float('NaN')
     24                self.monthlytemperatures       = float('NaN')
     25                self.delta18o                  = float('NaN')
     26                self.delta18o_surface          = float('NaN')
     27                self.temperatures_presentday   = float('NaN')
     28                self.temperatures_lgm          = float('NaN')
    2929                self.precipitations_presentday = float('NaN')
    3030
Note: See TracChangeset for help on using the changeset viewer.