Changeset 20215
- Timestamp:
- 02/19/16 10:25:41 (9 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r20209 r20215 1886 1886 1887 1887 return new GaussPenta(area_coordinates,order_horiz,order_vert); 1888 } 1889 /*}}}*/ 1890 Gauss* Penta::NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order){/*{{{*/ 1891 return new GaussPenta(point1,fraction1,fraction2,mainlyfloating,order); 1888 1892 } 1889 1893 /*}}}*/ … … 2638 2642 IssmDouble Penta::TotalFloatingBmb(void){/*{{{*/ 2639 2643 2640 /*The fbmb[Gt yr-1] of one element is area[m2] * floating basal melt [ m ice yr^-1] * rho_ice [kg m-3] / 1e+10^12 */ 2641 IssmDouble base,fbmb,rho_ice; 2644 /*The fbmb[kg yr-1] of one element is area[m2] * melting_rate [kg m^-2 yr^-1]*/ 2645 int point1; 2646 bool mainlyfloating; 2647 IssmDouble fbmb=0; 2648 IssmDouble rho_ice,fraction1,fraction2,floatingmelt,Jdet; 2642 2649 IssmDouble Total_Fbmb=0; 2643 2650 IssmDouble xyz_list[NUMVERTICES][3]; 2651 Gauss* gauss = NULL; 2652 2653 if(!IsIceInElement() || !IsOnBase())return 0; 2644 2654 2645 2655 /*Get material parameters :*/ 2646 2656 rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum); 2647 2648 if(!IsIceInElement() || !IsOnBase()) return 0.; 2649 2657 Input* floatingmelt_input = this->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input); 2658 Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 2650 2659 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 2651 2660 2652 /*First calculate the area of the base (cross section triangle) 2653 * http://en.wikipedia.org/wiki/Triangle 2654 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/ 2655 base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1])); 2656 2657 /*Now get the average Floating melt rate over the element*/ 2658 Input* fbmb_input = inputs->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(fbmb_input); 2659 2660 fbmb_input->GetInputAverage(&fbmb); 2661 Total_Fbmb=rho_ice*base*fbmb;// floating melt rate on element in kg s-1 2661 this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 2662 /* Start looping on the number of gaussian points: */ 2663 gauss = this->NewGauss(point1,fraction1,fraction2,1-mainlyfloating,3); 2664 for(int ig=gauss->begin();ig<gauss->end();ig++){ 2665 2666 gauss->GaussPoint(ig); 2667 this->JacobianDeterminantBase(&Jdet,&xyz_list[0][0],gauss); 2668 floatingmelt_input->GetInputValue(&floatingmelt,gauss); 2669 fbmb+=floatingmelt*Jdet*gauss->weight; 2670 } 2671 2672 Total_Fbmb=rho_ice*fbmb; // from volume to mass 2662 2673 2663 2674 /*Return: */ 2675 delete gauss; 2664 2676 return Total_Fbmb; 2665 2677 } … … 2667 2679 IssmDouble Penta::TotalGroundedBmb(void){/*{{{*/ 2668 2680 2669 /*The grounded ice melting rate [Gt yr-1] of one element is area[m2] * grounded melt [ m ice yr^-1] * rho_ice [kg m-3] / 1e+10^12 */ 2670 IssmDouble base,gbmb,rho_ice; 2681 /*The gbmb[kg yr-1] of one element is area[m2] * gounded melting rate [kg m^-2 yr^-1]*/ 2682 int point1; 2683 bool mainlyfloating; 2684 IssmDouble gbmb=0; 2685 IssmDouble rho_ice,fraction1,fraction2,groundedmelt,Jdet; 2671 2686 IssmDouble Total_Gbmb=0; 2672 2687 IssmDouble xyz_list[NUMVERTICES][3]; 2688 Gauss* gauss = NULL; 2689 2690 if(!IsIceInElement() || !IsOnBase())return 0; 2673 2691 2674 2692 /*Get material parameters :*/ 2675 2693 rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum); 2676 2677 if(!IsIceInElement() || !IsOnBase()) return 0.; 2678 2694 Input* groundedmelt_input = this->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input); 2695 Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 2679 2696 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 2680 2697 2681 /*First calculate the area of the base (cross section triangle) 2682 * http://en.wikipedia.org/wiki/Triangle 2683 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/ 2684 base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1])); 2685 2686 /*Now get the average grounded melt over the element*/ 2687 Input* gbmb_input = inputs->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(gbmb_input); 2688 2689 gbmb_input->GetInputAverage(&gbmb); 2690 Total_Gbmb=rho_ice*base*gbmb;// grounded melt on element in kg s-1 2698 this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 2699 /* Start looping on the number of gaussian points: */ 2700 gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,3); 2701 for(int ig=gauss->begin();ig<gauss->end();ig++){ 2702 2703 gauss->GaussPoint(ig); 2704 this->JacobianDeterminantBase(&Jdet,&xyz_list[0][0],gauss); 2705 groundedmelt_input->GetInputValue(&groundedmelt,gauss); 2706 gbmb+=groundedmelt*Jdet*gauss->weight; 2707 } 2708 2709 Total_Gbmb=rho_ice*gbmb; // from volume to mass 2691 2710 2692 2711 /*Return: */ 2712 delete gauss; 2693 2713 return Total_Gbmb; 2694 2714 } -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r20209 r20215 120 120 Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order){_error_("not implemented yet");}; 121 121 Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert); 122 Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order) {_error_("not implemented yet");};122 Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order); 123 123 Gauss* NewGaussBase(int order); 124 124 Gauss* NewGaussLine(int vertex1,int vertex2,int order); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r20212 r20215 3091 3091 this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 3092 3092 /* Start looping on the number of gaussian points: */ 3093 gauss = this->NewGauss(point1,fraction1,fraction2,1-mainlyfloating, 2);3093 gauss = this->NewGauss(point1,fraction1,fraction2,1-mainlyfloating,3); 3094 3094 for(int ig=gauss->begin();ig<gauss->end();ig++){ 3095 3095 -
issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
r18521 r20215 287 287 } 288 288 this->weights[ig] = this->weights[ig]*r1*r2; 289 this->coords4=xNew<IssmDouble>(numgauss);290 for(ig=0;ig<numgauss;ig++) this->coords4[ig]=-1.0;291 }289 } 290 this->coords4=xNew<IssmDouble>(numgauss); 291 for(ig=0;ig<numgauss;ig++) this->coords4[ig]=-1.0; 292 292 } 293 293 else{ -
issm/trunk-jpl/test/NightlyRun/test208.py
r20209 r20215 14 14 md=setmask(md,'all','') 15 15 md=parameterize(md,'../Par/SquareShelf.py') 16 md.basalforcings.floatingice_melting_rate[:]=1. 16 17 md=setflowequation(md,'SSA','all') 17 18 md.cluster=generic('name',oshostname(),'np',3) 18 md.transient.requested_outputs=['default',' GroundedArea','TotalFloatingBmb','TotalGroundedBmb']19 md.transient.requested_outputs=['default','FloatingArea','GroundedArea','TotalFloatingBmb','TotalGroundedBmb'] 19 20 md=solve(md,TransientSolutionEnum()) 20 21 -
issm/trunk-jpl/test/NightlyRun/test317.m
r20209 r20215 3 3 md=setmask(md,'',''); 4 4 md=parameterize(md,'../Par/SquareSheetConstrained.par'); 5 md.basalforcings.groundedice_melting_rate(:)=5; 5 6 md=extrude(md,3,1.); 6 7 md=setflowequation(md,'HO','all'); -
issm/trunk-jpl/test/NightlyRun/test317.py
r20209 r20215 12 12 md=setmask(md,'','') 13 13 md=parameterize(md,'../Par/SquareSheetConstrained.py') 14 md.basalforcings.groundedice_melting_rate[:]=5. 14 15 md.extrude(3,1.) 15 16 md=setflowequation(md,'HO','all') -
issm/trunk-jpl/test/NightlyRun/test408.m
r20209 r20215 1 %Test Name: SquareSheetShelfTranSSA 2d1 %Test Name: SquareSheetShelfTranSSA3d 2 2 md=triangle(model(),'../Exp/Square.exp',150000.); 3 3 md=setmask(md,'../Exp/SquareShelf.exp',''); 4 4 md=parameterize(md,'../Par/SquareSheetShelf.par'); 5 md=extrude(md,3,1); 6 md.transient.isthermal=0; 5 7 md=setflowequation(md,'SSA','all'); 6 8 md.cluster=generic('name',oshostname(),'np',3); 7 md.transient.requested_outputs={'default','GroundedArea',' TotalFloatingBmb','TotalGroundedBmb'};9 md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'}; 8 10 md=solve(md,TransientSolutionEnum()); 9 11 10 12 %Fields and tolerances to track changes 11 field_names ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1',' TotalFloatingBmb1','TotalGroundedBmb1',...12 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2',' TotalFloatingBmb2','TotalGroundedBmb2',...13 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3',' TotalFloatingBmb3','TotalGroundedBmb3'};14 field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13, ...15 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13, ...16 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13 };13 field_names ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',... 14 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',... 15 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'}; 16 field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,... 17 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,... 18 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13}; 17 19 field_values={... 18 20 (md.results.TransientSolution(1).Vx),... … … 24 26 (md.results.TransientSolution(1).Thickness),... 25 27 (md.results.TransientSolution(1).GroundedArea),... 28 (md.results.TransientSolution(1).FloatingArea),... 26 29 (md.results.TransientSolution(1).TotalFloatingBmb),... 27 30 (md.results.TransientSolution(1).TotalGroundedBmb),... 31 (md.results.TransientSolution(1).TotalSmb),... 28 32 (md.results.TransientSolution(2).Vx),... 29 33 (md.results.TransientSolution(2).Vy),... … … 34 38 (md.results.TransientSolution(2).Thickness),... 35 39 (md.results.TransientSolution(2).GroundedArea),... 40 (md.results.TransientSolution(2).FloatingArea),... 36 41 (md.results.TransientSolution(2).TotalFloatingBmb),... 37 42 (md.results.TransientSolution(2).TotalGroundedBmb),... 43 (md.results.TransientSolution(2).TotalSmb),... 38 44 (md.results.TransientSolution(3).Vx),... 39 45 (md.results.TransientSolution(3).Vy),... … … 44 50 (md.results.TransientSolution(3).Thickness),... 45 51 (md.results.TransientSolution(3).GroundedArea),... 52 (md.results.TransientSolution(3).FloatingArea),... 46 53 (md.results.TransientSolution(3).TotalFloatingBmb),... 47 54 (md.results.TransientSolution(3).TotalGroundedBmb),... 55 (md.results.TransientSolution(3).TotalSmb),... 48 56 }; -
issm/trunk-jpl/test/NightlyRun/test408.py
r20209 r20215 13 13 md=setmask(md,'../Exp/SquareShelf.exp','') 14 14 md=parameterize(md,'../Par/SquareSheetShelf.py') 15 md=extrude(md,3,1.) 15 16 md=setflowequation(md,'SSA','all') 17 md.transient.isthermal=False 16 18 md.cluster=generic('name',oshostname(),'np',3) 17 md.transient.requested_outputs=['default','GroundedArea',' TotalFloatingBmb','TotalGroundedBmb']19 md.transient.requested_outputs=['default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'] 18 20 md=solve(md,TransientSolutionEnum()) 19 21 20 22 #Fields and tolerances to track changes 21 field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','TotalFloatingBmb1','TotalGroundedBmb1',' Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','TotalFloatingBmb2','TotalGroundedBmb2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','TotalFloatingBmb3','TotalGroundedBmb3']22 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13 ]23 field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'] 24 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13] 23 25 field_values=[\ 24 26 md.results.TransientSolution[0].Vx,\ … … 30 32 md.results.TransientSolution[0].Thickness,\ 31 33 md.results.TransientSolution[0].GroundedArea,\ 34 md.results.TransientSolution[0].FloatingArea,\ 32 35 md.results.TransientSolution[0].TotalFloatingBmb,\ 33 36 md.results.TransientSolution[0].TotalGroundedBmb,\ 37 md.results.TransientSolution[0].TotalSmb,\ 34 38 md.results.TransientSolution[1].Vx,\ 35 39 md.results.TransientSolution[1].Vy,\ … … 40 44 md.results.TransientSolution[1].Thickness,\ 41 45 md.results.TransientSolution[1].GroundedArea,\ 42 md.results.TransientSolution[2].TotalFloatingBmb,\ 43 md.results.TransientSolution[2].TotalGroundedBmb,\ 46 md.results.TransientSolution[1].FloatingArea,\ 47 md.results.TransientSolution[1].TotalFloatingBmb,\ 48 md.results.TransientSolution[1].TotalGroundedBmb,\ 49 md.results.TransientSolution[1].TotalSmb,\ 44 50 md.results.TransientSolution[2].Vx,\ 45 51 md.results.TransientSolution[2].Vy,\ … … 50 56 md.results.TransientSolution[2].Thickness,\ 51 57 md.results.TransientSolution[2].GroundedArea,\ 58 md.results.TransientSolution[2].FloatingArea,\ 52 59 md.results.TransientSolution[2].TotalFloatingBmb,\ 53 60 md.results.TransientSolution[2].TotalGroundedBmb,\ 61 md.results.TransientSolution[2].TotalSmb,\ 54 62 ] -
issm/trunk-jpl/test/NightlyRun/test433.m
r19529 r20215 40 40 41 41 md.groundingline.migration='SubelementMigration2'; 42 md.transient.isstressbalance=1; 43 md=setflowequation(md,'SSA','all'); 42 44 md=solve(md,TransientSolutionEnum()); 43 45 element_on_iceshelf_subelement2=(md.results.TransientSolution.MaskGroundediceLevelset);
Note:
See TracChangeset
for help on using the changeset viewer.