Changeset 17909
- Timestamp:
- 05/01/14 14:23:44 (11 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/m1qn3inversion.m
r17908 r17909 10 10 control_parameters = NaN 11 11 nsteps = 0 12 dxmin = 0; 13 epsrel = 0; 12 14 cost_functions = NaN 13 15 cost_functions_coefficients = NaN … … 19 21 vel_obs = NaN 20 22 thickness_obs = NaN 23 21 24 end 22 25 methods … … 31 34 end 32 35 end % }}} 33 function obj = setdefaultparameters(obj) % {{{36 function self = setdefaultparameters(self) % {{{ 34 37 35 38 %default is incomplete adjoint for now 36 obj.incomplete_adjoint=1;39 self.incomplete_adjoint=1; 37 40 38 41 %parameter to be inferred by control methods (only 39 42 %drag and B are supported yet) 40 obj.control_parameters={'FrictionCoefficient'};43 self.control_parameters={'FrictionCoefficient'}; 41 44 42 45 %number of steps in the control methods 43 obj.nsteps=20;46 self.nsteps=20; 44 47 45 48 %several responses can be used: 46 obj.cost_functions=101*ones(obj.nsteps,1); 49 self.cost_functions=101*ones(self.nsteps,1); 50 51 %m1qn3 parameters 52 self.dxmin = 0.1; 53 self.epsrel = 1e-4; 47 54 48 55 end % }}} … … 52 59 if ~obj.iscontrol, return; end 53 60 54 if ~IssmConfig('_HAVE_ TAO_'),55 md = checkmessage(md,[' TAO has not been installed, ISSM needs to be reconfigured and recompiled with TAO']);61 if ~IssmConfig('_HAVE_M1QN3_'), 62 md = checkmessage(md,['M1QN3 has not been installed, ISSM needs to be reconfigured and recompiled with M1QN3']); 56 63 end 57 64 … … 64 71 {'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy' 'Thickness'}); 65 72 md = checkfield(md,'fieldname','inversion.nsteps','numel',1,'>=',0); 73 md = checkfield(md,'fieldname','inversion.dxmin','numel',1,'>',0); 74 md = checkfield(md,'fieldname','inversion.epsrel','numel',1,'>',0); 66 75 md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:506]); 67 76 md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0); … … 84 93 fielddisplay(obj,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'); 85 94 fielddisplay(obj,'nsteps','number of optimization searches'); 95 fielddisplay(obj,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical'); 96 fielddisplay(obj,'epsrel','convergence criterion: ratio between current gradient and initial gradient'); 86 97 fielddisplay(obj,'cost_functions','indicate the type of response for each optimization step'); 87 98 fielddisplay(obj,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'); … … 112 123 WriteData(fid,'object',obj,'class','inversion','fieldname','incomplete_adjoint','format','Boolean'); 113 124 WriteData(fid,'object',obj,'class','inversion','fieldname','nsteps','format','Integer'); 125 WriteData(fid,'object',obj,'class','inversion','fieldname','dxmin','format','Double'); 126 WriteData(fid,'object',obj,'class','inversion','fieldname','epsrel','format','Double'); 114 127 WriteData(fid,'object',obj,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 115 128 WriteData(fid,'object',obj,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3); -
issm/trunk-jpl/src/m/classes/m1qn3inversion.py
r17906 r17909 23 23 self.control_parameters = float('NaN') 24 24 self.nsteps = 0 25 self.dxmin = 0. 26 self.epsrel = 0. 25 27 self.cost_functions = float('NaN') 26 28 self.cost_functions_coefficients = float('NaN') … … 60 62 string="%s\n%s"%(string,fielddisplay(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}')) 61 63 string="%s\n%s"%(string,fielddisplay(self,'nsteps','number of optimization searches')) 64 string="%s\n%s"%(string,fielddisplay(self,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical')) 65 string="%s\n%s"%(string,fielddisplay(self,'epsrel','convergence criterion: ratio between current gradient and initial gradient')) 62 66 string="%s\n%s"%(string,fielddisplay(self,'cost_functions','indicate the type of response for each optimization step')) 63 67 string="%s\n%s"%(string,fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter')) … … 95 99 self.cost_functions=101 96 100 101 #m1qn3 parameters 102 self.dxmin = 0.1 103 self.epsrel = 1e-4 104 97 105 return self 98 106 #}}} … … 110 118 md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',['BalancethicknessThickeningRate','FrictionCoefficient','MaterialsRheologyBbar','DamageDbar','Vx','Vy','Thickness']) 111 119 md = checkfield(md,'fieldname','inversion.nsteps','numel',[1],'>=',0) 120 md = checkfield(md,'fieldname','inversion.dxmin','numel',1,'>',0.) 121 md = checkfield(md,'fieldname','inversion.epsrel','numel',1,'>',0.) 112 122 md = checkfield(md,'fieldname','inversion.cost_functions','size',[num_costfunc],'values',[101,102,103,104,105,201,501,502,503,504,505]) 113 123 md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0) … … 133 143 WriteData(fid,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean') 134 144 WriteData(fid,'object',self,'class','inversion','fieldname','nsteps','format','Integer') 145 WriteData(fid,'object',obj,'class','inversion','fieldname','dxmin','format','Double') 146 WriteData(fid,'object',obj,'class','inversion','fieldname','epsrel','format','Double') 135 147 WriteData(fid,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1) 136 148 WriteData(fid,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3)
Note:
See TracChangeset
for help on using the changeset viewer.