Ignore:
Timestamp:
11/29/11 19:29:01 (13 years ago)
Author:
Eric.Larour
Message:

merged trunk-jpl and trunk for revision 10980

Location:
issm/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/src/m/classes/inversion.m

    r10198 r10981  
    1818                step_threshold              = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
    1919                gradient_only               = modelfield('default',0,'marshall',true,'format','Boolean');
    20                 num_control_parameters      = modelfield('default',0,'marshall',true,'format','Integer');
    21                 num_cost_functions          = modelfield('default',0,'marshall',true,'format','Integer');
    2220                vx_obs                      = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    2321                vy_obs                      = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
     
    126124                        fielddisplay(obj,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
    127125                        fielddisplay(obj,'gradient_only','stop control method solution at gradient');
    128                         %fielddisplay(obj,'num_control_parameters','number of control_parameters');
    129                         %fielddisplay(obj,'num_cost_functions','number of cost_functions');
    130126                        fielddisplay(obj,'vx_obs','observed velocity x component [m/a]');
    131127                        fielddisplay(obj,'vy_obs','observed velocity y component [m/a]');
     
    143139                        disp('   503: ThicknessAbsGradient');
    144140                end % }}}
     141                function marshall(obj,fid) % {{{
     142
     143                        WriteData(fid,'object',obj,'fieldname','iscontrol','format','Boolean');
     144                        if ~obj.iscontrol, return; end
     145                        WriteData(fid,'object',obj,'fieldname','nsteps','format','Integer');
     146                        WriteData(fid,'object',obj,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3);
     147                        WriteData(fid,'object',obj,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
     148                        WriteData(fid,'object',obj,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);
     149                        WriteData(fid,'object',obj,'fieldname','cost_function_threshold','format','Double');
     150                        WriteData(fid,'object',obj,'fieldname','min_parameters','format','DoubleMat','mattype',3);
     151                        WriteData(fid,'object',obj,'fieldname','max_parameters','format','DoubleMat','mattype',3);
     152                        WriteData(fid,'object',obj,'fieldname','step_threshold','format','DoubleMat','mattype',3);
     153                        WriteData(fid,'object',obj,'fieldname','gradient_only','format','Boolean');
     154                        WriteData(fid,'object',obj,'fieldname','vx_obs','format','DoubleMat','mattype',1);
     155                        WriteData(fid,'object',obj,'fieldname','vy_obs','format','DoubleMat','mattype',1);
     156                        WriteData(fid,'object',obj,'fieldname','vz_obs','format','DoubleMat','mattype',1);
     157                        WriteData(fid,'object',obj,'fieldname','thickness_obs','format','DoubleMat','mattype',1);
     158
     159                        %process control parameters
     160                        num_control_parameters=numel(obj.control_parameters);
     161                        data=zeros(1,num_control_parameters);
     162                        for i=1:num_control_parameters,
     163                                data(i)=StringToEnum(obj.control_parameters{i});
     164                        end
     165                        WriteData(fid,'data',data,'enum',InversionControlParametersEnum,'format','DoubleMat','mattype',3);
     166                        WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum,'format','Integer');
     167
     168                        %process cost functions
     169                        num_cost_functions=size(obj.cost_functions,2);
     170                        data=obj.cost_functions;
     171                        pos=find(data==101); data(pos)=SurfaceAbsVelMisfitEnum;
     172                        pos=find(data==102); data(pos)=SurfaceRelVelMisfitEnum;
     173                        pos=find(data==103); data(pos)=SurfaceLogVelMisfitEnum;
     174                        pos=find(data==104); data(pos)=SurfaceLogVxVyMisfitEnum;
     175                        pos=find(data==105); data(pos)=SurfaceAverageVelMisfitEnum;
     176                        pos=find(data==201); data(pos)=ThicknessAbsMisfitEnum;
     177                        pos=find(data==501); data(pos)=DragCoefficientAbsGradientEnum;
     178                        pos=find(data==502); data(pos)=RheologyBbarAbsGradientEnum;
     179                        pos=find(data==503); data(pos)=ThicknessAbsGradientEnum;
     180                        WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum,'format','DoubleMat','mattype',3);
     181                        WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum,'format','Integer');
     182                end % }}}
    145183        end
    146184end
Note: See TracChangeset for help on using the changeset viewer.