Changeset 9536


Ignore:
Timestamp:
08/31/11 16:57:21 (14 years ago)
Author:
Mathieu Morlighem
Message:

New control_types are cells of strings

Location:
issm/trunk/src/m
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/model.m

    r9532 r9536  
    180180                 %Control
    181181                 control_analysis = modelfield('default',0,'marshall',true,'format','Boolean');
    182                  control_type     = modelfield('default',0,'marshall',true,'format','DoubleMat','mattype',3);
     182                 control_type     = modelfield('default',NaN,'marshall',true,'preprocess','marshallcontroltype','format','DoubleMat','mattype',3);
    183183                 weights          = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    184184                 nsteps           = modelfield('default',0,'marshall',true,'format','Integer');
  • issm/trunk/src/m/model/display/displaycontrol.m

    r8650 r9536  
    1111disp(sprintf('   Control solution parameters:\n'));
    1212if md.control_analysis,
    13         fielddisplay(md,'control_type','parameter where inverse control is carried out; ex: DragCoefficientEnum, or RheologyBbarEnum)');
     13        fielddisplay(md,'control_type','parameter where inverse control is carried out; ex: {''DragCoefficient''}, or {''RheologyBbar''}');
    1414        fielddisplay(md,'weights','weights applied to the misfit of each node');
    1515        fielddisplay(md,'nsteps','number of optimization searches');
  • issm/trunk/src/m/model/ismodelselfconsistent.m

    r9532 r9536  
    203203        num_controls=numel(md.control_type);
    204204        num_costfunc=size(md.cm_responses,2);
    205         checkvalues(md,{'control_type'},[DhdtEnum DragCoefficientEnum RheologyBbarEnum VxEnum VyEnum]);
     205        if ~iscell(md.control_type)
     206                message(['model not consistent: model ' md.name ' control_type field should be a cell of strings']);
     207        end
     208        if ~ismember(md.control_type,{'Dhdt' 'DragCoefficient' 'RheologyBbar' 'Vx' 'Vy'});
     209                message(['model not consistent: model ' md.name ' control_type field should be ''Dhdt'' ''DragCoefficient'' ''RheologyBbar'' ''Vx'' ''Vy''']);
     210        end
    206211
    207212        %LENGTH CONTROL FIELDS
  • issm/trunk/src/m/model/marshall.m

    r9532 r9536  
    381381        pos=find(in==7); out(pos,end)=PattynStokesApproximationEnum;
    382382
     383function out=marshallcontroltype(in)
     384        out=zeros(numel(in),1);
     385        for i=1:numel(in),
     386                out(i)=StringToEnum(in{i});
     387        end
  • issm/trunk/src/m/model/parametercontroloptimization.m

    r8650 r9536  
    3030md2.eps_cm=NaN;
    3131md2.nsteps=getfieldvalue(options,'nsteps',5);
    32 md2.control_type=getfieldvalue(options,'md2.control_type',DragCoefficientEnum);
     32md2.control_type=getfieldvalue(options,'md2.control_type',{'DragCoefficient'});
    3333md2.maxiter=10*ones(md2.nsteps,1);
    3434md2.cm_jump=0.99*ones(md2.nsteps,1);
  • issm/trunk/src/m/model/parameterization/parametercontrolB.m

    r8650 r9536  
    2121
    2222%control type
    23 md.control_type=RheologyBbarEnum;
     23md.control_type={'RheologyBbar'};
    2424
    2525%weights
  • issm/trunk/src/m/model/parameterization/parametercontroldrag.m

    r8650 r9536  
    2121
    2222%control type
    23 md.control_type=DragCoefficientEnum;
     23md.control_type={'DragCoefficient'};
    2424
    2525%weights
  • issm/trunk/src/m/model/tres.m

    r9517 r9536  
    4141        if md.control_analysis==1,
    4242                for control_type=md.control_type
     43                        %Will need to be updated... good luck ;)
    4344                        md.(EnumToModelField(control_type))=PatchToVec(md.results.DiagnosticSolution.(EnumToString(control_type)));
    4445                end
Note: See TracChangeset for help on using the changeset viewer.