[22755] | 1 | Index: ../trunk-jpl/src/m/classes/numberedcostfunction.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/classes/numberedcostfunction.m (revision 22401)
|
---|
| 4 | +++ ../trunk-jpl/src/m/classes/numberedcostfunction.m (revision 22402)
|
---|
| 5 | @@ -5,6 +5,8 @@
|
---|
| 6 |
|
---|
| 7 | classdef numberedcostfunction
|
---|
| 8 | properties (SetAccess=public)
|
---|
| 9 | + name = '';
|
---|
| 10 | + definitionstring = '';
|
---|
| 11 | cost_functions = NaN
|
---|
| 12 | cost_functions_coefficients = NaN
|
---|
| 13 | vx_obs = NaN
|
---|
| 14 | @@ -22,7 +24,7 @@
|
---|
| 15 | case 1
|
---|
| 16 | self=structtoobj(numberedcostfunction(),varargin{1});
|
---|
| 17 | otherwise
|
---|
| 18 | - error('constructor not supported');
|
---|
| 19 | + error('construtor not supported yet');
|
---|
| 20 | end
|
---|
| 21 | end % }}}
|
---|
| 22 | function self = extrude(self,md) % {{{
|
---|
| 23 | @@ -31,13 +33,12 @@
|
---|
| 24 | self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node');
|
---|
| 25 | self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node');
|
---|
| 26 | if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end;
|
---|
| 27 | - if numel(self.min_parameters)>1,self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node');end;
|
---|
| 28 | - if numel(self.max_parameters)>1,self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node');end;
|
---|
| 29 | end % }}}
|
---|
| 30 | function self = setdefaultparameters(self) % {{{
|
---|
| 31 |
|
---|
| 32 | %several responses can be used:
|
---|
| 33 | self.cost_functions=101;
|
---|
| 34 | +
|
---|
| 35 |
|
---|
| 36 | end % }}}
|
---|
| 37 | function md = checkconsistency(self,md,solution,analyses) % {{{
|
---|
| 38 | @@ -83,25 +84,27 @@
|
---|
| 39 |
|
---|
| 40 | yts=md.constants.yts;
|
---|
| 41 |
|
---|
| 42 | - WriteData(fid,prefix,'name','md.inversion.type','data',2,'format','Integer');
|
---|
| 43 | - WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
|
---|
| 44 | - WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 45 | - WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 46 | - WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 47 | - WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 48 | + WriteData(fid,prefix,'data',self.name,'name','md.numberedcostfunction.name','format','String');
|
---|
| 49 | + WriteData(fid,prefix,'data',self.definitionstring,'name','md.numberedcostfunction.definitionstring','format','String');
|
---|
| 50 | +
|
---|
| 51 | + WriteData(fid,prefix,'data',self.cost_functions_coefficients,'name','md.numberedcostfunction.cost_functions_coefficients','format','DoubleMat','mattype',1);
|
---|
| 52 | + WriteData(fid,prefix,'data',self.vx_obs,'name','md.numberedcostfunction.vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 53 | + WriteData(fid,prefix,'data',self.vy_obs,'name','md.numberedcostfunction.vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 54 | + WriteData(fid,prefix,'data',self.vz_obs,'name','md.numberedcostfunction.vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 55 | + WriteData(fid,prefix,'data',self.vel_obs,'name','md.numberedcostfunction.vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 56 | if(numel(self.thickness_obs)==md.mesh.numberofelements),
|
---|
| 57 | mattype=2;
|
---|
| 58 | else
|
---|
| 59 | mattype=1;
|
---|
| 60 | end
|
---|
| 61 | - WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
|
---|
| 62 | - WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
|
---|
| 63 | + WriteData(fid,prefix,'data',self.thickness_obs,'name','md.numberedcostfunction.thickness_obs','format','DoubleMat','mattype',mattype);
|
---|
| 64 | + WriteData(fid,prefix,'data',self.surface_obs,'name','md.numberedcostfunction.surface_obs','format','DoubleMat','mattype',mattype);
|
---|
| 65 |
|
---|
| 66 | %process cost functions
|
---|
| 67 | num_cost_functions=size(self.cost_functions,2);
|
---|
| 68 | data=marshallcostfunctions(self.cost_functions);
|
---|
| 69 | - WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray');
|
---|
| 70 | - WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
|
---|
| 71 | + WriteData(fid,prefix,'data',data,'name','md.numberedcostfunction.cost_functions','format','StringArray');
|
---|
| 72 | + WriteData(fid,prefix,'data',num_cost_functions,'name','md.numberedcostfunction.num_cost_functions','format','Integer');
|
---|
| 73 | end % }}}
|
---|
| 74 | function savemodeljs(self,fid,modelname) % {{{
|
---|
| 75 |
|
---|