Changeset 27026
- Timestamp:
- 05/25/22 22:57:32 (3 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r27020 r27026 197 197 break; 198 198 case CalvingTestEnum: 199 iomodel->FetchData(&transparam,&N,&M,"md.calving.speedfactor");200 199 iomodel->FindConstant(&interp,"md.timestepping.interp_forcing"); 201 200 iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing"); 201 iomodel->FetchData(&transparam,&N,&M,"md.calving.speedfactor"); 202 202 if(N==1){ 203 203 _assert_(M==1); … … 207 207 _assert_(N==2); 208 208 parameters->AddObject(new TransientParam(CalvingTestSpeedfactorEnum,&transparam[0],&transparam[M],interp,cycle,M)); 209 } 210 xDelete<IssmDouble>(transparam); 211 iomodel->FetchData(&transparam,&N,&M,"md.calving.independentrate"); 212 if(N==1){ 213 _assert_(M==1); 214 parameters->AddObject(new DoubleParam(CalvingTestIndependentRateEnum,transparam[0])); 215 } 216 else{ 217 _assert_(N==2); 218 parameters->AddObject(new TransientParam(CalvingTestIndependentRateEnum,&transparam[0],&transparam[M],interp,cycle,M)); 209 219 } 210 220 xDelete<IssmDouble>(transparam); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r27020 r27026 372 372 IssmDouble calvingratey[NUMVERTICES]; 373 373 IssmDouble calvingrate[NUMVERTICES]; 374 IssmDouble vx,vy; 374 IssmDouble vx,vy,vel; 375 IssmDouble dphidx, dphidy, dphi; 375 376 IssmDouble time; 376 IssmDouble coeff ;377 IssmDouble coeff, indrate; 377 378 378 379 /*Retrieve all inputs and parameters we will need*/ 379 380 parameters->FindParam(&time,TimeEnum); 380 381 parameters->FindParam(&coeff,CalvingTestSpeedfactorEnum,time); 382 parameters->FindParam(&indrate,CalvingTestIndependentRateEnum,time); 381 383 382 384 Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input); 383 385 Input* vy_input = this->GetInput(VyEnum); _assert_(vy_input); 386 Input *lsf_slopex_input = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input); 387 Input *lsf_slopey_input = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input); 384 388 385 389 /* Start looping on the number of vertices: */ … … 392 396 vy_input->GetInputValue(&vy,&gauss); 393 397 394 calvingratex[iv]= coeff*vx; 395 calvingratey[iv]= coeff*vy; 398 lsf_slopex_input->GetInputValue(&dphidx,&gauss); 399 lsf_slopey_input->GetInputValue(&dphidy,&gauss); 400 401 vel=sqrt(vx*vx + vy*vy) + 1e-14; 402 dphi=sqrt(dphidx*dphidx+dphidy*dphidy)+ 1e-14; 403 404 calvingratex[iv]= coeff*vx + indrate*dphidx/dphi; 405 calvingratey[iv]= coeff*vy + indrate*dphidy/dphi; 396 406 calvingrate[iv] = sqrt(calvingratex[iv]*calvingratex[iv] + calvingratey[iv]*calvingratey[iv]); 397 398 407 } 399 408 -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r27009 r27026 107 107 CalvingMinthicknessEnum, 108 108 CalvingTestSpeedfactorEnum, 109 CalvingTestIndependentRateEnum, 109 110 CalvingUseParamEnum, 110 111 CalvingScaleThetaEnum, -
issm/trunk-jpl/src/m/classes/calvingtest.m
r27021 r27026 7 7 properties (SetAccess=public) 8 8 speedfactor = 1; 9 independentrate = 0; 9 10 end 10 11 methods … … 31 32 function self = setdefaultparameters(self) % {{{ 32 33 self.speedfactor = 1; 34 self.independentrate = 0; 33 35 end % }}} 34 36 function md = checkconsistency(self,md,solution,analyses) % {{{ … … 36 38 if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end 37 39 md = checkfield(md,'fieldname','calving.speedfactor','>=',0,'NaN',1,'Inf',1, 'singletimeseries', 1); 40 md = checkfield(md,'fieldname','calving.independentrate','NaN',1,'Inf',1, 'singletimeseries', 1); 38 41 end % }}} 39 42 function disp(self) % {{{ 40 43 disp(sprintf(' Calving test parameters:')); 41 44 fielddisplay(self,'speedfactor','calving rate is proportional to the ice velocity (e.g. speedfactor=1 -> calving front should not move)'); 45 fielddisplay(self,'independentrate','calving rate is independent of the ice velocity.'); 42 46 end % }}} 43 47 function marshall(self,prefix,md,fid) % {{{ … … 45 49 WriteData(fid,prefix,'name','md.calving.law','data',8,'format','Integer'); 46 50 WriteData(fid,prefix,'object',self,'fieldname','speedfactor','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts); 51 WriteData(fid,prefix,'object',self,'fieldname','independentrate','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./yts); 47 52 end % }}} 48 53 end
Note:
See TracChangeset
for help on using the changeset viewer.