source:
issm/oecreview/Archive/21724-22754/ISSM-22401-22402.diff@
22755
Last change on this file since 22755 was 22755, checked in by , 7 years ago | |
---|---|
File size: 4.4 KB |
-
../trunk-jpl/src/m/classes/numberedcostfunction.m
5 5 6 6 classdef numberedcostfunction 7 7 properties (SetAccess=public) 8 name = ''; 9 definitionstring = ''; 8 10 cost_functions = NaN 9 11 cost_functions_coefficients = NaN 10 12 vx_obs = NaN … … 22 24 case 1 23 25 self=structtoobj(numberedcostfunction(),varargin{1}); 24 26 otherwise 25 error('constru ctor not supported');27 error('construtor not supported yet'); 26 28 end 27 29 end % }}} 28 30 function self = extrude(self,md) % {{{ … … 31 33 self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node'); 32 34 self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node'); 33 35 if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end; 34 if numel(self.min_parameters)>1,self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node');end;35 if numel(self.max_parameters)>1,self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node');end;36 36 end % }}} 37 37 function self = setdefaultparameters(self) % {{{ 38 38 39 39 %several responses can be used: 40 40 self.cost_functions=101; 41 41 42 42 43 end % }}} 43 44 function md = checkconsistency(self,md,solution,analyses) % {{{ … … 83 84 84 85 yts=md.constants.yts; 85 86 86 WriteData(fid,prefix,'name','md.inversion.type','data',2,'format','Integer'); 87 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 88 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 89 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 90 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 91 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1./yts); 87 WriteData(fid,prefix,'data',self.name,'name','md.numberedcostfunction.name','format','String'); 88 WriteData(fid,prefix,'data',self.definitionstring,'name','md.numberedcostfunction.definitionstring','format','String'); 89 90 WriteData(fid,prefix,'data',self.cost_functions_coefficients,'name','md.numberedcostfunction.cost_functions_coefficients','format','DoubleMat','mattype',1); 91 WriteData(fid,prefix,'data',self.vx_obs,'name','md.numberedcostfunction.vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 92 WriteData(fid,prefix,'data',self.vy_obs,'name','md.numberedcostfunction.vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 93 WriteData(fid,prefix,'data',self.vz_obs,'name','md.numberedcostfunction.vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 94 WriteData(fid,prefix,'data',self.vel_obs,'name','md.numberedcostfunction.vel_obs','format','DoubleMat','mattype',1,'scale',1./yts); 92 95 if(numel(self.thickness_obs)==md.mesh.numberofelements), 93 96 mattype=2; 94 97 else 95 98 mattype=1; 96 99 end 97 WriteData(fid,prefix,' object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);98 WriteData(fid,prefix,' object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);100 WriteData(fid,prefix,'data',self.thickness_obs,'name','md.numberedcostfunction.thickness_obs','format','DoubleMat','mattype',mattype); 101 WriteData(fid,prefix,'data',self.surface_obs,'name','md.numberedcostfunction.surface_obs','format','DoubleMat','mattype',mattype); 99 102 100 103 %process cost functions 101 104 num_cost_functions=size(self.cost_functions,2); 102 105 data=marshallcostfunctions(self.cost_functions); 103 WriteData(fid,prefix,'data',data,'name','md. inversion.cost_functions','format','StringArray');104 WriteData(fid,prefix,'data',num_cost_functions,'name','md. inversion.num_cost_functions','format','Integer');106 WriteData(fid,prefix,'data',data,'name','md.numberedcostfunction.cost_functions','format','StringArray'); 107 WriteData(fid,prefix,'data',num_cost_functions,'name','md.numberedcostfunction.num_cost_functions','format','Integer'); 105 108 end % }}} 106 109 function savemodeljs(self,fid,modelname) % {{{ 107 110
Note:
See TracBrowser
for help on using the repository browser.