Changeset 20012
- Timestamp:
- 01/29/16 12:03:48 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r20007 r20012 3618 3618 3619 3619 if(computeelastic | computerigid){ 3620 int* indices=xNew<int>(gsize); 3621 IssmDouble* values=xNew<IssmDouble>(gsize); 3620 3622 for(int i=0;i<gsize;i++){ 3623 indices[i]=i; 3621 3624 3622 3625 IssmDouble alpha; … … 3652 3655 3653 3656 /*Add all components to the pSgi or pSgo solution vectors:*/ 3654 pSgi->SetValue(i,3*rho_ice/rho_earth*area/eartharea*I*(G_rigid+G_elastic),ADD_VAL); 3655 3656 } 3657 values[i]=3*rho_ice/rho_earth*area/eartharea*I*(G_rigid+G_elastic); 3658 } 3659 pSgi->SetValues(gsize,indices,values,ADD_VAL); 3660 3661 /*free ressources:*/ 3662 xDelete<IssmDouble>(values); 3663 xDelete<int>(indices); 3657 3664 } 3658 3665 … … 3693 3700 int M; 3694 3701 3702 /*optimization:*/ 3703 bool store_green_functions=false; 3704 3695 3705 /*ice properties: */ 3696 3706 IssmDouble rho_ice,rho_water,rho_earth; … … 3716 3726 this->parameters->FindParam(&computeelastic,SealevelriseElasticEnum); 3717 3727 this->parameters->FindParam(&computeeustatic,SealevelriseEustaticEnum); 3728 this->parameters->FindParam(&store_green_functions,SealevelriseStoreGreenFunctionsEnum); 3718 3729 3719 3730 /*early return if rigid or elastic not requested:*/ … … 3805 3816 } 3806 3817 3818 int* indices=xNew<int>(gsize); 3819 IssmDouble* values=xNewZeroInit<IssmDouble>(gsize); 3820 3807 3821 for(int i=0;i<gsize;i++){ 3808 3822 3823 indices[i]=i; 3809 3824 if(compute_G_elastic | compute_G_rigid){ 3810 3825 IssmDouble alpha; … … 3839 3854 3840 3855 /*Add all components to the pSgi or pSgo solution vectors:*/ 3841 if(computerigid)pSgo->SetValue(i,3*rho_water/rho_earth*area/eartharea*I*G_rigid[i],ADD_VAL); 3842 if(computeelastic)pSgo->SetValue(i,3*rho_water/rho_earth*area/eartharea*I*G_elastic[i],ADD_VAL); 3843 } 3856 if(computerigid)values[i]+=3*rho_water/rho_earth*area/eartharea*I*G_rigid[i]; 3857 if(computeelastic)values[i]+=3*rho_water/rho_earth*area/eartharea*I*G_elastic[i]; 3858 } 3859 3860 pSgo->SetValues(gsize,indices,values,ADD_VAL); 3861 3862 /*free ressources:*/ 3863 xDelete<IssmDouble>(values); 3864 xDelete<int>(indices); 3844 3865 3845 3866 /*Save G_rigid and G_elastic if computed:*/ 3846 if(G_rigid)this->inputs->AddInput(new DoubleArrayInput(SealevelriseGRigidEnum,G_rigid,gsize)); 3847 if(G_elastic)this->inputs->AddInput(new DoubleArrayInput(SealevelriseGElasticEnum,G_elastic,gsize)); 3867 if(store_green_functions){ 3868 if(G_rigid)this->inputs->AddInput(new DoubleArrayInput(SealevelriseGRigidEnum,G_rigid,gsize)); 3869 if(G_elastic)this->inputs->AddInput(new DoubleArrayInput(SealevelriseGElasticEnum,G_elastic,gsize)); 3870 } 3848 3871 3849 3872 /*Free ressources:*/
Note:
See TracChangeset
for help on using the changeset viewer.