Ignore:
Timestamp:
05/21/10 14:51:20 (15 years ago)
Author:
Eric.Larour
Message:

New call to cores, starting to cleanup the results API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r3877 r3887  
    658658        double  dk[NDOF2];
    659659        double  dB[NDOF2];
    660         char*   control_type=NULL;
     660        int    control_type;
    661661        double  cm_noisedmp;
    662662
     
    700700
    701701                /*Add Tikhonov regularization term to misfit*/
    702                 if (strcmp(control_type,"drag")==0){
     702                if (control_type==DragCoefficientEnum){
    703703                        if (shelf){
    704704                                inputs->GetParameterDerivativeValue(&dk[0],&xyz_list[0][0],&gauss_l1l2l3[0],DragCoefficientEnum);
     
    707707                        }
    708708                }
    709                 else if (strcmp(control_type,"B")==0){
     709                else if (control_type==RheologyBEnum){
    710710                        inputs->GetParameterDerivativeValue(&dB[0], &xyz_list[0][0], &gauss_l1l2l3[0],RheologyBEnum);
    711711                        Jelem+=cm_noisedmp*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
    712712                }
    713713                else{
    714                         ISSMERROR("%s%s","unsupported control type: ",control_type);
     714                        ISSMERROR("%s%i","unsupported control type: ",control_type);
    715715                }
    716716
     
    721721        xfree((void**)&third_gauss_area_coord);
    722722        xfree((void**)&gauss_weights);
    723         xfree((void**)&control_type);
    724723
    725724        /*Return: */
     
    38313830/*}}}*/
    38323831/*FUNCTION Tria::Gradj {{{1*/
    3833 void  Tria::Gradj(Vec grad_g,int analysis_type,int sub_analysis_type,char* control_type){
     3832void  Tria::Gradj(Vec grad_g,int analysis_type,int sub_analysis_type,int control_type){
    38343833
    38353834        /*inputs: */
     
    38423841        if(onwater)return;
    38433842
    3844         if (strcmp(control_type,"drag")==0){
     3843        if (control_type==DragCoefficientEnum){
    38453844                GradjDrag( grad_g,analysis_type,sub_analysis_type);
    38463845        }
    3847         else if (strcmp(control_type,"B")==0){
     3846        else if (control_type==RheologyBEnum){
    38483847                GradjB( grad_g,analysis_type,sub_analysis_type);
    38493848        }
    3850         else ISSMERROR("%s%s","control type not supported yet: ",control_type);
     3849        else ISSMERROR("%s%i","control type not supported yet: ",control_type);
    38513850}
    38523851/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.