Changeset 11446


Ignore:
Timestamp:
02/14/12 16:28:54 (13 years ago)
Author:
Mathieu Morlighem
Message:

Added incomplete_adjoint field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/m/classes/inversion.m

    r11276 r11446  
    88                iscontrol                   = 0
    99                tao                         = 0
     10                incomplete_adjoint          = 0
    1011                control_parameters          = NaN
    1112                nsteps                      = 0
     
    4344                function obj = setdefaultparameters(obj) % {{{
    4445
    45                          %parameter to be inferred by control methods (only
    46                          %drag and B are supported yet)
    47                          obj.control_parameters={'FrictionCoefficient'};
     46                        %default is incomplete adjoint for now
     47                        obj.incomplete_adjoint=1;
    4848
    49                          %number of steps in the control methods
    50                          obj.nsteps=20;
     49                        %parameter to be inferred by control methods (only
     50                        %drag and B are supported yet)
     51                        obj.control_parameters={'FrictionCoefficient'};
    5152
    52                          %maximum number of iteration in the optimization algorithm for
    53                          %each step
    54                          obj.maxiter_per_step=20*ones(obj.nsteps,1);
     53                        %number of steps in the control methods
     54                        obj.nsteps=20;
    5555
    56                          %the inversed parameter is updated as follows:
    57                          %new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
    58                          %usually the gradient_scaling must be of the order of magnitude of the
    59                          %inversed parameter (10^8 for B, 50 for drag) and can be decreased
    60                          %after the first iterations
    61                          obj.gradient_scaling=50*ones(obj.nsteps,1);
     56                        %maximum number of iteration in the optimization algorithm for
     57                        %each step
     58                        obj.maxiter_per_step=20*ones(obj.nsteps,1);
    6259
    63                          %several responses can be used:
    64                          obj.cost_functions=101*ones(obj.nsteps,1);
     60                        %the inversed parameter is updated as follows:
     61                        %new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
     62                        %usually the gradient_scaling must be of the order of magnitude of the
     63                        %inversed parameter (10^8 for B, 50 for drag) and can be decreased
     64                        %after the first iterations
     65                        obj.gradient_scaling=50*ones(obj.nsteps,1);
    6566
    66                          %step_threshold is used to speed up control method. When
    67                          %misfit(1)/misfit(0) < obj.step_threshold, we go directly to
    68                          %the next step
    69                          obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement.
     67                        %several responses can be used:
     68                        obj.cost_functions=101*ones(obj.nsteps,1);
    7069
    71                          %stop control solution at the gradient computation and return it?
    72                          obj.gradient_only=0;
     70                        %step_threshold is used to speed up control method. When
     71                        %misfit(1)/misfit(0) < obj.step_threshold, we go directly to
     72                        %the next step
     73                        obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement.
    7374
    74                          %cost_function_threshold is a criteria to stop the control methods.
    75                          %if J[n]-J[n-1]/J[n] < criteria, the control run stops
    76                          %NaN if not applied
    77                          obj.cost_function_threshold=NaN; %not activated
     75                        %stop control solution at the gradient computation and return it?
     76                        obj.gradient_only=0;
     77
     78                        %cost_function_threshold is a criteria to stop the control methods.
     79                        %if J[n]-J[n-1]/J[n] < criteria, the control run stops
     80                        %NaN if not applied
     81                        obj.cost_function_threshold=NaN; %not activated
    7882
    7983                end % }}}
     
    8791
    8892                        checkfield(md,'inversion.iscontrol','values',[0 1]);
     93                        checkfield(md,'inversion.tao','values',[0 1]);
     94                        checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
    8995                        checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'});
    9096                        checkfield(md,'inversion.nsteps','numel',1,'>=',1);
     
    107113                function disp(obj) % {{{
    108114                        fielddisplay(obj,'iscontrol','is inversion activated?');
     115                        fielddisplay(obj,'incomplete_adjoint','do we assume linear viscosity?');
    109116                        fielddisplay(obj,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
    110117                        fielddisplay(obj,'nsteps','number of optimization searches');
     
    137144                        WriteData(fid,'object',obj,'fieldname','iscontrol','format','Boolean');
    138145                        WriteData(fid,'object',obj,'fieldname','tao','format','Boolean');
     146                        WriteData(fid,'object',obj,'fieldname','incomplete_adjoint','format','Boolean');
    139147                        if ~obj.iscontrol, return; end
    140148                        WriteData(fid,'object',obj,'fieldname','nsteps','format','Integer');
Note: See TracChangeset for help on using the changeset viewer.