Changeset 6969
- Timestamp:
- 01/06/11 11:13:40 (14 years ago)
- Location:
- issm/trunk/src/c/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r6953 r6969 4737 4737 for(i=0;i<numdof2d;i++){ 4738 4738 values[i] =solution[doflist[i]]; 4739 if(isnan(values[i])) _error_("NaN found in solution vector"); 4740 /*Constrain thickness to be at least 1m*/ 4741 if(values[i]<1) values[i]=1; 4739 4742 values[i+numdof2d]=values[i]; 4740 if(isnan(values[i])) _error_("NaN found in solution vector");4741 4743 } 4742 4744 … … 4749 4751 surface_input->GetValuesPtr(&surface_ptr,&dummy); 4750 4752 4751 /*If shelf: hydrostatic equilibrium*/ 4752 if (this->IsOnShelf()){ 4753 4754 /*Fing HydrostaticAdjustment to figure out how to update the geometry:*/ 4755 this->parameters->FindParam(&hydroadjustment,HydrostaticAdjustmentEnum); 4756 4757 /*recover material parameters: */ 4758 rho_ice=matpar->GetRhoIce(); 4759 rho_water=matpar->GetRhoWater(); 4760 4761 if(hydroadjustment==AbsoluteEnum){ 4762 for(i=0;i<numdof;i++) { 4763 surface[i]=values[i]*(1-rho_ice/rho_water); 4764 bed[i]=-values[i]*rho_ice/rho_water; 4753 /*Fing HydrostaticAdjustment to figure out how to update the geometry:*/ 4754 this->parameters->FindParam(&hydroadjustment,HydrostaticAdjustmentEnum); 4755 4756 /*recover material parameters: */ 4757 rho_ice=matpar->GetRhoIce(); 4758 rho_water=matpar->GetRhoWater(); 4759 4760 for(i=0;i<numdof;i++) { 4761 /*If shelf: hydrostatic equilibrium*/ 4762 if (this->nodes[i]->IsOnSheet()){ 4763 surface[i]=bed_ptr[i]+values[i]; //surface=oldbed+newthickness 4764 bed[i]=bed_ptr[i]; //bed does not change 4765 } 4766 else{ //so it is an ice shelf 4767 if(hydroadjustment==AbsoluteEnum){ 4768 surface[i]=values[i]*(1-rho_ice/rho_water); 4769 bed[i]=values[i]*(-rho_ice/rho_water); 4765 4770 } 4766 } 4767 else if(hydroadjustment==IncrementalEnum){ 4768 for(i=0;i<numdof;i++) { 4769 surface[i]=surface_ptr[i]+(1.0-rho_ice/rho_water)*(values[i]-thickness_ptr[i]); //surface = oldsurface + (1-di) * dH 4770 bed[i]=bed_ptr[i]-rho_ice/rho_water*(values[i]-thickness_ptr[i]); //bed = oldbed + di * dH 4771 else if(hydroadjustment==IncrementalEnum){ 4772 surface[i]=surface_ptr[i]+(1.0-rho_ice/rho_water)*(values[i]-thickness_ptr[i]); //surface = oldsurface + (1-di) * dH 4773 bed[i]=bed_ptr[i]-rho_ice/rho_water*(values[i]-thickness_ptr[i]); //bed = oldbed + di * dH 4771 4774 } 4772 } 4773 else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToString(hydroadjustment)); 4774 } 4775 4776 /*If sheet: surface = bed + thickness*/ 4777 else{ 4778 /*Now Compute surface only*/ 4779 for(i=0;i<numdof;i++) { 4780 surface[i]=bed_ptr[i]+values[i]; //surface=oldbed+newthickness 4775 else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToString(hydroadjustment)); 4781 4776 } 4782 4777 } … … 4788 4783 penta->inputs->AddInput(new PentaVertexInput(ThicknessEnum,values)); 4789 4784 penta->inputs->AddInput(new PentaVertexInput(SurfaceEnum,surface)); 4790 if (penta->IsOnShelf())penta->inputs->AddInput(new PentaVertexInput(BedEnum,bed));4785 penta->inputs->AddInput(new PentaVertexInput(BedEnum,bed)); 4791 4786 4792 4787 /*Stop if we have reached the surface*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r6953 r6969 3958 3958 values[i]=solution[doflist[i]]; 3959 3959 if(isnan(values[i])) _error_("NaN found in solution vector"); 3960 /*Constrain thickness to be at least 1m*/ 3961 if(values[i]<1) values[i]=1; 3960 3962 } 3961 3963 … … 3968 3970 surface_input->GetValuesPtr(&surface_ptr,&dummy); 3969 3971 3970 /*If shelf: hydrostatic equilibrium*/ 3971 if (this->IsOnShelf()){ 3972 3973 /*Fing HydrostaticAdjustment to figure out how to update the geometry:*/ 3974 this->parameters->FindParam(&hydroadjustment,HydrostaticAdjustmentEnum); 3975 3976 /*recover material parameters: */ 3977 rho_ice=matpar->GetRhoIce(); 3978 rho_water=matpar->GetRhoWater(); 3979 3980 if(hydroadjustment==AbsoluteEnum){ 3981 for(i=0;i<numdof;i++) { 3972 /*Fing HydrostaticAdjustment to figure out how to update the geometry:*/ 3973 this->parameters->FindParam(&hydroadjustment,HydrostaticAdjustmentEnum); 3974 3975 /*recover material parameters: */ 3976 rho_ice=matpar->GetRhoIce(); 3977 rho_water=matpar->GetRhoWater(); 3978 3979 for(i=0;i<numdof;i++) { 3980 /*If shelf: hydrostatic equilibrium*/ 3981 if (this->nodes[i]->IsOnSheet()){ 3982 surface[i]=bed_ptr[i]+values[i]; //surface=oldbed+newthickness 3983 } 3984 else{ //this is an ice shelf 3985 3986 if(hydroadjustment==AbsoluteEnum){ 3982 3987 surface[i]=values[i]*(1-rho_ice/rho_water); 3983 bed[i]=-values[i]*rho_ice/rho_water;3984 3988 } 3985 } 3986 else if(hydroadjustment==IncrementalEnum){ 3987 for(i=0;i<numdof;i++) { 3989 else if(hydroadjustment==IncrementalEnum){ 3988 3990 surface[i]=surface_ptr[i]+(1.0-rho_ice/rho_water)*(values[i]-thickness_ptr[i]); //surface = oldsurface + (1-di) * dH 3989 3991 bed[i]=bed_ptr[i]-rho_ice/rho_water*(values[i]-thickness_ptr[i]); //bed = oldbed + di * dH 3990 3992 } 3991 } 3992 else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToString(hydroadjustment)); 3993 } 3994 3995 /*If sheet: surface = bed + thickness*/ 3996 else{ 3997 /*Now Compute surface only*/ 3998 for(i=0;i<numdof;i++) { 3999 surface[i]=bed_ptr[i]+values[i]; //surface=oldbed+newthickness 3993 else _error_("Hydrostatic adjustment %i (%s) not supported yet",hydroadjustment,EnumToString(hydroadjustment)); 4000 3994 } 4001 3995 }
Note:
See TracChangeset
for help on using the changeset viewer.