Changeset 25941
- Timestamp:
- 01/18/21 03:37:32 (4 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
r25777 r25941 112 112 } 113 113 iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 114 //iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum);114 iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum); 115 115 116 116 … … 153 153 void StressbalanceVerticalAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ 154 154 155 /*No specific parameters*/ 155 /* specific parameters*/ 156 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvzsolution",StressbalanceIsVzSolutionEnum)); 157 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvelbc",StressbalanceIsVelBCEnum)); 156 158 157 159 }/*}}}*/ … … 516 518 IssmDouble rho_ice,g; 517 519 520 int isvzsolution; 521 IssmDouble isvelbc, rheology_n, eta; 522 518 523 /*Get the approximation and do nothing if the element in FS or None*/ 519 524 element->GetInputValue(&approximation,ApproximationEnum); … … 521 526 return; 522 527 } 528 529 /*Get parameters*/ 530 element->FindParam(&isvzsolution,StressbalanceIsVzSolutionEnum); 531 element->FindParam(&isvelbc,StressbalanceIsVelBCEnum); 523 532 524 533 /*Get dof list and vertices coordinates: */ … … 535 544 IssmDouble* pressure = xNew<IssmDouble>(numnodes); 536 545 IssmDouble* surface = xNew<IssmDouble>(numnodes); 546 IssmDouble* thickness = xNew<IssmDouble>(numnodes); 547 IssmDouble* base = xNew<IssmDouble>(numnodes); 548 IssmDouble* smb = xNew<IssmDouble>(numnodes); 537 549 538 550 /*Use the dof list to index into the solution vector vz: */ … … 575 587 } 576 588 } 589 590 /*Set analytical vertical velocity field at slow flow region.*/ 591 if (isvzsolution == 1){ 592 rheology_n=element->material->GetN(); 593 element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.); 594 element->GetInputListOnNodes(&base[0],BaseEnum,0.); 595 element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.); 596 for(i=0;i<numnodes;i++){ 597 eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i]; 598 vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i]; 599 } 600 } 601 else if (isvzsolution == 2) { 602 rheology_n=element->material->GetN(); 603 element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.); 604 element->GetInputListOnNodes(&base[0],BaseEnum,0.); 605 element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.); 606 for(i=0;i<numnodes;i++){ 607 if ( vx[i]*vx[i]+vy[i]*vy[i] < isvelbc*isvelbc ){ 608 eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i]; 609 vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i]; 610 } 611 } 612 } 613 577 614 578 615 /*Now Compute vel*/ … … 600 637 601 638 /*Free ressources:*/ 639 xDelete<IssmDouble>(smb); 640 xDelete<IssmDouble>(base); 641 xDelete<IssmDouble>(thickness); 602 642 xDelete<IssmDouble>(surface); 603 643 xDelete<IssmDouble>(pressure); -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r25839 r25941 441 441 StressbalanceRiftPenaltyThresholdEnum, 442 442 StressbalanceShelfDampeningEnum, 443 StressbalanceIsVzSolutionEnum, 444 StressbalanceIsVelBCEnum, 443 445 ThermalIsdrainicecolumnEnum, 444 446 ThermalIsdynamicbasalspcEnum, -
issm/trunk-jpl/src/m/classes/stressbalance.m
r24861 r25941 23 23 loadingforce = NaN; 24 24 requested_outputs = {}; 25 isvzsolution = NaN; 26 isvelbc = NaN; 25 27 end 26 28 methods … … 75 77 self.rift_penalty_lock=10; 76 78 79 %Set vertical velocity option 80 self.isvzsolution = 0; 81 self.isvelbc = 10.; 82 77 83 %output default: 78 84 self.requested_outputs={'default'}; … … 96 102 md = checkfield(md,'fieldname','stressbalance.referential','size',[md.mesh.numberofvertices 6]); 97 103 md = checkfield(md,'fieldname','stressbalance.loadingforce','size',[md.mesh.numberofvertices 3]); 104 md = checkfield(md,'fieldname','stressbalance.isvzsolution','numel',[1],'values',[0 1 2]); 105 md = checkfield(md,'fieldname','stressbalance.isvelbc','numel',[1],'>=',0.0); 98 106 md = checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1); 99 107 if ~any(isnan(md.stressbalance.vertex_pairing)), … … 158 166 fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset'); 159 167 fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized'); 168 169 disp(sprintf('\n %s','Estimation of vertical velocity field options:')); 170 fielddisplay(self,'isvzsolution','0: incompressible assumption(IA), 1: internal deformation(ID), 2: IA+ID'); 171 fielddisplay(self,'isvelbc','If turned on isvzsolution as 2, region (vel < isvelbc) calculates for ID.'); 160 172 161 173 disp(sprintf('\n %s','Other:')); … … 187 199 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer'); 188 200 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1); 201 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isvzsolution','format','Integer','numel',1,'values',[0 1 2]); 202 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isvelbc','format','Double','numel',1,'scale',1./yts); 189 203 190 204 if size(self.loadingforce,2)==3,
Note:
See TracChangeset
for help on using the changeset viewer.