Changeset 3305
- Timestamp:
- 03/19/10 12:42:33 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/bamg.m
r3301 r3305 4 4 % Available options (for more details see ISSM website http://issm.jpl.nasa.gov/): 5 5 % 6 % - domain: followed by an ARGUS file that prescribes the domain outline (rifts and holes)6 % - domain: followed by an ARGUS file that prescribes the domain outline 7 7 % - hmin : minimum edge length (default is 10^-100) 8 8 % - hmax : maximum esge length (default is 10^100) … … 37 37 % - verbose : level of verbosity (default is 1) 38 38 % 39 % - rifts : followed by an ARGUS file that prescribes the rifts 40 % - toltip: tolerance to move tip on an existing point of the domain outline 41 % 39 42 % Examples: 40 43 % md=bamg(md,'domain','DomainOutline.exp','hmax',3000); … … 139 142 y=det([det([x1 y1; x2 y2]) y1-y2;det([x3 y3; x4 y4]) y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]); 140 143 141 %Add intersection point to Vertices 142 bamg_geometry.Vertices=[bamg_geometry.Vertices; x y 1]; 143 count=count+1; 144 145 %Decompose the crossing edge in 2 subedges 146 pos=find(bamg_geometry.Edges(:,1)==i1 & bamg_geometry.Edges(:,2)==i2); 147 if isempty(pos) error('bamg error message: a problem occured...'); end 148 bamg_geometry.Edges=[bamg_geometry.Edges(1:pos-1,:);... 149 bamg_geometry.Edges(pos,1) count bamg_geometry.Edges(pos,3);... 150 count bamg_geometry.Edges(pos,2) bamg_geometry.Edges(pos,3);... 151 bamg_geometry.Edges(pos+1:end,:)]; 152 153 %OK, no we can add our own rift 154 nods=rift(i).nods-1; 155 bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(2:end) rift(i).y(2:end) ones(nods,1)]]; 156 bamg_geometry.Edges=[bamg_geometry.Edges;... 157 count count+1 2 ;... 158 [transpose(count+1:count+nods-1) transpose([count+2:count+nods]) 2*ones(nods-1,1)]]; 159 count=count+nods; 160 161 break; 144 segdis= sqrt((x4-x3)^2+(y4-y3)^2); 145 tipdis=[sqrt((x-x3)^2+(y-y3)^2) sqrt((x-x4)^2+(y-y4)^2)]; 146 147 if (min(tipdis)/segdis) < getfieldvalue(options,'toltip',0), 148 disp('moving tip-domain intersection point'); 149 150 %Get position of the closest point 151 if tipdis(1)>tipdis(2), 152 pos=i2; 153 else 154 pos=i1; 155 end 156 157 %This point is only in Vertices (number pos). 158 %OK, no we can add our own rift 159 nods=rift(i).nods-1; 160 bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(2:end) rift(i).y(2:end) ones(nods,1)]]; 161 bamg_geometry.Edges=[bamg_geometry.Edges;... 162 i1 count+1 2 ;... 163 [transpose(count+1:count+nods-1) transpose([count+2:count+nods]) 2*ones(nods-1,1)]]; 164 count=count+nods; 165 bamg_geometry.Edges 166 167 break; 168 169 else 170 %Add intersection point to Vertices 171 bamg_geometry.Vertices=[bamg_geometry.Vertices; x y 1]; 172 count=count+1; 173 174 %Decompose the crossing edge in 2 subedges 175 pos=find(bamg_geometry.Edges(:,1)==i1 & bamg_geometry.Edges(:,2)==i2); 176 if isempty(pos) error('bamg error message: a problem occured...'); end 177 bamg_geometry.Edges=[bamg_geometry.Edges(1:pos-1,:);... 178 bamg_geometry.Edges(pos,1) count bamg_geometry.Edges(pos,3);... 179 count bamg_geometry.Edges(pos,2) bamg_geometry.Edges(pos,3);... 180 bamg_geometry.Edges(pos+1:end,:)]; 181 182 %OK, no we can add our own rift 183 nods=rift(i).nods-1; 184 bamg_geometry.Vertices=[bamg_geometry.Vertices; [rift(i).x(2:end) rift(i).y(2:end) ones(nods,1)]]; 185 bamg_geometry.Edges=[bamg_geometry.Edges;... 186 count count+1 2 ;... 187 [transpose(count+1:count+nods-1) transpose([count+2:count+nods]) 2*ones(nods-1,1)]]; 188 count=count+nods; 189 190 break; 191 end 162 192 end 163 193 end
Note:
See TracChangeset
for help on using the changeset viewer.