Changeset 22298
- Timestamp:
- 12/22/17 08:10:33 (7 years ago)
- 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 definition1 //ISSMSETTINGS class definition 2 2 // 3 3 // Usage: 4 // settings=newsettings();4 // issmsettings=new issmsettings(); 5 5 6 function settings (){6 function issmsettings (){ 7 7 //methods 8 8 this.setdefaultparameters = function(){// {{{ … … 33 33 }// }}} 34 34 this.disp= function(){// {{{ 35 console.log(sprintf(' settings class echo:'));35 console.log(sprintf(' issmsettings class echo:')); 36 36 37 37 fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element'); … … 51 51 }// }}} 52 52 this.classname= function(){// {{{ 53 return " settings";53 return "issmsettings"; 54 54 55 55 }// }}} … … 65 65 } // }}} 66 66 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'); 73 73 if (this.waitonlock>0) WriteData(fid,prefix,'name','md.settings.waitonlock','data',true,'format','Boolean'); 74 74 else WriteData(fid,prefix,'name','md.settings.waitonlock','data',false,'format','Boolean'); -
issm/trunk-jpl/src/m/classes/issmsettings.py
r22297 r22298 3 3 from WriteData import WriteData 4 4 5 class settings(object):5 class issmsettings(object): 6 6 """ 7 SETTINGS class definition7 ISSMSETTINGS class definition 8 8 9 9 Usage: 10 settings=settings();10 issmsettings=issmsettings(); 11 11 """ 12 12 … … 25 25 #}}} 26 26 def __repr__(self): # {{{ 27 string=" general settings parameters:"27 string=" general issmsettings parameters:" 28 28 29 29 string="%s\n%s"%(string,fielddisplay(self,"results_on_nodes","results are output for all the nodes of each element")) … … 74 74 # }}} 75 75 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') 81 81 82 82 if self.waitonlock>0: -
issm/trunk-jpl/src/m/classes/matice.js
r21530 r22298 6 6 function matice(){ 7 7 //methods 8 8 this.setdefaultparameters = function(){ // {{{ 9 9 10 11 10 //ice density (kg/m^3) 11 this.rho_ice=917.; 12 12 13 14 13 //ocean water density (kg/m^3) 14 this.rho_water=1023.; 15 15 16 17 16 //fresh water density (kg/m^3) 17 this.rho_freshwater=1000.; 18 18 19 20 19 //water viscosity (N.s/m^2) 20 this.mu_water=0.001787; 21 21 22 23 22 //ice heat capacity cp (J/kg/K) 23 this.heatcapacity=2093.; 24 24 25 26 25 //ice latent heat of fusion L (J/kg) 26 this.latentheat=3.34*Math.pow(10,5); 27 27 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; 33 30 34 //the melting point of ice at 1 atmosphere of pressure in K35 this.meltingpoint=273.15;31 //wet ice thermal conductivity (W/m/K) 32 this.temperateiceconductivity=.24; 36 33 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; 39 36 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); 42 39 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.; 45 42 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); 49 45 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) 58 58 59 59 60 61 62 60 } //}}} 61 this.disp = function() {// {{{ 62 console.log(sprintf(' Materials:')); 63 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 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]'); 84 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 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']); 102 102 103 104 105 106 107 108 109 110 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 } 112 112 113 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 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'); 137 137 138 139 140 138 }//}}} 139 this.fix=function() { //{{{ 140 }//}}} 141 141 //properties 142 142 // {{{ -
issm/trunk-jpl/src/m/classes/model.js
r22098 r22298 69 69 this.debug = new debug(); 70 70 this.verbose = new verbose(); 71 this.settings = new settings();71 this.settings = new issmsettings(); 72 72 this.toolkits = new toolkits(); 73 73 this.cluster = new local(); -
issm/trunk-jpl/src/m/classes/model.py
r22173 r22298 31 31 from debug import debug 32 32 from verbose import verbose 33 from settings importsettings33 from issmsettings import issmsettings 34 34 from toolkits import toolkits 35 35 from generic import generic … … 97 97 self.debug = debug() 98 98 self.verbose = verbose() 99 self.settings = settings()99 self.settings = issmsettings() 100 100 self.toolkits = toolkits() 101 101 self.cluster = generic()
Note:
See TracChangeset
for help on using the changeset viewer.