[16297] | 1 | %MASSFLUXATGATE class definition
|
---|
| 2 | %
|
---|
| 3 | % Usage:
|
---|
| 4 | % massfluxatgate=massfluxatgate();
|
---|
| 5 |
|
---|
| 6 | classdef massfluxatgate
|
---|
| 7 | properties (SetAccess=public)
|
---|
| 8 | %massfluxatgate
|
---|
| 9 | name = '';
|
---|
| 10 | profilename = '';
|
---|
| 11 | end
|
---|
| 12 | properties (SetAccess=private)
|
---|
| 13 | segments = NaN;
|
---|
| 14 | end
|
---|
| 15 | methods
|
---|
| 16 | function obj = massfluxatgate(varargin) % {{{
|
---|
| 17 | switch nargin
|
---|
| 18 | case 0
|
---|
| 19 | obj=setdefaultparameters(obj);
|
---|
| 20 | case 1
|
---|
| 21 | obj.name=varargin{1};
|
---|
| 22 | case 2
|
---|
| 23 | obj.name=varargin{1};
|
---|
| 24 | obj.profilename=varargin{2};
|
---|
| 25 | otherwise
|
---|
| 26 | error('constructor not supported');
|
---|
| 27 | end
|
---|
| 28 | end % }}}
|
---|
| 29 | function obj = setdefaultparameters(obj) % {{{
|
---|
| 30 | end % }}}
|
---|
| 31 | function md = checkconsistency(obj,md,solution,analyses) % {{{
|
---|
| 32 |
|
---|
| 33 | md = checkfield(md,'massfluxatgate.name','empty',1);
|
---|
| 34 | md = checkfield(md,'massfluxatgate.profilename','empty',1);
|
---|
| 35 |
|
---|
| 36 | %check the profilename points to a file!:
|
---|
| 37 | if exist(profilename,'file'),
|
---|
| 38 | error('massfluxatgate error message: file name for profile corresponding to gate does not point to a legitimate file on disk!');
|
---|
| 39 | end
|
---|
| 40 | end % }}}
|
---|
| 41 | function disp(obj) % {{{
|
---|
| 42 | disp(sprintf(' Massfluxatgate:\n'));
|
---|
| 43 |
|
---|
| 44 | fielddisplay(obj,'name','identifier for this massfluxatgate response');
|
---|
| 45 | fielddisplay(obj,'profilename','name of file (shapefile or argus file) defining a profile (or gate)');
|
---|
| 46 |
|
---|
| 47 | end % }}}
|
---|
| 48 | function marshall(obj,md,fid) % {{{
|
---|
| 49 |
|
---|
| 50 | %before marshalling, we need to create the segments out of the profilename:
|
---|
| 51 | obj.segments=MeshProfileIntersection(md.mesh.elements,md.mesh.x,md.mesh.y,obj.profilename);
|
---|
| 52 |
|
---|
| 53 | %ok, marshall name and segments:
|
---|
| 54 | WriteData(fid,'object',obj,'fieldname','name','format','String');
|
---|
| 55 | WriteData(fid,'object',obj,'fieldname','segments','format','DoubleMat','mattype',1);
|
---|
| 56 |
|
---|
| 57 | end % }}}
|
---|
| 58 | end
|
---|
| 59 | end
|
---|