Changeset 21626
- Timestamp:
- 03/23/17 15:47:16 (8 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r20983 r21626 61 61 break; 62 62 case CalvingDevEnum: 63 iomodel->FetchDataToInput(elements,"md.calving.coeff",CalvingdevCoeffEnum);64 63 iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum); 65 64 break; … … 75 74 parameters->AddObject(iomodel->CopyConstantObject("md.levelset.stabilization",LevelsetStabilizationEnum)); 76 75 parameters->AddObject(iomodel->CopyConstantObject("md.levelset.reinit_frequency",LevelsetReinitFrequencyEnum)); 76 parameters->AddObject(iomodel->CopyConstantObject("md.levelset.calving_max",CalvingMaxEnum)); 77 77 int calvinglaw; 78 78 iomodel->FindConstant(&calvinglaw,"md.calving.law"); … … 80 80 case DefaultCalvingEnum: 81 81 case CalvingLevermannEnum: 82 break; 82 83 case CalvingDevEnum: 84 parameters->AddObject(iomodel->CopyConstantObject("md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum)); 85 parameters->AddObject(iomodel->CopyConstantObject("md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum)); 83 86 break; 84 87 case CalvingMinthicknessEnum: … … 138 141 IssmDouble h,hx,hy,hz; 139 142 IssmDouble vel; 140 IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate; 143 IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate, groundedice; 144 IssmDouble calvingmax; 141 145 IssmDouble* xyz_list = NULL; 142 146 … … 152 156 } 153 157 158 /*Calving threshold*/ 159 154 160 /*Fetch number of nodes and dof for this finite element*/ 155 161 int numnodes = basalelement->GetNumberOfNodes(); … … 170 176 basalelement->GetVerticesCoordinates(&xyz_list); 171 177 basalelement->FindParam(&dt,TimesteppingTimeStepEnum); 178 basalelement->FindParam(&calvingmax,CalvingMaxEnum); 172 179 Input* vx_input = NULL; 173 180 Input* vy_input = NULL; … … 178 185 Input* calvingrate_input = NULL; 179 186 Input* meltingrate_input = NULL; 187 Input* gr_input = NULL; 180 188 181 189 /*Load velocities*/ … … 187 195 vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input); 188 196 vy_input=basalelement->GetInput(VyEnum); _assert_(vy_input); 197 gr_input=basalelement->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input); 189 198 break; 190 199 case Domain3DEnum: 191 200 vx_input=basalelement->GetInput(VxAverageEnum); _assert_(vx_input); 192 201 vy_input=basalelement->GetInput(VyAverageEnum); _assert_(vy_input); 202 gr_input=basalelement->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input); 193 203 break; 194 204 default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); … … 253 263 vx_input->GetInputValue(&v[0],gauss); 254 264 vy_input->GetInputValue(&v[1],gauss); 265 gr_input->GetInputValue(&groundedice,gauss); 255 266 256 267 /*Get calving speed*/ … … 262 273 calvingrate_input->GetInputValue(&calvingrate,gauss); 263 274 meltingrate_input->GetInputValue(&meltingrate,gauss); 275 276 /*Limit calving rate to c <= v + 3 km/yr */ 277 vel=sqrt(v[0]*v[0] + v[1]*v[1]); 278 if(calvingrate>calvingmax+vel) calvingrate = vel+calvingmax; 279 if(groundedice<0) meltingrate = 0; 264 280 265 281 norm_dlsf=0.; -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r21583 r21626 186 186 IssmDouble calvingrate[NUMVERTICES]; 187 187 IssmDouble lambda1,lambda2,ex,ey,vx,vy,vel; 188 IssmDouble sigma_vm,sigma_max,epse_2,groundedice; 188 IssmDouble sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded; 189 IssmDouble epse_2,groundedice; 189 190 190 191 /* Get node coordinates and dof list: */ … … 202 203 IssmDouble B = this->GetMaterialParameter(MaterialsRheologyBbarEnum); 203 204 IssmDouble n = this->GetMaterialParameter(MaterialsRheologyNEnum); 205 this->parameters->FindParam(&sigma_max_floating,CalvingStressThresholdFloatingiceEnum); 206 this->parameters->FindParam(&sigma_max_grounded,CalvingStressThresholdGroundediceEnum); 204 207 205 208 /* Start looping on the number of vertices: */ … … 229 232 epse_2 = 1./2. *(lambda1*lambda1 + lambda2*lambda2); 230 233 sigma_vm = sqrt(3.) * B * pow(epse_2,1./(2.*n)); 231 sigma_max = 1000.e+3; 232 233 if(groundedice<0) sigma_max=200.e+3; 234 235 /*Tensile stress threshold*/ 236 if(groundedice<0) 237 sigma_max = sigma_max_floating; 238 else 239 sigma_max = sigma_max_grounded; 234 240 235 241 /*Assign values*/ -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r21620 r21626 216 216 IssmDouble calvingrate[NUMVERTICES]; 217 217 IssmDouble lambda1,lambda2,ex,ey,vx,vy,vel; 218 IssmDouble sigma_vm,sigma_max,epse_2,groundedice; 218 IssmDouble sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded; 219 IssmDouble epse_2,groundedice; 219 220 220 221 /* Get node coordinates and dof list: */ … … 227 228 IssmDouble B = this->GetMaterialParameter(MaterialsRheologyBbarEnum); 228 229 IssmDouble n = this->GetMaterialParameter(MaterialsRheologyNEnum); 230 this->parameters->FindParam(&sigma_max_floating,CalvingStressThresholdFloatingiceEnum); 231 this->parameters->FindParam(&sigma_max_grounded,CalvingStressThresholdGroundediceEnum); 229 232 230 233 /* Start looping on the number of vertices: */ … … 254 257 epse_2 = 1./2. *(lambda1*lambda1 + lambda2*lambda2); 255 258 sigma_vm = sqrt(3.) * B * pow(epse_2,1./(2.*n)); 256 //sigma_max = 125.e+3; 257 sigma_max = 350.e+3; 258 sigma_max = 450.e+3; 259 sigma_max = 800.e+3; //too much 260 //sigma_max = 700.e+3; 261 //sigma_max = 670.e+3; 262 //sigma_max = 550.e+3; 263 sigma_max = 750.e+3; //too high 264 sigma_max = 850.e+3; //too low 265 sigma_max = 800.e+3; //IUGG previous test 266 sigma_max = 1000.e+3; //850 seems small 267 268 if(groundedice<0) sigma_max=200.e+3; 259 260 /*OLD (keep for a little bit)*/ 261 //sigma_max = 800.e+3; //IUGG previous test 262 //sigma_max = 1000.e+3; //GRL 263 //if(groundedice<0) sigma_max=150.e+3; 264 265 /*Tensile stress threshold*/ 266 if(groundedice<0) 267 sigma_max = sigma_max_floating; 268 else 269 sigma_max = sigma_max_grounded; 269 270 270 271 /*Assign values*/ … … 294 295 IssmDouble calvingratey[NUMVERTICES]; 295 296 IssmDouble calvingrate[NUMVERTICES]; 296 297 297 298 298 /* Get node coordinates and dof list: */ -
issm/trunk-jpl/src/c/cores/levelsetfunctionslope_core.cpp
r17700 r21626 33 33 } 34 34 if(domaintype==Domain2DverticalEnum){ 35 35 femmodel->parameters->SetParam(LevelsetfunctionSlopeXEnum,InputToExtrudeEnum); 36 36 extrudefrombase_core(femmodel); 37 37 } -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r21620 r21626 259 259 CalvingratexAverageEnum, 260 260 CalvingrateyAverageEnum, 261 CalvingStressThresholdGroundediceEnum, 262 CalvingStressThresholdFloatingiceEnum, 263 CalvingMaxEnum, 261 264 StrainRateparallelEnum, 262 265 StrainRateperpendicularEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r21620 r21626 265 265 case CalvingratexAverageEnum : return "CalvingratexAverage"; 266 266 case CalvingrateyAverageEnum : return "CalvingrateyAverage"; 267 case CalvingStressThresholdGroundediceEnum : return "CalvingStressThresholdGroundedice"; 268 case CalvingStressThresholdFloatingiceEnum : return "CalvingStressThresholdFloatingice"; 269 case CalvingMaxEnum : return "CalvingMax"; 267 270 case StrainRateparallelEnum : return "StrainRateparallel"; 268 271 case StrainRateperpendicularEnum : return "StrainRateperpendicular"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r21620 r21626 271 271 else if (strcmp(name,"CalvingratexAverage")==0) return CalvingratexAverageEnum; 272 272 else if (strcmp(name,"CalvingrateyAverage")==0) return CalvingrateyAverageEnum; 273 else if (strcmp(name,"CalvingStressThresholdGroundedice")==0) return CalvingStressThresholdGroundediceEnum; 274 else if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum; 275 else if (strcmp(name,"CalvingMax")==0) return CalvingMaxEnum; 273 276 else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum; 274 277 else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum; … … 380 383 else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum; 381 384 else if (strcmp(name,"SmbIsInitialized")==0) return SmbIsInitializedEnum; 382 else if (strcmp(name,"SmbDzini")==0) return SmbDziniEnum;383 else if (strcmp(name,"SmbDini")==0) return SmbDiniEnum;384 else if (strcmp(name,"SmbReini")==0) return SmbReiniEnum;385 385 else stage=4; 386 386 } 387 387 if(stage==4){ 388 if (strcmp(name,"SmbGdnini")==0) return SmbGdniniEnum; 388 if (strcmp(name,"SmbDzini")==0) return SmbDziniEnum; 389 else if (strcmp(name,"SmbDini")==0) return SmbDiniEnum; 390 else if (strcmp(name,"SmbReini")==0) return SmbReiniEnum; 391 else if (strcmp(name,"SmbGdnini")==0) return SmbGdniniEnum; 389 392 else if (strcmp(name,"SmbGspini")==0) return SmbGspiniEnum; 390 393 else if (strcmp(name,"SmbECini")==0) return SmbECiniEnum; … … 503 506 else if (strcmp(name,"SurfaceAbsVelMisfit")==0) return SurfaceAbsVelMisfitEnum; 504 507 else if (strcmp(name,"SurfaceArea")==0) return SurfaceAreaEnum; 505 else if (strcmp(name,"SurfaceAverageVelMisfit")==0) return SurfaceAverageVelMisfitEnum;506 else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum;507 else if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;508 508 else stage=5; 509 509 } 510 510 if(stage==5){ 511 if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum; 511 if (strcmp(name,"SurfaceAverageVelMisfit")==0) return SurfaceAverageVelMisfitEnum; 512 else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum; 513 else if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum; 514 else if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum; 512 515 else if (strcmp(name,"SurfaceSlopeX")==0) return SurfaceSlopeXEnum; 513 516 else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum; … … 626 629 else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum; 627 630 else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum; 628 else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;629 else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;630 else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;631 631 else stage=6; 632 632 } 633 633 if(stage==6){ 634 if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum; 634 if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum; 635 else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum; 636 else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum; 637 else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum; 635 638 else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum; 636 639 else if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum; … … 749 752 else if (strcmp(name,"Scaled")==0) return ScaledEnum; 750 753 else if (strcmp(name,"Separate")==0) return SeparateEnum; 751 else if (strcmp(name,"Sset")==0) return SsetEnum;752 else if (strcmp(name,"Dense")==0) return DenseEnum;753 else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum;754 754 else stage=7; 755 755 } 756 756 if(stage==7){ 757 if (strcmp(name,"MpiSparse")==0) return MpiSparseEnum; 757 if (strcmp(name,"Sset")==0) return SsetEnum; 758 else if (strcmp(name,"Dense")==0) return DenseEnum; 759 else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum; 760 else if (strcmp(name,"MpiSparse")==0) return MpiSparseEnum; 758 761 else if (strcmp(name,"Seq")==0) return SeqEnum; 759 762 else if (strcmp(name,"Mpi")==0) return MpiEnum; … … 872 875 else if (strcmp(name,"Penta")==0) return PentaEnum; 873 876 else if (strcmp(name,"PentaInput")==0) return PentaInputEnum; 874 else if (strcmp(name,"Vertex")==0) return VertexEnum;875 else if (strcmp(name,"VertexPId")==0) return VertexPIdEnum;876 else if (strcmp(name,"VertexSId")==0) return VertexSIdEnum;877 877 else stage=8; 878 878 } 879 879 if(stage==8){ 880 if (strcmp(name,"Option")==0) return OptionEnum; 880 if (strcmp(name,"Vertex")==0) return VertexEnum; 881 else if (strcmp(name,"VertexPId")==0) return VertexPIdEnum; 882 else if (strcmp(name,"VertexSId")==0) return VertexSIdEnum; 883 else if (strcmp(name,"Option")==0) return OptionEnum; 881 884 else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum; 882 885 else if (strcmp(name,"OptionCell")==0) return OptionCellEnum; … … 995 998 else if (strcmp(name,"LACrouzeixRaviart")==0) return LACrouzeixRaviartEnum; 996 999 else if (strcmp(name,"Closed")==0) return ClosedEnum; 997 else if (strcmp(name,"Free")==0) return FreeEnum;998 else if (strcmp(name,"Open")==0) return OpenEnum;999 else if (strcmp(name,"Air")==0) return AirEnum;1000 1000 else stage=9; 1001 1001 } 1002 1002 if(stage==9){ 1003 if (strcmp(name,"Ice")==0) return IceEnum; 1003 if (strcmp(name,"Free")==0) return FreeEnum; 1004 else if (strcmp(name,"Open")==0) return OpenEnum; 1005 else if (strcmp(name,"Air")==0) return AirEnum; 1006 else if (strcmp(name,"Ice")==0) return IceEnum; 1004 1007 else if (strcmp(name,"Melange")==0) return MelangeEnum; 1005 1008 else if (strcmp(name,"Water")==0) return WaterEnum; -
issm/trunk-jpl/src/m/classes/calvingdev.m
r21049 r21626 6 6 classdef calvingdev 7 7 properties (SetAccess=public) 8 coeff = NaN; 8 stress_threshold_groundedice = 0.; 9 stress_threshold_floatingice = 0.; 9 10 meltingrate = NaN; 10 11 end … … 29 30 end % }}} 30 31 function self = extrude(self,md) % {{{ 31 self.coeff=project3d(md,'vector',self.coeff,'type','node');32 32 self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node'); 33 33 end % }}} … … 35 35 36 36 %Proportionality coefficient in Pi model 37 self.coeff=2e13; 37 %self.coeff=2e13; 38 39 %Default sigma max 40 self.stress_threshold_groundedice = 1e6; 41 self.stress_threshold_floatingice = 150e3; 38 42 end % }}} 39 43 function md = checkconsistency(self,md,solution,analyses) % {{{ … … 41 45 if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end 42 46 43 md = checkfield(md,'fieldname','calving.coeff','>',0,'size',[md.mesh.numberofvertices 1]); 47 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'numel',1,'nan',1,'Inf',1); 48 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'numel',1,'nan',1,'Inf',1); 44 49 md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0); 45 50 end % }}} 46 51 function disp(self) % {{{ 47 52 disp(sprintf(' Calving Pi parameters:')); 48 fielddisplay(self,'coeff','proportionality coefficient in Pi model'); 53 fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]'); 54 fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]'); 49 55 fielddisplay(self,'meltingrate','melting rate at given location [m/a]'); 50 56 … … 53 59 yts=md.constants.yts; 54 60 WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer'); 55 WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1); 56 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1,'scale',1./yts); 61 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1); 62 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1); 63 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 57 64 end % }}} 58 65 end -
issm/trunk-jpl/src/m/classes/calvinglevermann.m
r21049 r21626 42 42 43 43 md = checkfield(md,'fieldname','calving.coeff','>',0,'size',[md.mesh.numberofvertices 1]); 44 md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,' size',[md.mesh.numberofvertices 1],'>=',0);44 md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0); 45 45 end % }}} 46 46 function disp(self) % {{{ … … 54 54 WriteData(fid,prefix,'name','md.calving.law','data',3,'format','Integer'); 55 55 WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1); 56 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,' yts',md.constants.yts,'scale',1./yts);56 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 57 57 end % }}} 58 58 end -
issm/trunk-jpl/src/m/classes/calvingminthickness.m
r21049 r21626 53 53 WriteData(fid,prefix,'name','md.calving.law','data',4,'format','Integer'); 54 54 WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double'); 55 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,' forcinglength',md.mesh.numberofvertices+1,'scale',1./yts);55 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 56 56 end % }}} 57 57 end -
issm/trunk-jpl/src/m/classes/levelset.m
r21049 r21626 9 9 spclevelset = NaN; 10 10 reinit_frequency = 5; 11 calving_max = 0.; 11 12 end 12 13 methods … … 36 37 37 38 %stabilization = 2 by default 38 self.stabilization = 2;39 self.stabilization = 2; 39 40 self.reinit_frequency = 5; 41 self.calving_max = 3000.; 40 42 41 43 end % }}} … … 46 48 md = checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1); 47 49 md = checkfield(md,'fieldname','levelset.stabilization','values',[0 1 2]); 50 md = checkfield(md,'fieldname','levelset.calving_max','numel',1,'NaN',1,'Inf',1,'>',0); 48 51 end % }}} 49 52 function disp(self) % {{{ … … 52 55 fielddisplay(self,'spclevelset','Levelset constraints (NaN means no constraint)'); 53 56 fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized'); 57 fielddisplay(self,'calving_max','maximum allowed calving rate (m/a)'); 54 58 end % }}} 55 59 function marshall(self,prefix,md,fid) % {{{ 60 61 yts=md.constants.yts; 62 56 63 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 57 64 WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 58 65 WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer'); 66 WriteData(fid,prefix,'object',self,'fieldname','calving_max','format','Double','scale',1./yts); 59 67 end % }}} 60 68 function savemodeljs(self,fid,modelname) % {{{ … … 63 71 writejs1Darray(fid,[modelname '.levelset.spclevelset'],self.spclevelset); 64 72 writejs1Darray(fid,[modelname '.levelset.reinit_frequency'],self.reinit_frequency); 73 writejsdouble(fid,[modelname '.levelset.calving_max'],self.calving_max); 65 74 66 75 end % }}} -
issm/trunk-jpl/src/m/classes/levelset.py
r21049 r21626 14 14 def __init__(self): # {{{ 15 15 16 self.stabilization = 017 self.spclevelset = float('NaN')16 self.stabilization = 0 17 self.spclevelset = float('NaN') 18 18 self.reinit_frequency = 0 19 self.calving_max = 0. 19 20 20 21 #set defaults … … 27 28 string="%s\n%s"%(string,fielddisplay(self,'spclevelset','levelset constraints (NaN means no constraint)')) 28 29 string="%s\n%s"%(string,fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized')) 30 string="%s\n%s"%(string,fielddisplay(self,'calving_max','maximum allowed calving rate (m/a)')) 29 31 30 32 return string … … 39 41 self.stabilization = 2 40 42 self.reinit_frequency = 5 43 self.calving_max = 3000 41 44 42 45 return self … … 50 53 md = checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1) 51 54 md = checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2]); 55 md = checkfield(md,'fieldname','levelset.calving_max','numel',1,'NaN',1,'Inf',1,'>',0); 52 56 53 57 return md … … 55 59 def marshall(self,prefix,md,fid): # {{{ 56 60 61 yts=md.constants.yts; 62 57 63 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 58 64 WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 59 65 WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer'); 66 WriteData(fid,prefix,'object',self,'fieldname','calving_max','format','Double','scale',1./yts); 60 67 # }}}
Note:
See TracChangeset
for help on using the changeset viewer.