Changeset 27489
- Timestamp:
- 01/01/23 07:32:41 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Loads/Friction.cpp
r27478 r27489 34 34 * There are exceptions, e.g. HO, which needs the user to specify the dimension used in Friciton.*/ 35 35 36 /*Intermediaries*/ 37 int linearization_type; 38 36 39 this->element=element_in; 37 40 this->linearize = 0; … … 65 68 66 69 if(this->law==1){ 67 element_in->FindParam(&this->linearize,FrictionLinearizeEnum); 68 if(this->linearize){ 69 this->linearize = 0; /*Change to make sure we do the calculation once*/ 70 element_in->FindParam(&linearization_type,FrictionLinearizeEnum); 71 if(linearization_type==0){ 72 /*Don't do anything*/ 73 } 74 else if(linearization_type==1){ 70 75 int numvertices = this->element->GetNumberOfVertices(); 71 76 this->alpha2_list = xNew<IssmDouble>(numvertices); … … 75 80 gauss->GaussVertex(iv); 76 81 this->GetAlpha2(&this->alpha2_list[iv], gauss); 77 IssmDouble temp = 0.;78 this->GetAlpha2(&temp, gauss);79 82 this->GetAlphaComplement(&this->alpha2_complement_list[iv], gauss); 80 83 } 81 this->linearize = 1; /*Change back, we are now all set!*/ 84 this->linearize = linearization_type; /*Change back, we are now all set!*/ 85 delete gauss; 86 } 87 else if(linearization_type==2){ 88 this->alpha2_list = xNew<IssmDouble>(1); 89 this->alpha2_complement_list = xNew<IssmDouble>(1); 90 Gauss* gauss=element->NewGauss(1); gauss->GaussPoint(0); 91 this->GetAlpha2(&this->alpha2_list[0], gauss); 92 this->GetAlphaComplement(&this->alpha2_complement_list[0], gauss); 93 this->linearize = linearization_type; /*Change back, we are now all set!*/ 94 delete gauss; 95 } 96 else{ 97 _error_("not supported yet"); 82 98 } 83 99 } … … 94 110 Friction::~Friction(){/*{{{*/ 95 111 if(this->linearize){ 96 printf("linearize = %i\n",this->linearize);97 112 xDelete<IssmDouble>(this->alpha2_list); 98 113 xDelete<IssmDouble>(this->alpha2_complement_list); … … 111 126 switch(this->law){ 112 127 case 1: 113 GetAlphaViscousComplement(palpha_complement,gauss); 128 if(this->linearize==0){ 129 GetAlphaViscousComplement(palpha_complement,gauss); 130 } 131 else if(this->linearize==1){ 132 this->element->ValueP1OnGauss(palpha_complement, this->alpha2_complement_list, gauss); 133 } 134 else if(this->linearize==2){ 135 *palpha_complement = this->alpha2_complement_list[0]; 136 } 137 else{ 138 _error_("not supported yet"); 139 } 140 break; 114 141 break; 115 142 case 2: … … 333 360 switch(this->law){ 334 361 case 1: 335 if(this->linearize){ 362 if(this->linearize==0){ 363 GetAlpha2Viscous(palpha2,gauss); 364 } 365 else if(this->linearize==1){ 336 366 this->element->ValueP1OnGauss(palpha2, this->alpha2_list, gauss); 337 367 } 368 else if(this->linearize==2){ 369 *palpha2 = this->alpha2_list[0]; 370 } 338 371 else{ 339 GetAlpha2Viscous(palpha2,gauss);372 _error_("not supported yet"); 340 373 } 341 374 break; … … 1288 1321 switch(frictionlaw){ 1289 1322 case 1: 1290 //parameters->AddObject(iomodel->CopyConstantObject("md.friction.linearize",FrictionLinearizeEnum));1323 parameters->AddObject(iomodel->CopyConstantObject("md.friction.linearize",FrictionLinearizeEnum)); 1291 1324 parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum)); 1292 1325 parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
Note:
See TracChangeset
for help on using the changeset viewer.