Changeset 4040


Ignore:
Timestamp:
06/11/10 15:57:13 (15 years ago)
Author:
jschierm
Message:

ProfileProjectOntoMesh.m: Allow profile to start and/or end externally and/or cross holes in the model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/Mesh/ProfileProjectOntoMesh.m

    r3735 r4040  
    2525processed_y=[];
    2626for i=1:numel(indices),
    27         if(((indices(i)-floor(indices(i)))~=0) & ((ceil(indices(i))-indices(i))~=0))
     27        if(((indices(i)-floor(indices(i)))~=0) && ((ceil(indices(i))-indices(i))~=0))
    2828                processed_indices=[processed_indices;floor(indices(i))];
    2929                processed_x=[processed_x;x0(i)];
     
    3232end
    3333
    34 %now merge profile.x,profile.y with processed_x,processed_y, at locatoins processed_indices:
     34%now merge profile.x,profile.y with processed_x,processed_y, at locations processed_indices:
    3535newx=profile.x;
    3636newy=profile.y;
     
    4949node_in_element=NodeInElement(newx,newy,md.elements,md.x,md.y,md.nodeconnectivity);
    5050
     51% eliminate nodes that don't fall in any element
     52% (profile may start and/or end externally and/or cross holes in the model)
     53
     54ind=find(node_in_element(:,9)>0);
     55newx=newx(ind,:);
     56newy=newy(ind,:);
     57node_in_element=node_in_element(ind,:);
     58
    5159mesh_profile=[newx(1:end-1) newy(1:end-1) newx(2:end) newy(2:end) zeros(length(newy(2:end)),1)];
    5260
Note: See TracChangeset for help on using the changeset viewer.