meshdensitygen

PURPOSE ^

MESHDENSITYGEN - ???

SYNOPSIS ^

function density=meshdensitygen(infile,nel);

DESCRIPTION ^

MESHDENSITYGEN -  ???

   Usage:
      struct=meshdensitygen(infile,nel);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function density=meshdensitygen(infile,nel);
0002 %MESHDENSITYGEN -  ???
0003 %
0004 %   Usage:
0005 %      struct=meshdensitygen(infile,nel);
0006 
0007 density=expread(infile,1);
0008 
0009 for i=1:length(density), 
0010     
0011     %Find density by figuring out largest distance between
0012     %two points of the density profile, and divide by the number
0013     %of elements desired for this profile.
0014     maxdist=maxdistprofile(density(i).x,density(i).y);
0015     density(i).density=round(maxdist/sqrt(nel));
0016 end
0017 
0018 
0019 function maxdist=maxdistprofile(x,y);
0020 
0021 for i=1:length(x),
0022 dist=sqrt((x-x(i)).^2+(y-y(i)).^2);
0023 pos=find(dist==max(dist));
0024 maxdist=dist(pos);
0025 end

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