Changeset 2737


Ignore:
Timestamp:
01/04/10 14:26:01 (15 years ago)
Author:
Eric.Larour
Message:

meshnodensity: used to include rifts inside existing mesh: creates mesh without density specification. Densities of the PSLG domain
outlines are used.
meshplug: plug mesh into another one.
meshyamsrecreateriftsegments: plugin for yams meshing routine to refine around rifts.
rifttipsrefine,meshprocessrifts moved from upper directory mesh/
meshaddrifts: add rifts (specified in a rift outline) to an existing mesh! Kicks some serious ass!
updateriftindexing: used in meshaddrifts. reindexes rifts according to new mesh.

Location:
issm/trunk/src/m/classes/public/mesh
Files:
7 added
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/mesh/meshyams.m

    r2688 r2737  
    5454else
    5555        md=mesh(md,domainoutline,riftoutline,resolution);
     56        md=meshprocessrifts(md);
    5657end
    5758disp(['Initial mesh, number of elements: ' num2str(md.numberofelements)]);
     
    9091        md=YamsCall(md,field,hmin,hmax,gradation(i),epsilon);
    9192
     93        %if we have rifts, we just messed them up, we need to recreate the segments that constitute those
     94        %rifts, because the segments are used in YamsCall to freeze the rifts elements during refinement.
     95        if md.numrifts,
     96                md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     97                md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
     98                md.segments=findsegments(md);
     99                md=meshyamsrecreateriftsegments(md);
     100        end
     101
    92102end
    93103       
     
    123133end
    124134md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
     135
     136%deal with rifts
     137if md.numrifts,
     138        %first, recreate rift segments
     139        md=meshyamsrecreateriftsegments(md);
     140
     141        %using the segments, recreate the penaltypairs
     142        for j=1:md.numrifts,
     143                rift=md.rifts(j);
     144
     145                %build normals and lengths of segments:
     146                lengths=sqrt((md.x(rift.segments(:,1))-md.x(rift.segments(:,2))).^2 + (md.y(rift.segments(:,1))-md.y(rift.segments(:,2))).^2 );
     147                normalsx=cos(atan2((md.x(rift.segments(:,1))-md.x(rift.segments(:,2))) , (md.y(rift.segments(:,2))-md.y(rift.segments(:,1)))));
     148                normalsy=sin(atan2((md.x(rift.segments(:,1))-md.x(rift.segments(:,2))) , (md.y(rift.segments(:,2))-md.y(rift.segments(:,1)))));
     149
     150                %ok, build penaltypairs:
     151                numpenaltypairs=length(rift.segments)/2-1;
     152                rift.penaltypairs=zeros(numpenaltypairs,7);
     153
     154                for i=1:numpenaltypairs,
     155                        rift.penaltypairs(i,1)=rift.segments(i,2);
     156                        rift.penaltypairs(i,2)=rift.segments(end-i,2);
     157                        rift.penaltypairs(i,3)=rift.segments(i,3);
     158                        rift.penaltypairs(i,4)=rift.segments(end-i,3);
     159                        rift.penaltypairs(i,5)=normalsx(i)+normalsx(i+1);
     160                        rift.penaltypairs(i,6)=normalsy(i)+normalsy(i+1);
     161                        rift.penaltypairs(i,7)=(lengths(i)+lengths(i+1))/2;
     162                end
     163                %renormalize norms:
     164                norms=sqrt(rift.penaltypairs(:,5).^2+rift.penaltypairs(:,6).^2);
     165                rift.penaltypairs(:,5)=rift.penaltypairs(:,5)./norms;
     166                rift.penaltypairs(:,6)=rift.penaltypairs(:,6)./norms;
     167
     168                md.rifts(j)=rift;
     169        end
     170
     171end
     172
     173
     174
     175
     176
Note: See TracChangeset for help on using the changeset viewer.