Changeset 3887 for issm/trunk/src/c/objects/Elements/Tria.cpp
- Timestamp:
- 05/21/10 14:51:20 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r3877 r3887 658 658 double dk[NDOF2]; 659 659 double dB[NDOF2]; 660 char* control_type=NULL;660 int control_type; 661 661 double cm_noisedmp; 662 662 … … 700 700 701 701 /*Add Tikhonov regularization term to misfit*/ 702 if ( strcmp(control_type,"drag")==0){702 if (control_type==DragCoefficientEnum){ 703 703 if (shelf){ 704 704 inputs->GetParameterDerivativeValue(&dk[0],&xyz_list[0][0],&gauss_l1l2l3[0],DragCoefficientEnum); … … 707 707 } 708 708 } 709 else if ( strcmp(control_type,"B")==0){709 else if (control_type==RheologyBEnum){ 710 710 inputs->GetParameterDerivativeValue(&dB[0], &xyz_list[0][0], &gauss_l1l2l3[0],RheologyBEnum); 711 711 Jelem+=cm_noisedmp*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight; 712 712 } 713 713 else{ 714 ISSMERROR("%s% s","unsupported control type: ",control_type);714 ISSMERROR("%s%i","unsupported control type: ",control_type); 715 715 } 716 716 … … 721 721 xfree((void**)&third_gauss_area_coord); 722 722 xfree((void**)&gauss_weights); 723 xfree((void**)&control_type);724 723 725 724 /*Return: */ … … 3831 3830 /*}}}*/ 3832 3831 /*FUNCTION Tria::Gradj {{{1*/ 3833 void Tria::Gradj(Vec grad_g,int analysis_type,int sub_analysis_type, char*control_type){3832 void Tria::Gradj(Vec grad_g,int analysis_type,int sub_analysis_type,int control_type){ 3834 3833 3835 3834 /*inputs: */ … … 3842 3841 if(onwater)return; 3843 3842 3844 if ( strcmp(control_type,"drag")==0){3843 if (control_type==DragCoefficientEnum){ 3845 3844 GradjDrag( grad_g,analysis_type,sub_analysis_type); 3846 3845 } 3847 else if ( strcmp(control_type,"B")==0){3846 else if (control_type==RheologyBEnum){ 3848 3847 GradjB( grad_g,analysis_type,sub_analysis_type); 3849 3848 } 3850 else ISSMERROR("%s% s","control type not supported yet: ",control_type);3849 else ISSMERROR("%s%i","control type not supported yet: ",control_type); 3851 3850 } 3852 3851 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.