processmesh

PURPOSE ^

PROCESSMESH - process mesh to be plotted

SYNOPSIS ^

function [x y z elements is2d]=processmesh(md,options_structure);

DESCRIPTION ^

PROCESSMESH - process mesh to be plotted

   Usage:
      [x y z elements is2d]=processmesh(md,options_structure)

   See also: PLOTMODEL, PROCESSDATA

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [x y z elements is2d]=processmesh(md,options_structure);
0002 %PROCESSMESH - process mesh to be plotted
0003 %
0004 %   Usage:
0005 %      [x y z elements is2d]=processmesh(md,options_structure)
0006 %
0007 %   See also: PLOTMODEL, PROCESSDATA
0008 
0009 %some checks
0010 if md.numberofgrids==md.numberofelements
0011     error('plot error message: the number of elements is the same as the number of grids! cannot plot anything with model/plot, use matlab/plot instead')
0012 end
0013 
0014 %first load x,y, etc ... to speed up plot
0015 x=md.x;
0016 x2d=md.x2d;
0017 y=md.y;
0018 y2d=md.y2d;
0019 z=md.z;
0020 z2d=md.z2d;
0021 elements2d=md.elements2d;
0022 elements=md.elements;
0023 elements_type2d=md.elements_type2d;
0024 
0025 %is it a 2d plot?
0026 if strcmpi(md.type,'2d');
0027     is2d=1;
0028 else
0029     if ~isnan(options_structure.layer) & options_structure.layer>=1,
0030         is2d=1;
0031     else
0032         is2d=0;
0033     end
0034 end
0035 
0036 %layer projection?
0037 if ~isnan(options_structure.layer) & options_structure.layer>=1,
0038     %we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded.
0039     x=x2d;
0040     y=y2d;
0041     z=z2d;
0042     elements=elements2d;
0043     elements_type=elements_type2d;
0044 end
0045 
0046 %units
0047 if ~isnan(options_structure.unitmultiplier),
0048     x=x*options_structure.unitmultiplier;
0049     y=y*options_structure.unitmultiplier;
0050     z=z*options_structure.unitmultiplier;
0051 end

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