Changeset 25942
- Timestamp:
- 01/18/21 10:20:53 (4 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
r25941 r25942 5 5 #include "../modules/modules.h" 6 6 #include "../solutionsequences/solutionsequences.h" 7 8 //#define INWOOVZ 1 //For Inwoo Park 0: incompressible assumption(IA), 1: internal deformation(ID), 2: IA+ID 7 9 8 10 /*Model processing*/ … … 112 114 } 113 115 iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 116 #ifdef INWOOVZ 114 117 iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum); 118 #endif 115 119 116 120 … … 154 158 155 159 /* specific parameters*/ 156 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvzsolution",StressbalanceIsVzSolutionEnum));157 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvelbc",StressbalanceIsVelBCEnum));158 160 159 161 }/*}}}*/ … … 518 520 IssmDouble rho_ice,g; 519 521 520 int isvzsolution;521 IssmDouble isvelbc, rheology_n, eta;522 523 522 /*Get the approximation and do nothing if the element in FS or None*/ 524 523 element->GetInputValue(&approximation,ApproximationEnum); … … 526 525 return; 527 526 } 528 529 /*Get parameters*/530 element->FindParam(&isvzsolution,StressbalanceIsVzSolutionEnum);531 element->FindParam(&isvelbc,StressbalanceIsVelBCEnum);532 527 533 528 /*Get dof list and vertices coordinates: */ … … 544 539 IssmDouble* pressure = xNew<IssmDouble>(numnodes); 545 540 IssmDouble* surface = xNew<IssmDouble>(numnodes); 546 IssmDouble* thickness = xNew<IssmDouble>(numnodes);547 IssmDouble* base = xNew<IssmDouble>(numnodes);548 IssmDouble* smb = xNew<IssmDouble>(numnodes);549 541 550 542 /*Use the dof list to index into the solution vector vz: */ … … 588 580 } 589 581 582 583 #ifdef INWOOVZ 584 IssmDouble* thickness = xNew<IssmDouble>(numnodes); 585 IssmDouble* base = xNew<IssmDouble>(numnodes); 586 IssmDouble* smb = xNew<IssmDouble>(numnodes); 587 588 IssmDouble rheology_n=element->material->GetN(); 589 IssmDouble isvelbc = 10./(365.25*24*3600); /*10 m/yr*/ 590 590 /*Set analytical vertical velocity field at slow flow region.*/ 591 if (isvzsolution == 1){ 592 rheology_n=element->material->GetN(); 591 if(INWOOVZ == 1){ 593 592 element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.); 594 593 element->GetInputListOnNodes(&base[0],BaseEnum,0.); 595 594 element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.); 596 595 for(i=0;i<numnodes;i++){ 597 eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];596 IssmDouble eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i]; 598 597 vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i]; 599 598 } 600 599 } 601 else if (isvzsolution == 2) { 602 rheology_n=element->material->GetN(); 600 else if(INWOOVZ== 2) { 603 601 element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.); 604 602 element->GetInputListOnNodes(&base[0],BaseEnum,0.); … … 606 604 for(i=0;i<numnodes;i++){ 607 605 if ( vx[i]*vx[i]+vy[i]*vy[i] < isvelbc*isvelbc ){ 608 eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];606 IssmDouble eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i]; 609 607 vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i]; 610 608 } 611 609 } 612 610 } 611 else if(INWOOVZ==0){ 612 /*nothing to add*/ 613 } 614 else{ 615 _error_("not supported yet"); 616 } 617 618 /*Cleanup*/ 619 xDelete<IssmDouble>(smb); 620 xDelete<IssmDouble>(base); 621 xDelete<IssmDouble>(thickness); 622 #endif 613 623 614 624 … … 637 647 638 648 /*Free ressources:*/ 639 xDelete<IssmDouble>(smb);640 xDelete<IssmDouble>(base);641 xDelete<IssmDouble>(thickness);642 649 xDelete<IssmDouble>(surface); 643 650 xDelete<IssmDouble>(pressure); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r25934 r25942 3015 3015 IssmDouble* values = xNew<IssmDouble>(numnodes); 3016 3016 3017 if(this->Id()==104 || this->Id()==266 || this->Id()==264 || this->Id()==247 || this->Id()==263 || this->Id()==249 || this->Id()==250){ 3018 if(enum_type==MaskIceLevelsetEnum) printf("-----------------\n"); 3019 } 3020 3017 3021 /*Use the dof list to index into the solution vector: */ 3018 3022 for(int i=0;i<numnodes;i++){ 3019 3023 values[i]=solution[doflist[i]]; 3024 if(this->Id()==104 || this->Id()==266 || this->Id()==264 || this->Id()==247 || this->Id()==263 || this->Id()==249 || this->Id()==250){ 3025 if(enum_type==MaskIceLevelsetEnum) printf("%g\n",values[i]); 3026 if(enum_type==MaskIceLevelsetEnum && values[i]>0.5 && values[i]<1.5 )this->nodes[i]->DeepEcho(); 3027 } 3020 3028 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 3021 3029 if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector, SID = " << this->Sid()); 3022 3030 } 3031 3023 3032 3024 3033 /*Add input to the element: */ -
issm/trunk-jpl/src/c/shared/Enum/Enum.vim
r25839 r25942 1399 1399 syn keyword cType Cfsurfacesquare 1400 1400 syn keyword cType Channel 1401 syn keyword cType classes 1401 1402 syn keyword cType Constraint 1402 1403 syn keyword cType Constraints … … 1405 1406 syn keyword cType ControlInput 1406 1407 syn keyword cType Covertree 1408 syn keyword cType DatasetInput 1407 1409 syn keyword cType DataSetParam 1408 syn keyword cType DatasetInput1409 1410 syn keyword cType Definition 1410 1411 syn keyword cType DependentObject … … 1419 1420 syn keyword cType ElementInput 1420 1421 syn keyword cType ElementMatrix 1422 syn keyword cType Elements 1421 1423 syn keyword cType ElementVector 1422 syn keyword cType Elements1423 1424 syn keyword cType ExponentialVariogram 1424 1425 syn keyword cType ExternalResult … … 1427 1428 syn keyword cType Friction 1428 1429 syn keyword cType Gauss 1430 syn keyword cType GaussianVariogram 1431 syn keyword cType gaussobjects 1429 1432 syn keyword cType GaussPenta 1430 1433 syn keyword cType GaussSeg 1431 1434 syn keyword cType GaussTetra 1432 1435 syn keyword cType GaussTria 1433 syn keyword cType GaussianVariogram1434 1436 syn keyword cType GenericExternalResult 1435 1437 syn keyword cType GenericOption … … 1446 1448 syn keyword cType IssmDirectApplicInterface 1447 1449 syn keyword cType IssmParallelDirectApplicInterface 1450 syn keyword cType krigingobjects 1448 1451 syn keyword cType Load 1449 1452 syn keyword cType Loads … … 1456 1459 syn keyword cType Matice 1457 1460 syn keyword cType Matlitho 1461 syn keyword cType matrixobjects 1458 1462 syn keyword cType MatrixParam 1459 1463 syn keyword cType Misfit … … 1468 1472 syn keyword cType Observations 1469 1473 syn keyword cType Option 1474 syn keyword cType Options 1470 1475 syn keyword cType OptionUtilities 1471 syn keyword cType Options1472 1476 syn keyword cType Param 1473 1477 syn keyword cType Parameters … … 1483 1487 syn keyword cType Regionaloutput 1484 1488 syn keyword cType Results 1489 syn keyword cType Riftfront 1485 1490 syn keyword cType RiftStruct 1486 syn keyword cType Riftfront1487 1491 syn keyword cType SealevelMasks 1488 1492 syn keyword cType Seg 1489 1493 syn keyword cType SegInput 1494 syn keyword cType Segment 1490 1495 syn keyword cType SegRef 1491 syn keyword cType Segment1492 1496 syn keyword cType SpcDynamic 1493 1497 syn keyword cType SpcStatic … … 1508 1512 syn keyword cType Vertex 1509 1513 syn keyword cType Vertices 1510 syn keyword cType classes1511 syn keyword cType gaussobjects1512 syn keyword cType krigingobjects1513 syn keyword cType matrixobjects1514 1514 syn keyword cType AdjointBalancethickness2Analysis 1515 1515 syn keyword cType AdjointBalancethicknessAnalysis … … 1530 1530 syn keyword cType FreeSurfaceBaseAnalysis 1531 1531 syn keyword cType FreeSurfaceTopAnalysis 1532 syn keyword cType GiaAnalysis 1532 1533 syn keyword cType GLheightadvectionAnalysis 1533 syn keyword cType GiaAnalysis1534 1534 syn keyword cType HydrologyDCEfficientAnalysis 1535 1535 syn keyword cType HydrologyDCInefficientAnalysis -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r25941 r25942 441 441 StressbalanceRiftPenaltyThresholdEnum, 442 442 StressbalanceShelfDampeningEnum, 443 StressbalanceIsVzSolutionEnum,444 StressbalanceIsVelBCEnum,445 443 ThermalIsdrainicecolumnEnum, 446 444 ThermalIsdynamicbasalspcEnum, -
issm/trunk-jpl/src/m/classes/stressbalance.m
r25941 r25942 23 23 loadingforce = NaN; 24 24 requested_outputs = {}; 25 isvzsolution = NaN;26 isvelbc = NaN;27 25 end 28 26 methods … … 77 75 self.rift_penalty_lock=10; 78 76 79 %Set vertical velocity option80 self.isvzsolution = 0;81 self.isvelbc = 10.;82 83 77 %output default: 84 78 self.requested_outputs={'default'}; … … 102 96 md = checkfield(md,'fieldname','stressbalance.referential','size',[md.mesh.numberofvertices 6]); 103 97 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);106 98 md = checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1); 107 99 if ~any(isnan(md.stressbalance.vertex_pairing)), … … 166 158 fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset'); 167 159 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.');172 160 173 161 disp(sprintf('\n %s','Other:')); … … 199 187 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer'); 200 188 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);203 189 204 190 if size(self.loadingforce,2)==3,
Note:
See TracChangeset
for help on using the changeset viewer.