project2d

PURPOSE ^

PROJECT2D - returns the value of a field for a given layer of the mesh

SYNOPSIS ^

function projection_value=project2d(md,value,layer)

DESCRIPTION ^

PROJECT2D - returns the value of a field for a given layer of the mesh

   project 'value' vector taken at layer 'layer' from extruded 2d-3d mesh onto 2d mesh 
   used to do the extrusion. This routine is used to compare values between a 2d-3d mesh
   at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. 
   This routine relies heavily on projections (contained in 3d model md) recored during 
   the extrude operation.

   Usage:
      projection_value=project2d(md,value,layer)

   Example:
      vel2=project2d(md,md.vel,2);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function projection_value=project2d(md,value,layer)
0002 %PROJECT2D - returns the value of a field for a given layer of the mesh
0003 %
0004 %   project 'value' vector taken at layer 'layer' from extruded 2d-3d mesh onto 2d mesh
0005 %   used to do the extrusion. This routine is used to compare values between a 2d-3d mesh
0006 %   at a certain layer, and the equivalent value (if it exists), on the original 2d mesh.
0007 %   This routine relies heavily on projections (contained in 3d model md) recored during
0008 %   the extrude operation.
0009 %
0010 %   Usage:
0011 %      projection_value=project2d(md,value,layer)
0012 %
0013 %   Example:
0014 %      vel2=project2d(md,md.vel,2);
0015 
0016 %some checks on list of arguments
0017 if ((nargin~=3) ),
0018     project2dusage();
0019     error('project2d error message');
0020 end
0021 
0022 if md.counter<4,
0023     error('this model has not been extruded! ... exiting');
0024 end
0025 
0026 if ~strcmpi(md.type,'3d'),
0027     error('wrong model type ... should be ''3d''');
0028 end
0029 
0030 if ((layer<1) | (layer>md.numlayers)),
0031     error(['layer must be between 1 and ' num2str(md.numlayers)]);
0032 end
0033 
0034 if length(value)==md.numberofgrids,
0035     projection_value=value((layer-1)*md.numberofgrids2d+1:layer*md.numberofgrids2d);
0036 else
0037     projection_value=value((layer-1)*md.numberofelements2d+1:layer*md.numberofelements2d);
0038 end
0039 
0040 function project2dusage();
0041 disp(' project2d:  project ''value'' vector taken at layer ''layer'' from extruded 2d-3d mesh onto 2d mesh ');
0042 disp('              used to do the extrusion. This routine is used to compare values between a 2d-3d mesh');
0043 disp('              at a certain layer, and the equivalent value (if it exists), on the original 2d mesh. ');
0044 disp('              This routine relies heavily on projections (contained in 3d model md) recored during ');
0045 disp('              the extrude operation.');
0046 disp(' INPUT function projection_value=project2d(md,value,layer)');

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003