0001 function md2=removeholes(md,field)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 if md.counter<3,
0013 error('removeholes error message: model is incomplete ... exiting');
0014 end
0015
0016 if nargin~=2,
0017 removeholesusage;
0018 error('removeholes error message');
0019 end
0020
0021 if ~ischar(field),
0022 removeholesusage;
0023 error('removeholes error message');
0024 end
0025
0026
0027
0028 domainoutline_string=md.domainoutline;
0029 name_slots=findstr(domainoutline_string,'## Name');
0030 domainoutline_string=domainoutline_string(1:(name_slots(2)-1));
0031 writefile('DomainOutlineTemp.exp',domainoutline_string);
0032
0033
0034
0035 resolution=mean(sqrt(2*area(md)));
0036 md2=model;
0037 md2=mesh(md2,'DomainOutlineTemp.exp',resolution);
0038
0039
0040 fieldvalue=getfield(md,field);
0041 md2=setfield(md2,field,griddata(md.x,md.y,fieldvalue,md2.x,md2.y));
0042
0043 end
0044
0045 function removeholesusage(),
0046 disp('usage: md2=removeholes(md,field)');
0047 end