Changeset 2267


Ignore:
Timestamp:
09/21/09 11:15:46 (16 years ago)
Author:
seroussi
Message:

changed cmjump to cm_jump

Location:
issm/trunk/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp

    r2211 r2267  
    2424
    2525        double* fit=NULL;
    26         double* cmjump=NULL;
     26        double* cm_jump=NULL;
    2727        double* optscal=NULL;
    2828        double* maxiter=NULL;
     
    114114                /*Now, recover fit, optscal and maxiter as vectors: */
    115115                IoModelFetchData((void**)&iomodel->fit,NULL,NULL,iomodel_handle,"fit","Matrix","Mat");
    116                 IoModelFetchData((void**)&iomodel->cmjump,NULL,NULL,iomodel_handle,"cmjump","Matrix","Mat");
     116                IoModelFetchData((void**)&iomodel->cm_jump,NULL,NULL,iomodel_handle,"cm_jump","Matrix","Mat");
    117117                IoModelFetchData((void**)&iomodel->optscal,NULL,NULL,iomodel_handle,"optscal","Matrix","Mat");
    118118                IoModelFetchData((void**)&iomodel->maxiter,NULL,NULL,iomodel_handle,"maxiter","Matrix","Mat");
     
    124124
    125125                count++;
    126                 param= new Param(count,"cmjump",DOUBLEVEC);
    127                 param->SetDoubleVec(iomodel->cmjump,iomodel->nsteps);
     126                param= new Param(count,"cm_jump",DOUBLEVEC);
     127                param->SetDoubleVec(iomodel->cm_jump,iomodel->nsteps);
    128128                parameters->AddObject(param);
    129129
     
    139139
    140140                xfree((void**)&iomodel->fit);
    141                 xfree((void**)&iomodel->cmjump);
     141                xfree((void**)&iomodel->cm_jump);
    142142                xfree((void**)&iomodel->optscal);
    143143                xfree((void**)&iomodel->maxiter);
  • issm/trunk/src/c/ModelProcessorx/IoModel.cpp

    r2212 r2267  
    108108        /*!solution parameters: */
    109109        iomodel->fit=NULL;
    110         iomodel->cmjump=NULL;
     110        iomodel->cm_jump=NULL;
    111111        iomodel->meanvel=0;
    112112        iomodel->epsvel=0;
     
    241241        xfree((void**)&iomodel->n);
    242242        xfree((void**)&iomodel->fit);
    243         xfree((void**)&iomodel->cmjump);
     243        xfree((void**)&iomodel->cm_jump);
    244244        xfree((void**)&iomodel->optscal);
    245245        xfree((void**)&iomodel->maxiter);
  • issm/trunk/src/c/ModelProcessorx/IoModel.h

    r2212 r2267  
    107107        /*solution parameters: */
    108108        double* fit;
    109         double* cmjump;
     109        double* cm_jump;
    110110        double  meanvel,epsvel;
    111111        int     artificial_diffusivity;
  • issm/trunk/src/c/objects/OptPars.h

    r2188 r2267  
    1111        double xmax;
    1212        double tolerance;
    13         double cmjump;
     13        double cm_jump;
    1414        int maxiter;
    1515
  • issm/trunk/src/c/parallel/control_core.cpp

    r2255 r2267  
    3232        int     gsize;
    3333        double* maxiter=NULL;
    34         double* cmjump=NULL;
     34        double* cm_jump=NULL;
    3535        double  eps_cm;
    3636        double  tolx;
     
    6666        model->FindParam(&optscal,"optscal");
    6767        model->FindParam(&maxiter,"maxiter");
    68         model->FindParam(&cmjump,"cmjump");
     68        model->FindParam(&cm_jump,"cm_jump");
    6969        model->FindParam(&eps_cm,"eps_cm");
    7070        model->FindParam(&tolx,"tolx");
     
    125125                optargs.model=model;
    126126                optargs.param_g=param_g; optargs.grad_g=grad_g_double; optargs.inputs=inputs;optargs.n=n;
    127                 optpars.xmin=0; optpars.xmax=1; optpars.tolerance=tolx; optpars.maxiter=(int)maxiter[n];optpars.cmjump=cmjump[n];
     127                optpars.xmin=0; optpars.xmax=1; optpars.tolerance=tolx; optpars.maxiter=(int)maxiter[n];optpars.cm_jump=cm_jump[n];
    128128                BrentSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs);
    129129                _printf_("%s\n","      done.");
     
    216216        xfree((void**)&optscal);
    217217        xfree((void**)&maxiter);
    218         xfree((void**)&cmjump);
     218        xfree((void**)&cm_jump);
    219219        VecFree(&new_grad_g); //do not VecFree grad_g and grad_g_old, they point to new_grad_g
    220220        xfree((void**)&grad_g_double);
  • issm/trunk/src/c/shared/Numerics/BrentSearch.cpp

    r2188 r2267  
    3939        double tol1,tol2,seps,tolerance;
    4040        int    maxiter;
    41         double cmjump;
     41        double cm_jump;
    4242
    4343        /*counters: */
     
    4949        tolerance=optpars->tolerance;
    5050        maxiter=optpars->maxiter;
    51         cmjump=optpars->cmjump;
     51        cm_jump=optpars->cm_jump;
    5252       
    5353        //initialize counter and boundaries
     
    6666
    6767        //test if jump option activated and xmin==0
    68         if (!isnan(cmjump) && (xmin==0)){
     68        if (!isnan(cm_jump) && (xmin==0)){
    6969
    7070                //test ration between fxmin and fxmax. if < criterion, return
    71                 if((fxmax/fxmin)<cmjump){
     71                if((fxmax/fxmin)<cm_jump){
    7272
    7373                        /*Assign output pointers: */
  • issm/trunk/src/m/classes/@model/model.m

    r2212 r2267  
    185185        md.maxcontrolconstraint=0;
    186186        md.fit=[];
    187         md.cmjump=[];
     187        md.cm_jump=[];
    188188        md.epsvel=0;
    189189        md.meanvel=0;
  • issm/trunk/src/m/classes/@model/setdefaultparameters.m

    r2226 r2267  
    189189md.fit=0*ones(md.nsteps,1);
    190190
    191 %cmjump
    192 md.cmjump=.7*ones(md.nsteps,1); %30 per cent decrement.
     191%cm_jump
     192md.cm_jump=.7*ones(md.nsteps,1); %30 per cent decrement.
    193193
    194194%eps_cm is a criteria to stop the control methods.
  • issm/trunk/src/m/classes/public/display/displaycontrol.m

    r2211 r2267  
    1616        fielddisplay(md,'optscal','scaling factor on gradient direction during optimization, for each optimization step');
    1717        fielddisplay(md,'fit','''absolute: 0'', ''relative: 1'', or ''logarithmic: 2''. default is ''absolute: 0'', for each optimization steps');
    18         fielddisplay(md,'cmjump','decrease threshold for misfit, default is 30%');
     18        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');
  • issm/trunk/src/m/classes/public/geography.m

    r1116 r2267  
    4242elements=md.elements;
    4343
     44invert=0;
     45
    4446%Fist recover arrays of ice shelf grids and elements, and ice sheet grids and elements.
    4547if strcmp(iceshelfname,''), %no iceshelf contour file, we are dealing with a pure ice sheet.
     
    5052        elementoniceshelf=ones(md.numberofelements,1);
    5153else
     54        if strcmpi(iceshelfname(1),'~'),
     55                iceshelfname=iceshelfname(2:length(iceshelfname));
     56                invert=1;
     57        end
    5258        [gridoniceshelf,elementoniceshelf]=ContourToMesh(elements,x,y,expread(iceshelfname,1),'element and node',2);
     59end
     60if invert,
     61        gridoniceshelf=1-gridoniceshelf;
     62        elementoniceshelf=1-elementoniceshelf;
    5363end
    5464
  • issm/trunk/src/m/classes/public/ismodelselfconsistent.m

    r2211 r2267  
    351351
    352352        %LENGTH CONTROL FIELDS
    353         if (length(md.maxiter)~=md.nsteps | length(md.optscal)~=md.nsteps | length(md.fit)~=md.nsteps | length(md.cmjump)~=md.nsteps)
    354                 disp('maxiter, optscal, fit and cmjump must have the length specified by nsteps')
     353        if (length(md.maxiter)~=md.nsteps | length(md.optscal)~=md.nsteps | length(md.fit)~=md.nsteps | length(md.cm_jump)~=md.nsteps)
     354                disp('maxiter, optscal, fit and cm_jump must have the length specified by nsteps')
    355355                bool=0;return;
    356356        end
  • issm/trunk/src/m/classes/public/marshall.m

    r2212 r2267  
    101101%Write solution parameters
    102102WriteData(fid,md.fit,'Mat','fit');
    103 WriteData(fid,md.cmjump,'Mat','cmjump');
     103WriteData(fid,md.cm_jump,'Mat','cm_jump');
    104104WriteData(fid,md.yts,'Scalar','yts');
    105105WriteData(fid,md.meanvel,'Scalar','meanvel');
  • issm/trunk/src/m/classes/public/plot/plot_riftpenetration.m

    r1 r2267  
    4444                        normal(2)=penaltypairs(j,6);
    4545
    46                         vx1=md.vx(penaltypairs(j,1)); vx2=md.vx(penaltypairs(j,2)); vy1=md.vy(penaltypairs(j,1)); vy2=md.vy(penaltypairs(j,2));
     46                        vx1=md.vx(penaltypairs(j,1));
     47                        vx2=md.vx(penaltypairs(j,2));
     48                        vy1=md.vy(penaltypairs(j,1));
     49                        vy2=md.vy(penaltypairs(j,2));
    4750                        penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
    4851                        %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
  • issm/trunk/src/m/classes/public/plot/plot_transient_results.m

    r740 r2267  
    2424string='plotmodel(md';
    2525for i=1:length(md.results.transient),
    26         string=[string ',''data'',''results.transient(' num2str(i) ').thickness'',''title'',''Thickness at time ' num2str(md.results.transient(i).time) ' a'''];
     26        string=[string ',''data'',md.results.transient(' num2str(i) ').thickness,''title'',''Thickness at time ' num2str(md.results.transient(i).time) ' a'''];
    2727end
    2828string=[string ',''figure'',1,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight) ');'];
     
    3232string='plotmodel(md';
    3333for i=1:length(md.results.transient),
    34         string=[string ',''data'',''results.transient(' num2str(i) ').vel'',''view'',3,''title'',''Velocity at time ' num2str(md.results.transient(i).time) ' a'''];
     34        string=[string ',''data'',md.results.transient(' num2str(i) ').vel,''view'',3,''title'',''Velocity at time ' num2str(md.results.transient(i).time) ' a'''];
    3535end
    3636string=[string ',''figure'',2,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
     
    3838clear string;
    3939
    40 string='plotmodel(md';
    41 for i=1:length(md.results.transient),
    42         string=[string ',''data'',''results.transient(' num2str(i) ').temperature'',''view'',3,''title'',''Temperature at time ' num2str(md.results.transient(i).time) ' a'''];
     40if strcmpi(md.type,'3d'),
     41        string='plotmodel(md';
     42        for i=1:length(md.results.transient),
     43                string=[string ',''data'',md.results.transient(' num2str(i) ').temperature,''view'',3,''title'',''Temperature at time ' num2str(md.results.transient(i).time) ' a'''];
     44        end
     45        string=[string ',''figure'',3,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
     46        eval(string);
     47        clear string;
    4348end
    44 string=[string ',''figure'',3,''colorbar#all'',''on'',''view'',3,''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
    45 eval(string);
    46 clear string;
    4749
    4850string='plotmodel(md';
     
    6264clear string;
    6365
    64 string='plotmodel(md';
    65 for i=2:length(md.results.transient),
    66         string=[string ',''data'',md.results.transient(' num2str(i) ').temperature-md.results.transient(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.results.transient(i).time) ' a'''];
     66if strcmpi(md.type,'3d'),
     67        string='plotmodel(md';
     68        for i=2:length(md.results.transient),
     69                string=[string ',''data'',md.results.transient(' num2str(i) ').temperature-md.results.transient(' num2str(i-1) ').temperature,''view'',3,''title'',''Delta temperature at time ' num2str(md.results.transient(i).time) ' a'''];
     70        end
     71        string=[string ',''figure'',6,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
     72        eval(string);
     73        clear string;
    6774end
    68 string=[string ',''figure'',6,''colorbar#all'',''on'',''fontsize'',' num2str(options_structure.fontsize) ',''fontweight'',' num2str(options_structure.fontweight)  ');'];
    69 eval(string);
    70 clear string;
  • issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp

    r2188 r2267  
    2929        mxArray* n=NULL;
    3030        int      n_value;
    31         double*  cmjump=NULL;
     31        double*  cm_jump=NULL;
    3232
    3333        /*Boot module: */
     
    4545
    4646        /*Parameters: */
    47         FetchData((void**)&cmjump,NULL,NULL,mxGetField(PARAMETERS,0,"cmjump"),"Matrix","Mat");
     47        FetchData((void**)&cm_jump,NULL,NULL,mxGetField(PARAMETERS,0,"cm_jump"),"Matrix","Mat");
    4848        FetchData((void**)&n_value,NULL,NULL,STEP,"Integer",NULL);
    4949
     
    6161        optpars.tolerance=tolerance;
    6262        optpars.maxiter=maxiter;
    63         optpars.cmjump=cmjump[n_value-1];
     63        optpars.cm_jump=cm_jump[n_value-1];
    6464
    6565        BrentSearch(&search_scalar,&J,&optpars,&OptFunc,&optargs);
     
    7171        /*Free ressources: */
    7272        xfree((void**)&function_name);
    73         xfree((void**)&cmjump);
     73        xfree((void**)&cm_jump);
    7474
    7575        /*end module: */
Note: See TracChangeset for help on using the changeset viewer.