Changeset 2354


Ignore:
Timestamp:
09/29/09 15:45:11 (15 years ago)
Author:
Mathieu Morlighem
Message:

moved maxontrolconstraint to cm_max and same thing for min + added dampening fields

Location:
issm/trunk/src
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ControlConstrainx/ControlConstrainx.cpp

    r1046 r2354  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void ControlConstrainx( double* p_g, int numdofnodes, double mincontrolconstraint, double maxcontrolconstraint,char* control_type){
     15void ControlConstrainx( double* p_g, int numdofnodes, double cm_min, double cm_max,char* control_type){
    1616
    1717        int i;
    1818       
    19         if(isnan(mincontrolconstraint) & isnan(maxcontrolconstraint)){
     19        if(isnan(cm_min) & isnan(cm_max)){
    2020                /*do nothing*/
    2121        }
     
    2323                for(i=0;i<numdofnodes;i++){
    2424
    25                         if(!isnan(mincontrolconstraint)){
    26                                 if (p_g[i]<mincontrolconstraint)p_g[i]=mincontrolconstraint;
     25                        if(!isnan(cm_min)){
     26                                if (p_g[i]<cm_min)p_g[i]=cm_min;
    2727                        }
    2828
    29                         if(!isnan(maxcontrolconstraint)){
    30                                 if (p_g[i]>maxcontrolconstraint)p_g[i]=maxcontrolconstraint;
     29                        if(!isnan(cm_max)){
     30                                if (p_g[i]>cm_max)p_g[i]=cm_max;
    3131                        }
    3232                }
  • issm/trunk/src/c/ControlConstrainx/ControlConstrainx.h

    r1046 r2354  
    99
    1010/* local prototypes: */
    11 void ControlConstrainx( double* p_g, int numberofnodes, double mincontrolconstraint, double maxcontrolconstraint,char* control_type);
     11void ControlConstrainx( double* p_g, int numberofnodes, double cm_min, double cm_max,char* control_type);
    1212
    1313#endif  /* _CONTROLCONSTRAINX_H */
  • issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp

    r2341 r2354  
    8787                parameters->AddObject(param);
    8888
     89                /*epsvel: */
     90                count++;
     91                param= new Param(count,"epsvel",DOUBLE);
     92                param->SetDouble(iomodel->epsvel);
     93                parameters->AddObject(param);
     94
     95                /*meanvel: */
     96                count++;
     97                param= new Param(count,"meanvel",DOUBLE);
     98                param->SetDouble(iomodel->meanvel);
     99                parameters->AddObject(param);
     100
     101                /*cm_noisedmp: */
     102                count++;
     103                param= new Param(count,"cm_noisedmp",DOUBLE);
     104                param->SetDouble(iomodel->cm_noisedmp);
     105                parameters->AddObject(param);
     106
     107                /*cm_mindmp_value: */
     108                count++;
     109                param= new Param(count,"cm_mindmp_value",DOUBLE);
     110                param->SetDouble(iomodel->cm_mindmp_value);
     111                parameters->AddObject(param);
     112
     113                /*cm_mindmp_slope: */
     114                count++;
     115                param= new Param(count,"cm_mindmp_slope",DOUBLE);
     116                param->SetDouble(iomodel->cm_mindmp_slope);
     117                parameters->AddObject(param);
     118
     119                /*cm_maxdmp_value: */
     120                count++;
     121                param= new Param(count,"cm_maxdmp_value",DOUBLE);
     122                param->SetDouble(iomodel->cm_maxdmp_value);
     123                parameters->AddObject(param);
     124
     125                /*cm_maxdmp_slope: */
     126                count++;
     127                param= new Param(count,"cm_maxdmp_slope",DOUBLE);
     128                param->SetDouble(iomodel->cm_maxdmp_slope);
     129                parameters->AddObject(param);
    89130               
    90                 /*mincontrolconstraint: */
    91                 count++;
    92                 param= new Param(count,"mincontrolconstraint",DOUBLE);
    93                 param->SetDouble(iomodel->mincontrolconstraint);
    94                 parameters->AddObject(param);
    95 
    96                 /*maxcontrolconstraint: */
    97                 count++;
    98                 param= new Param(count,"maxcontrolconstraint",DOUBLE);
    99                 param->SetDouble(iomodel->maxcontrolconstraint);
    100                 parameters->AddObject(param);
    101                
    102                                
    103                
     131                /*cm_min: */
     132                count++;
     133                param= new Param(count,"cm_min",DOUBLE);
     134                param->SetDouble(iomodel->cm_min);
     135                parameters->AddObject(param);
     136
     137                /*cm_max: */
     138                count++;
     139                param= new Param(count,"cm_max",DOUBLE);
     140                param->SetDouble(iomodel->cm_max);
     141                parameters->AddObject(param);
     142
    104143                /*Now, recover fit, optscal and maxiter as vectors: */
    105144                IoModelFetchData(&iomodel->fit,NULL,NULL,iomodel_handle,"fit");
  • issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp

    r2343 r2354  
    205205        parameters->AddObject(param);
    206206
    207         /*meanvel: */
    208         count++;
    209         param= new Param(count,"meanvel",DOUBLE);
    210         param->SetDouble(iomodel->meanvel);
    211         parameters->AddObject(param);
    212 
    213         /*cm_noisedampening: */
    214         count++;
    215         param= new Param(count,"cm_noisedampening",DOUBLE);
    216         param->SetDouble(iomodel->cm_noisedampening);
    217         parameters->AddObject(param);
    218 
    219         /*epsvel: */
    220         count++;
    221         param= new Param(count,"epsvel",DOUBLE);
    222         param->SetDouble(iomodel->epsvel);
    223         parameters->AddObject(param);
    224 
    225207        /*waitonlock: */
    226208        count++;
     
    262244        parameters->AddObject(param);
    263245        xfree((void**)&iomodel->riftinfo);
    264        
    265246       
    266247        /*parameteroutput: */
  • issm/trunk/src/c/ModelProcessorx/IoModel.cpp

    r2333 r2354  
    116116        iomodel->tolx=0;
    117117        iomodel->maxiter=NULL;
    118         iomodel->cm_noisedampening=0;
    119         iomodel->mincontrolconstraint=0;
    120         iomodel->maxcontrolconstraint=0;
     118        iomodel->cm_noisedmp=0;
     119        iomodel->cm_mindmp_value=0;
     120        iomodel->cm_mindmp_slope=0;
     121        iomodel->cm_maxdmp_value=0;
     122        iomodel->cm_maxdmp_slope=0;
     123        iomodel->cm_min=0;
     124        iomodel->cm_max=0;
    121125        iomodel->verbose=0;
    122126        iomodel->plot=0;
     
    336340        IoModelFetchData(&iomodel->eps_cm,iomodel_handle,"eps_cm");
    337341        IoModelFetchData(&iomodel->tolx,iomodel_handle,"tolx");
    338         IoModelFetchData(&iomodel->cm_noisedampening,iomodel_handle,"cm_noisedampening");
    339         IoModelFetchData(&iomodel->mincontrolconstraint,iomodel_handle,"mincontrolconstraint");
    340         IoModelFetchData(&iomodel->maxcontrolconstraint,iomodel_handle,"maxcontrolconstraint");
     342        IoModelFetchData(&iomodel->cm_noisedmp,iomodel_handle,"cm_noisedmp");
     343        IoModelFetchData(&iomodel->cm_mindmp_value,iomodel_handle,"cm_mindmp_value");
     344        IoModelFetchData(&iomodel->cm_mindmp_slope,iomodel_handle,"cm_mindmp_slope");
     345        IoModelFetchData(&iomodel->cm_maxdmp_value,iomodel_handle,"cm_maxdmp_value");
     346        IoModelFetchData(&iomodel->cm_maxdmp_slope,iomodel_handle,"cm_maxdmp_slope");
     347        IoModelFetchData(&iomodel->cm_min,iomodel_handle,"cm_min");
     348        IoModelFetchData(&iomodel->cm_max,iomodel_handle,"cm_max");
    341349        IoModelFetchData(&iomodel->eps_res,iomodel_handle,"eps_res");
    342350        IoModelFetchData(&iomodel->eps_rel,iomodel_handle,"eps_rel");
  • issm/trunk/src/c/ModelProcessorx/IoModel.h

    r2333 r2354  
    104104        /*numerical parameters: */
    105105        double  meanvel;
    106         double  epsvel;
     106        double  epsvel;
    107107        int     artdiff;
    108108        double  viscosity_overshoot;
    109109        double  stokesreconditioning;
     110        double  cm_noisedmp;
     111        double  cm_mindmp_value;
     112        double  cm_mindmp_slope;
     113        double  cm_maxdmp_value;
     114        double  cm_maxdmp_slope;
     115        double  cm_min;
     116        double  cm_max;
     117
    110118        double  cm_noisedampening;
    111119
     
    121129        double  tolx;
    122130        double* maxiter;
    123         double  mincontrolconstraint;
    124         double  maxcontrolconstraint;
    125131        int     verbose;
    126132        int     plot;
  • issm/trunk/src/c/objects/Numpar.cpp

    r2347 r2354  
    3232        stokesreconditioning=UNDEF;
    3333        control_type=NULL;
    34         cm_noisedampening=UNDEF;
     34        cm_noisedmp=UNDEF;
     35        cm_mindmp_value=UNDEF;
     36        cm_mindmp_slope=UNDEF;
     37        cm_maxdmp_value=UNDEF;
     38        cm_maxdmp_slope=UNDEF;
    3539
    3640        return;
     
    5357        printf("   stokesreconditioning: %g\n",stokesreconditioning);
    5458        printf("   control_type: %s\n",control_type);
    55         printf("   cm_noisedampening: %g\n",cm_noisedampening);
     59        printf("   cm_noisedmp: %g\n",cm_noisedmp);
     60        printf("   cm_mindmp_value: %g\n",cm_mindmp_value);
     61        printf("   cm_mindmp_slope: %g\n",cm_mindmp_slope);
     62        printf("   cm_maxdmp_value: %g\n",cm_maxdmp_value);
     63        printf("   cm_maxdmp_slope: %g\n",cm_maxdmp_slope);
    5664}
    5765
     
    6876        printf("   stokesreconditioning: %g\n",stokesreconditioning);
    6977        printf("   control_type: %s\n",control_type);
    70         printf("   cm_noisedampening: %g\n",cm_noisedampening);
     78        printf("   cm_noisedmp: %g\n",cm_noisedmp);
     79        printf("   cm_mindmp_value: %g\n",cm_mindmp_value);
     80        printf("   cm_mindmp_slope: %g\n",cm_mindmp_slope);
     81        printf("   cm_maxdmp_value: %g\n",cm_maxdmp_value);
     82        printf("   cm_maxdmp_slope: %g\n",cm_maxdmp_slope);
    7183}
    7284
     
    94106        memcpy(marshalled_dataset,&stokesreconditioning,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
    95107        memcpy(marshalled_dataset,&control_type,sizeof(control_type));marshalled_dataset+=sizeof(control_type);
    96         memcpy(marshalled_dataset,&cm_noisedampening,sizeof(cm_noisedampening));marshalled_dataset+=sizeof(cm_noisedampening);
     108        memcpy(marshalled_dataset,&cm_noisedmp,sizeof(cm_noisedmp));marshalled_dataset+=sizeof(cm_noisedmp);
     109        memcpy(marshalled_dataset,&cm_mindmp_value,sizeof(cm_mindmp_value));marshalled_dataset+=sizeof(cm_mindmp_value);
     110        memcpy(marshalled_dataset,&cm_mindmp_slope,sizeof(cm_mindmp_slope));marshalled_dataset+=sizeof(cm_mindmp_slope);
     111        memcpy(marshalled_dataset,&cm_maxdmp_value,sizeof(cm_maxdmp_value));marshalled_dataset+=sizeof(cm_maxdmp_value);
     112        memcpy(marshalled_dataset,&cm_maxdmp_slope,sizeof(cm_maxdmp_slope));marshalled_dataset+=sizeof(cm_maxdmp_slope);
    97113       
    98114        *pmarshalled_dataset=marshalled_dataset;
     
    108124                +sizeof(stokesreconditioning)
    109125                +sizeof(control_type)
    110                 +sizeof(cm_noisedampening)
     126                +sizeof(cm_noisedmp)
     127                +sizeof(cm_mindmp_value)
     128                +sizeof(cm_mindmp_slope)
     129                +sizeof(cm_maxdmp_value)
     130                +sizeof(cm_maxdmp_slope)
    111131                +sizeof(int); //sizeof(int) for enum type
    112132}
     
    134154        memcpy(&stokesreconditioning,marshalled_dataset,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
    135155        memcpy(&control_type,marshalled_dataset,sizeof(control_type));marshalled_dataset+=sizeof(control_type);
    136         memcpy(&cm_noisedampening,marshalled_dataset,sizeof(cm_noisedampening));marshalled_dataset+=sizeof(cm_noisedampening);
     156        memcpy(&cm_noisedmp,marshalled_dataset,sizeof(cm_noisedmp));marshalled_dataset+=sizeof(cm_noisedmp);
     157        memcpy(&cm_mindmp_value,marshalled_dataset,sizeof(cm_mindmp_value));marshalled_dataset+=sizeof(cm_mindmp_value);
     158        memcpy(&cm_mindmp_slope,marshalled_dataset,sizeof(cm_mindmp_slope));marshalled_dataset+=sizeof(cm_mindmp_slope);
     159        memcpy(&cm_maxdmp_value,marshalled_dataset,sizeof(cm_maxdmp_value));marshalled_dataset+=sizeof(cm_maxdmp_value);
     160        memcpy(&cm_maxdmp_slope,marshalled_dataset,sizeof(cm_maxdmp_slope));marshalled_dataset+=sizeof(cm_maxdmp_slope);
    137161
    138162        /*return: */
     
    164188        /*Go through parameters dataset, and find the Param object corresponding to our fields,
    165189         * and update the fields: */
    166         if(!parameters->FindParam(&meanvel,"meanvel"))throw ErrorException(__FUNCT__," error message: could not update meanvel field");
    167         if(!parameters->FindParam(&epsvel,"epsvel"))throw ErrorException(__FUNCT__," error message: could not update epsvel field");
     190        parameters->FindParam(&meanvel,"meanvel");
     191        parameters->FindParam(&epsvel,"epsvel");
    168192        if(!parameters->FindParam(&artdiff,"artdiff"))throw ErrorException(__FUNCT__," error message: could not update artdiff field");
    169193        if(!parameters->FindParam(&viscosity_overshoot,"viscosity_overshoot"))throw ErrorException(__FUNCT__," error message: could not update viscosity_overshoot field");
    170194        if(!parameters->FindParam(&stokesreconditioning,"stokesreconditioning"))throw ErrorException(__FUNCT__," error message: could not update stokesreconditioning field");
    171195        parameters->FindParam(&control_type,"control_type");
    172         if(!parameters->FindParam(&cm_noisedampening,"cm_noisedampening"))throw ErrorException(__FUNCT__," error message: could not update cm_noisedampening field");
     196        parameters->FindParam(&cm_noisedmp,"cm_noisedmp");
     197        parameters->FindParam(&cm_mindmp_value,"cm_mindmp_value");
     198        parameters->FindParam(&cm_mindmp_slope,"cm_mindmp_slope");
     199        parameters->FindParam(&cm_maxdmp_value,"cm_maxdmp_value");
     200        parameters->FindParam(&cm_maxdmp_slope,"cm_maxdmp_slope");
    173201
    174202        return;
     
    192220        inputs->Recover("stokesreconditioning",&stokesreconditioning);
    193221        inputs->Recover("control_type",&control_type);
    194         inputs->Recover("cm_noisedampening",&cm_noisedampening);
     222        inputs->Recover("cm_noisedmp",&cm_noisedmp);
     223        inputs->Recover("cm_mindmp_value",&cm_mindmp_value);
     224        inputs->Recover("cm_mindmp_slope",&cm_mindmp_slope);
     225        inputs->Recover("cm_maxdmp_value",&cm_maxdmp_value);
     226        inputs->Recover("cm_maxdmp_slope",&cm_maxdmp_slope);
    195227
    196228}
  • issm/trunk/src/c/objects/Numpar.h

    r2347 r2354  
    2222                double stokesreconditioning;
    2323                char*  control_type;
    24                 double cm_noisedampening;
     24                double cm_noisedmp;
     25                double cm_mindmp_value;
     26                double cm_mindmp_slope;
     27                double cm_maxdmp_value;
     28                double cm_maxdmp_slope;
    2529
    2630                Numpar();
  • issm/trunk/src/c/objects/Tria.cpp

    r2350 r2354  
    23962396                        grade_g_gaussian[i]=
    23972397                          -2*drag*alpha_complement*((lambda*vx+mu*vy))*Jdet*gauss_weight*l1l2l3[i]                         //standard term dJ/dki
    2398                           -numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);  // regularization term d/dki(1/2*(dk/dx)^2)
     2398                          -numpar->cm_noisedmp*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);  // regularization term d/dki(1/2*(dk/dx)^2)
    23992399                }
    24002400               
     
    26192619
    26202620                        //Add regularization term
    2621                         grade_g_gaussian[i]-=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
     2621                        grade_g_gaussian[i]-=numpar->cm_noisedmp*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
    26222622                }
    26232623
     
    28092809
    28102810                        //Add regularization term
    2811                         grade_g_gaussian[i]-=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
     2811                        grade_g_gaussian[i]-=numpar->cm_noisedmp*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
    28122812                }
    28132813
     
    29672967                        if (!shelf){
    29682968                                GetParameterDerivativeValue(&dk[0], &k[0],&xyz_list[0][0], gauss_l1l2l3);
    2969                                 Jelem+=numpar->cm_noisedampening*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight;
     2969                                Jelem+=numpar->cm_noisedmp*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight;
    29702970                        }
    29712971                }
     
    29752975                        }
    29762976                        GetParameterDerivativeValue(&dB[0], &B[0],&xyz_list[0][0], gauss_l1l2l3);
    2977                         Jelem+=numpar->cm_noisedampening*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
     2977                        Jelem+=numpar->cm_noisedmp*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
    29782978                }
    29792979                else{
  • issm/trunk/src/c/parallel/control_core.cpp

    r2333 r2354  
    4040        Vec     grad_g_old=NULL;
    4141        double* grad_g_double=NULL;
    42         double  mincontrolconstraint;
    43         double  maxcontrolconstraint;
     42        double  cm_min;
     43        double  cm_max;
    4444        int     nsteps,n,i;
    4545        double* J=NULL;
     
    6969        model->FindParam(&eps_cm,"eps_cm");
    7070        model->FindParam(&tolx,"tolx");
    71         model->FindParam(&mincontrolconstraint,"mincontrolconstraint");
    72         model->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
     71        model->FindParam(&cm_min,"cm_min");
     72        model->FindParam(&cm_max,"cm_max");
    7373        model->FindParam(&param_g,NULL,NULL,"param_g");
    7474        model->FindParam(&analysis_type,"analysis_type");
     
    134134
    135135                _printf_("%s\n","      constraining the new distribution...");   
    136                 ControlConstrainx(param_g,numberofnodes,mincontrolconstraint,maxcontrolconstraint,control_type);
     136                ControlConstrainx(param_g,numberofnodes,cm_min,cm_max,control_type);
    137137                _printf_("%s\n","      done.");
    138138               
  • issm/trunk/src/c/parallel/diagnostic.cpp

    r2333 r2354  
    4444        int      count;
    4545        DataSet* parameters=NULL;
    46         double cm_noisedampening;
    4746
    4847        MODULEBOOT();
     
    10099        inputs->Add("velocity",u_g_initial,3,numberofnodes);
    101100        if(control_analysis){
    102                 model->FindParam(&cm_noisedampening,"cm_noisedampening");
    103                 inputs->Add("cm_noisedampening",cm_noisedampening);
    104101                model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    105102                inputs->Add("velocity_obs",u_g_obs,2,numberofnodes);
  • issm/trunk/src/c/parallel/objectivefunctionC.cpp

    r2333 r2354  
    3535        double* optscal=NULL;
    3636        double* fit=NULL;
    37         double  mincontrolconstraint;
    38         double  maxcontrolconstraint;
     37        double  cm_min;
     38        double  cm_max;
    3939        char*   control_type=NULL;
    4040        double* param_g_copy=NULL;
     
    6767        femmodel->parameters->FindParam(&optscal,NULL,NULL,"optscal");
    6868        femmodel->parameters->FindParam(&fit,NULL,NULL,"fit");
    69         femmodel->parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint");
    70         femmodel->parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
     69        femmodel->parameters->FindParam(&cm_min,"cm_min");
     70        femmodel->parameters->FindParam(&cm_max,"cm_max");
    7171        femmodel->parameters->FindParam(&control_type,"control_type");
    7272        femmodel->parameters->FindParam(&analysis_type,"analysis_type");
     
    8585
    8686        /*Constrain:*/
    87         ControlConstrainx(param_g_copy,numberofnodes,mincontrolconstraint,maxcontrolconstraint,control_type);
     87        ControlConstrainx(param_g_copy,numberofnodes,cm_min,cm_max,control_type);
    8888
    8989        /*Add new parameter to inputs: */
  • issm/trunk/src/c/parallel/steadystate.cpp

    r2333 r2354  
    4545        double* u_g_obs=NULL;
    4646        double  dt;
    47         double  cm_noisedampening;
    4847        Param*  param=NULL;
    4948
     
    110109
    111110        if(control_analysis){
    112                 model->FindParam(&cm_noisedampening,"cm_noisedampening");
    113                 inputs->Add("cm_noisedampening",cm_noisedampening);
    114111                model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    115112                inputs->Add("velocity_obs",u_g_obs,2,numberofnodes);
  • issm/trunk/src/m/classes/@model/model.m

    r2352 r2354  
    189189        md.tolx=0;
    190190        md.optscal=[];
    191         md.cm_noisedampening=0;
    192         md.cm_mindampening=[];
    193         md.cm_maxdampening=[];
    194         md.mincontrolconstraint=0;
    195         md.maxcontrolconstraint=0;
     191        md.cm_noisedmp=0;
     192        md.cm_mindmp_value=0;
     193        md.cm_mindmp_slope=0;
     194        md.cm_maxdmp_value=0;
     195        md.cm_maxdmp_slope=0;
     196        md.cm_min=0;
     197        md.cm_max=0;
    196198        md.fit=[];
    197199        md.cm_jump=[];
  • issm/trunk/src/m/classes/@model/setdefaultparameters.m

    r2352 r2354  
    188188%cm_mindampening stabilize the inversed parameter above
    189189%a given scalar with a given penalty. Not applied by default
    190 md.cm_mindampening=0;
     190md.cm_mindmp_value=0;
     191md.cm_mindmp_slope=0;
    191192
    192193%cm_maxdampening stabilize the inversed parameter below
    193194%a given scalar with a given penalty. Not applied by default
    194 md.cm_maxdampening=0;
    195 
    196 %mincontrolconstraint is the minimum acceptable value of the
     195md.cm_maxdmp_value=150;
     196md.cm_maxdmp_value=0;
     197
     198%cm_min is the minimum acceptable value of the
    197199%inversed parameter (B>0 for example)
    198 md.mincontrolconstraint=0;
    199 
    200 %maxcontrolconstraint is the maximum acceptable value of the
     200md.cm_min=0;
     201
     202%cm_max is the maximum acceptable value of the
    201203%inversed parameter (drag<200 for example)
    202 md.maxcontrolconstraint=200;
     204md.cm_max=200;
    203205
    204206%eps_cm is a criteria to stop the control methods.
  • issm/trunk/src/m/classes/public/display/displaycontrol.m

    r2352 r2354  
    1515        fielddisplay(md,'eps_cm','misfit convergence criterion. Default is 1%, NaN if not applied');
    1616        fielddisplay(md,'optscal','scaling factor on gradient direction during optimization, for each optimization step');
    17         fielddisplay(md,'fit','''absolute: 0'', ''relative: 1'', or ''logarithmic: 2''. default is ''absolute: 0'', for each optimization steps');
     17        fielddisplay(md,'fit','''absolute: 0'', ''relative: 1'', or ''logarithmic: 2''. for each optimization steps');
    1818        fielddisplay(md,'cm_jump','decrease threshold for misfit, default is 30%');
    1919        fielddisplay(md,'maxiter','maximum iterations during each optimization step');
    2020        fielddisplay(md,'tolx','minimum tolerance which will stop one optimization search');
    21         fielddisplay(md,'cm_mindampening','minimum acceptable value (first argument) of the inversed parameter before being penalized (second argument)');
    22         fielddisplay(md,'cm_maxdampening','maximum acceptable value (first argument) of the inversed parameter before being penalized (second argument)');
    23         fielddisplay(md,'cm_noisedampening','noise dampening coefficient');
    24         fielddisplay(md,'mincontrolconstraint','minimum contraint for the controlled parameters');
    25         fielddisplay(md,'maxcontrolconstraint','maximum contraint for the controlled parameters');
     21        fielddisplay(md,'cm_noisedmp','noise dampening coefficient, 0 if not applied');
     22        fielddisplay(md,'cm_mindmp_value','minimum acceptable value of the inversed parameter before being dampened');
     23        fielddisplay(md,'cm_mindmp_slope','dampening coefficient applied to parameter below minimum, 0 if not applied');
     24        fielddisplay(md,'cm_maxdmp_value','maximum acceptable value of the inversed parameter before being dampened');
     25        fielddisplay(md,'cm_maxdmp_slope','dampening coefficient applied to parameter above maximum, 0 if not applied');
    2626        fielddisplay(md,'meanvel','velocity scaling factor when evaluating relative or logarithmic misfit');
    2727        fielddisplay(md,'epsvel','for relative fit, avoids misfit becoming infinity, for logarithmic fit, threshold for velocity');
  • issm/trunk/src/m/classes/public/isresultconsistent.m

    r2272 r2354  
    8585
    8686        %check inversed parameter
    87         if ~isnan(md.maxcontrolconstraint),
    88                 if any(md.results.diagnostic.parameter>md.maxcontrolconstraint)
    89                         disp(['''control'' result not consistent: inverse parameter is greater than ' num2str(md.maxcontrolconstraint)]);
     87        if ~isnan(md.cm_max),
     88                if any(md.results.diagnostic.parameter>md.cm_max)
     89                        disp(['''control'' result not consistent: inverse parameter is greater than ' num2str(md.cm_max)]);
    9090                        bool=0; return;
    9191                end
    9292        end
    93         if ~isnan(md.mincontrolconstraint),
    94                 if any(md.results.diagnostic.parameter<md.mincontrolconstraint)
    95                         disp(['''control'' result not consistent: inverse parameter is smaller than ' num2str(md.mincontrolconstraint)]);
     93        if ~isnan(md.cm_min),
     94                if any(md.results.diagnostic.parameter<md.cm_min)
     95                        disp(['''control'' result not consistent: inverse parameter is smaller than ' num2str(md.cm_min)]);
    9696                        bool=0; return;
    9797                end
  • issm/trunk/src/m/classes/public/marshall.m

    r2330 r2354  
    112112WriteData(fid,md.tolx,'Scalar','tolx');
    113113WriteData(fid,md.maxiter,'Mat','maxiter');
    114 WriteData(fid,md.cm_noisedampening,'Scalar','cm_noisedampening');
    115 WriteData(fid,md.mincontrolconstraint,'Scalar','mincontrolconstraint');
    116 WriteData(fid,md.maxcontrolconstraint,'Scalar','maxcontrolconstraint');
     114WriteData(fid,md.cm_noisedmp,'Scalar','cm_noisedmp');
     115WriteData(fid,md.cm_mindmp_value,'Scalar','cm_mindmp_value');
     116WriteData(fid,md.cm_mindmp_slope,'Scalar','cm_mindmp_slope');
     117WriteData(fid,md.cm_maxdmp_value,'Scalar','cm_maxdmp_value');
     118WriteData(fid,md.cm_maxdmp_slope,'Scalar','cm_maxdmp_slope');
     119WriteData(fid,md.cm_min,'Scalar','cm_min');
     120WriteData(fid,md.cm_max,'Scalar','cm_max');
    117121WriteData(fid,md.eps_res,'Scalar','eps_res');
    118122WriteData(fid,md.eps_rel,'Scalar','eps_rel');
  • issm/trunk/src/m/solutions/cielo/control_core.m

    r2333 r2354  
    7979
    8080        displaystring(verbose,'\n%s',['      constraining the new distribution...']);
    81         param_g=ControlConstrain(param_g,model.parameters);
    82 
    8381       
    8482        disp(['      value of misfit J after optimization #' num2str(n) ':' num2str(c(n).J)]);
  • issm/trunk/src/m/solutions/cielo/diagnostic.m

    r2333 r2354  
    3333        inputs=add(inputs,'velocity',models.dh.parameters.u_g,'doublevec',3,models.dh.parameters.numberofnodes);
    3434        if md.control_analysis,
    35                 inputs=add(inputs,'cm_noisedampening',models.dh.parameters.cm_noisedampening,'double');
    3635                inputs=add(inputs,'velocity_obs',models.dh.parameters.u_g_obs,'doublevec',2,models.dh.parameters.numberofnodes);
    3736        end
  • issm/trunk/src/m/solutions/cielo/steadystate.m

    r2330 r2354  
    4444        inputs=add(inputs,'dt',models.t.parameters.dt*models.t.parameters.yts,'double');
    4545        if md.control_analysis,
    46                 inputs=add(inputs,'cm_noisedampening',models.dh.parameters.cm_noisedampening,'double');
    4746                inputs=add(inputs,'velocity_obs',models.dh.parameters.u_g_obs,'doublevec',2,models.dh.parameters.numberofnodes);
    4847        end
  • issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp

    r2333 r2354  
    1212        /*input datasets: */
    1313        double*  p_g=NULL;
    14         double   mincontrolconstraint;
    15         double   maxcontrolconstraint;
     14        double   cm_min;
     15        double   cm_max;
    1616        char*    control_type=NULL;
    1717        int      gsize;
     
    2828        FetchParams(&parameters,PARAMETERS);
    2929
    30         parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint");
    31         parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
     30        parameters->FindParam(&cm_min,"cm_min");
     31        parameters->FindParam(&cm_max,"cm_max");
    3232        parameters->FindParam(&control_type,"control_type");
    3333
    3434        /*!Call core code: */
    35         ControlConstrainx(p_g,gsize,mincontrolconstraint,maxcontrolconstraint,control_type);
     35        ControlConstrainx(p_g,gsize,cm_min,cm_max,control_type);
    3636
    3737        /*write output : */
Note: See TracChangeset for help on using the changeset viewer.