Changeset 22298


Ignore:
Timestamp:
12/22/17 08:10:33 (7 years ago)
Author:
Mathieu Morlighem
Message:

CHG: renaming settings issmsettings for consistency with MATLAB

Location:
issm/trunk-jpl/src/m/classes
Files:
3 edited
2 moved

Legend:

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

    r22297 r22298  
    1 //SETTINGS class definition
     1//ISSMSETTINGS class definition
    22//
    33//   Usage:
    4 //      settings=new settings();
     4//      issmsettings=new issmsettings();
    55
    6 function settings (){
     6function issmsettings (){
    77        //methods
    88        this.setdefaultparameters = function(){// {{{
     
    3333        }// }}}
    3434        this.disp= function(){// {{{
    35                 console.log(sprintf('   settings class echo:'));
     35                console.log(sprintf('   issmsettings class echo:'));
    3636               
    3737                fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
     
    5151        }// }}}
    5252        this.classname= function(){// {{{
    53                 return "settings";
     53                return "issmsettings";
    5454
    5555        }// }}}
     
    6565                } // }}}
    6666                this.marshall=function(md,prefix,fid) { //{{{
    67                         WriteData(fid,prefix,'object',this,'fieldname','results_on_nodes','format','Boolean');
    68                         WriteData(fid,prefix,'object',this,'fieldname','io_gather','format','Boolean');
    69                         WriteData(fid,prefix,'object',this,'fieldname','lowmem','format','Boolean');
    70                         WriteData(fid,prefix,'object',this,'fieldname','output_frequency','format','Integer');
    71                         WriteData(fid,prefix,'object',this,'fieldname','recording_frequency','format','Integer');
    72                         WriteData(fid,prefix,'object',this,'fieldname','solver_residue_threshold','format','Double');
     67                        WriteData(fid,prefix,'object',this,'class','settings','fieldname','results_on_nodes','format','Boolean');
     68                        WriteData(fid,prefix,'object',this,'class','settings','fieldname','io_gather','format','Boolean');
     69                        WriteData(fid,prefix,'object',this,'class','settings','fieldname','lowmem','format','Boolean');
     70                        WriteData(fid,prefix,'object',this,'class','settings','fieldname','output_frequency','format','Integer');
     71                        WriteData(fid,prefix,'object',this,'class','settings','fieldname','recording_frequency','format','Integer');
     72                        WriteData(fid,prefix,'object',this,'class','settings','fieldname','solver_residue_threshold','format','Double');
    7373                        if (this.waitonlock>0) WriteData(fid,prefix,'name','md.settings.waitonlock','data',true,'format','Boolean');
    7474                        else WriteData(fid,prefix,'name','md.settings.waitonlock','data',false,'format','Boolean');
  • issm/trunk-jpl/src/m/classes/issmsettings.py

    r22297 r22298  
    33from WriteData import WriteData
    44
    5 class settings(object):
     5class issmsettings(object):
    66        """
    7         SETTINGS class definition
     7        ISSMSETTINGS class definition
    88
    99           Usage:
    10               settings=settings();
     10              issmsettings=issmsettings();
    1111        """
    1212
     
    2525                #}}}
    2626        def __repr__(self): # {{{
    27                 string="   general settings parameters:"
     27                string="   general issmsettings parameters:"
    2828
    2929                string="%s\n%s"%(string,fielddisplay(self,"results_on_nodes","results are output for all the nodes of each element"))
     
    7474        # }}}
    7575        def marshall(self,prefix,md,fid):    # {{{
    76                 WriteData(fid,prefix,'object',self,'fieldname','results_on_nodes','format','Boolean')
    77                 WriteData(fid,prefix,'object',self,'fieldname','io_gather','format','Boolean')
    78                 WriteData(fid,prefix,'object',self,'fieldname','lowmem','format','Boolean')
    79                 WriteData(fid,prefix,'object',self,'fieldname','output_frequency','format','Integer')
    80                 WriteData(fid,prefix,'object',self,'fieldname','recording_frequency','format','Integer')
     76                WriteData(fid,prefix,'object',self,'class','settings','fieldname','results_on_nodes','format','Boolean')
     77                WriteData(fid,prefix,'object',self,'class','settings','fieldname','io_gather','format','Boolean')
     78                WriteData(fid,prefix,'object',self,'class','settings','fieldname','lowmem','format','Boolean')
     79                WriteData(fid,prefix,'object',self,'class','settings','fieldname','output_frequency','format','Integer')
     80                WriteData(fid,prefix,'object',self,'class','settings','fieldname','recording_frequency','format','Integer')
    8181               
    8282                if self.waitonlock>0:
  • issm/trunk-jpl/src/m/classes/matice.js

    r21530 r22298  
    66function matice(){
    77        //methods
    8                 this.setdefaultparameters = function(){ // {{{
     8        this.setdefaultparameters = function(){ // {{{
    99
    10                         //ice density (kg/m^3)
    11                         this.rho_ice=917.;
     10                //ice density (kg/m^3)
     11                this.rho_ice=917.;
    1212
    13                         //ocean water density (kg/m^3)
    14                         this.rho_water=1023.;
     13                //ocean water density (kg/m^3)
     14                this.rho_water=1023.;
    1515
    16                         //fresh water density (kg/m^3)
    17                         this.rho_freshwater=1000.;
     16                //fresh water density (kg/m^3)
     17                this.rho_freshwater=1000.;
    1818
    19                         //water viscosity (N.s/m^2)
    20                         this.mu_water=0.001787; 
     19                //water viscosity (N.s/m^2)
     20                this.mu_water=0.001787; 
    2121
    22                         //ice heat capacity cp (J/kg/K)
    23                         this.heatcapacity=2093.;
     22                //ice heat capacity cp (J/kg/K)
     23                this.heatcapacity=2093.;
    2424
    25                         //ice latent heat of fusion L (J/kg)
    26                         this.latentheat=3.34*Math.pow(10,5);
     25                //ice latent heat of fusion L (J/kg)
     26                this.latentheat=3.34*Math.pow(10,5);
    2727
    28                         //ice thermal conductivity (W/m/K)
    29                         this.thermalconductivity=2.4;
    30                        
    31                         //wet ice thermal conductivity (W/m/K)
    32                         this.temperateiceconductivity=.24;
     28                //ice thermal conductivity (W/m/K)
     29                this.thermalconductivity=2.4;
    3330
    34                         //the melting point of ice at 1 atmosphere of pressure in K
    35                         this.meltingpoint=273.15;
     31                //wet ice thermal conductivity (W/m/K)
     32                this.temperateiceconductivity=.24;
    3633
    37                         //rate of change of melting point with pressure (K/Pa)
    38                         this.beta=9.8*Math.pow(10,-8);
     34                //the melting point of ice at 1 atmosphere of pressure in K
     35                this.meltingpoint=273.15;
    3936
    40                         //mixed layer (ice-water interface) heat capacity (J/kg/K)
    41                         this.mixed_layer_capacity=3974.;
     37                //rate of change of melting point with pressure (K/Pa)
     38                this.beta=9.8*Math.pow(10,-8);
    4239
    43                         //thermal exchange velocity (ice-water interface) (m/s)
    44                         this.thermal_exchange_velocity=1.00*Math.pow(10,-4);
     40                //mixed layer (ice-water interface) heat capacity (J/kg/K)
     41                this.mixed_layer_capacity=3974.;
    4542
    46                         //Rheology law: what is the temperature dependence of B with T
    47                         //available: none, paterson and arrhenius
    48                         this.rheology_law='Paterson';
     43                //thermal exchange velocity (ice-water interface) (m/s)
     44                this.thermal_exchange_velocity=1.00*Math.pow(10,-4);
    4945
    50                         // GIA:
    51                         this.lithosphere_shear_modulus  = 6.7*Math.pow(10,10);  // (Pa)
    52                         this.lithosphere_density        = 3.32;       // (g/cm^-3)
    53                         this.mantle_shear_modulus       = 1.45*Math.pow(10,11); // (Pa)
    54                         this.mantle_density             = 3.34;       // (g/cm^-3)
    55                        
    56                         //SLR
    57                         this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
     46                //Rheology law: what is the temperature dependence of B with T
     47                //available: none, paterson and arrhenius
     48                this.rheology_law='Paterson';
     49
     50                // GIA:
     51                this.lithosphere_shear_modulus  = 6.7*Math.pow(10,10);  // (Pa)
     52                this.lithosphere_density        = 3.32;       // (g/cm^-3)
     53                this.mantle_shear_modulus       = 1.45*Math.pow(10,11); // (Pa)
     54                this.mantle_density             = 3.34;       // (g/cm^-3)
     55
     56                //SLR
     57                this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
    5858
    5959
    60                 } //}}}
    61                 this.disp = function() {// {{{
    62                         console.log(sprintf('   Materials:'));
     60        } //}}}
     61        this.disp = function() {// {{{
     62                console.log(sprintf('   Materials:'));
    6363
    64                         fielddisplay(this,'rho_ice','ice density [kg/m^3]');
    65                         fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
    66                         fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
    67                         fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
    68                         fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
    69                         fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
    70                         fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
    71                         fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
    72                         fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
    73                         fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
    74                         fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
    75                         fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
    76                         fielddisplay(this,'rheology_B','flow law parameter [Pa/s^(1/n)]');
    77                         fielddisplay(this,'rheology_n',"Glen's flow law exponent");
    78                         fielddisplay(this,'rheology_law',"law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'");
    79                         fielddisplay(this,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
    80                         fielddisplay(this,'lithosphere_density','Lithosphere density [g/cm^-3]');
    81                         fielddisplay(this,'mantle_shear_modulus','Mantle shear modulus [Pa]');
    82                         fielddisplay(this,'mantle_density','Mantle density [g/cm^-3]');
    83                         fielddisplay(this,'earth_density','Mantle density [kg/m^-3]');
     64                fielddisplay(this,'rho_ice','ice density [kg/m^3]');
     65                fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
     66                fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
     67                fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
     68                fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
     69                fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
     70                fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
     71                fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
     72                fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
     73                fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
     74                fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
     75                fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
     76                fielddisplay(this,'rheology_B','flow law parameter [Pa/s^(1/n)]');
     77                fielddisplay(this,'rheology_n',"Glen's flow law exponent");
     78                fielddisplay(this,'rheology_law',"law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'");
     79                fielddisplay(this,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
     80                fielddisplay(this,'lithosphere_density','Lithosphere density [g/cm^-3]');
     81                fielddisplay(this,'mantle_shear_modulus','Mantle shear modulus [Pa]');
     82                fielddisplay(this,'mantle_density','Mantle density [g/cm^-3]');
     83                fielddisplay(this,'earth_density','Mantle density [kg/m^-3]');
    8484
    85                 } // }}}
    86         this.extrude = function(md) {//{{{
    87             this.rheology_B=project3d(md,'vector',this.rheology_B,'type','node');
    88             this.rheology_n=project3d(md,'vector',this.rheology_n,'type','element');
    89             return this;
    90         }//}}}
    91                 this.classname = function() {// {{{
    92                         return "matice";
    93                 } // }}}
    94                 this.checkconsistency = function(md,solution,analyses) { // {{{
    95                         checkfield(md,'fieldname','materials.rho_ice','>',0);
    96                         checkfield(md,'fieldname','materials.rho_water','>',0);
    97                         checkfield(md,'fieldname','materials.rho_freshwater','>',0);
    98                         checkfield(md,'fieldname','materials.mu_water','>',0);
    99                         checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
    100                         checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements,1]);
    101                         checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval']);
     85        } // }}}
     86        this.extrude = function(md) {//{{{
     87                this.rheology_B=project3d(md,'vector',this.rheology_B,'type','node');
     88                this.rheology_n=project3d(md,'vector',this.rheology_n,'type','element');
     89                return this;
     90        }//}}}
     91        this.classname = function() {// {{{
     92                return "matice";
     93        } // }}}
     94        this.checkconsistency = function(md,solution,analyses) { // {{{
     95                checkfield(md,'fieldname','materials.rho_ice','>',0);
     96                checkfield(md,'fieldname','materials.rho_water','>',0);
     97                checkfield(md,'fieldname','materials.rho_freshwater','>',0);
     98                checkfield(md,'fieldname','materials.mu_water','>',0);
     99                checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
     100                checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements,1]);
     101                checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval']);
    102102
    103                         if(ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1)){
    104                                 checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
    105                                 checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
    106                                 checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
    107                                 checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
    108                         }
    109                         if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
    110                                 checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
    111                         }
     103                if(ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1)){
     104                        checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
     105                        checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
     106                        checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
     107                        checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
     108                }
     109                if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
     110                        checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
     111                }
    112112
    113113
    114                 } // }}}
    115                 this.marshall=function(md,prefix,fid) { //{{{
    116                         WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
    117                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
    118                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
    119                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
    120                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double');
    121                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double');
    122                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
    123                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
    124                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
    125                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
    126                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
    127                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
    128                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
    129                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
    130                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
    131                         WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
    132                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
    133                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',Math.pow(10,3));
    134                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double');
    135                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',Math.pow(10,3));
    136                         WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double');
     114        } // }}}
     115        this.marshall=function(md,prefix,fid) { //{{{
     116                WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
     117                WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
     118                WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
     119                WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
     120                WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double');
     121                WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double');
     122                WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
     123                WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
     124                WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
     125                WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
     126                WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
     127                WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
     128                WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
     129                WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
     130                WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
     131                WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
     132                WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
     133                WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',Math.pow(10,3));
     134                WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double');
     135                WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',Math.pow(10,3));
     136                WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double');
    137137
    138                 }//}}}
    139                 this.fix=function() { //{{{
    140                 }//}}}
     138        }//}}}
     139        this.fix=function() { //{{{
     140        }//}}}
    141141        //properties
    142142        // {{{
  • issm/trunk-jpl/src/m/classes/model.js

    r22098 r22298  
    6969                        this.debug            = new debug();
    7070                        this.verbose          = new verbose();
    71                         this.settings         = new settings();
     71                        this.settings         = new issmsettings();
    7272                        this.toolkits         = new toolkits();
    7373                        this.cluster          = new local();
  • issm/trunk-jpl/src/m/classes/model.py

    r22173 r22298  
    3131from debug import debug
    3232from verbose import verbose
    33 from settings import settings
     33from issmsettings import issmsettings
    3434from toolkits import toolkits
    3535from generic import generic
     
    9797                self.debug            = debug()
    9898                self.verbose          = verbose()
    99                 self.settings         = settings()
     99                self.settings         = issmsettings()
    100100                self.toolkits         = toolkits()
    101101                self.cluster          = generic()
Note: See TracChangeset for help on using the changeset viewer.