VelocityExtrude

PURPOSE ^

VELOCITYEXTRUDE - extrude the velocity

SYNOPSIS ^

function u_g=VelocityExtrude(md,u_g);

DESCRIPTION ^

VELOCITYEXTRUDE - extrude the velocity

   Extrude collapsed horizontal velocities present in MacAyeal elements

   Usage:
      u_g=VelocityExtrude(md,u_g)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function u_g=VelocityExtrude(md,u_g);
0002 %VELOCITYEXTRUDE - extrude the velocity
0003 %
0004 %   Extrude collapsed horizontal velocities present in MacAyeal elements
0005 %
0006 %   Usage:
0007 %      u_g=VelocityExtrude(md,u_g)
0008 
0009 if strcmpi(md.type,'2d'),
0010     %do nothing, we don't have a 3d mesh anyway.
0011 else
0012 
0013     %Find list of 2d grids that belong to the collapsed macayeal elements.
0014     %And remove grids on the border.
0015     %These grids are on macayeal but not on pattyn nor hutter nor dirichlet
0016     grids2d=md.gridonmacayeal(1:md.numberofgrids2d) & ~(md.gridonhutter(1:md.numberofgrids2d) | md.gridonpattyn(1:md.numberofgrids2d) | md.gridondirichlet_diag(1:md.numberofgrids2d));
0017     
0018     vx2d=u_g(1:6:6*md.numberofgrids2d).*grids2d;
0019     vy2d=u_g(2:6:6*md.numberofgrids2d).*grids2d;
0020 
0021     %Extrude across the 3d mesh
0022     vx3d=project3d(md,vx2d,'node');
0023     vy3d=project3d(md,vy2d,'node');
0024 
0025     %Remove velocity of the first layer
0026     vx3d(1:md.numberofgrids2d)=0;
0027     vy3d(1:md.numberofgrids2d)=0;
0028 
0029     %Plug back into u_g
0030     u_g(1:6:end)=u_g(1:6:end)+vx3d;
0031     u_g(2:6:end)=u_g(2:6:end)+vy3d;
0032 
0033 end
0034 
0035 end %end function

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