Changeset 5024
- Timestamp:
- 08/06/10 13:31:09 (15 years ago)
- Location:
- issm/trunk/src/m
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/BasinConstrain.m
r1758 r5024 33 33 end 34 34 %ok, flag elements and nodes 35 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y, expread(domain,1),'element and node',2);35 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2); 36 36 end 37 37 if invert, -
issm/trunk/src/m/classes/public/BasinConstrain2.m
r1758 r5024 33 33 end 34 34 %ok, flag elements and nodes 35 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y, expread(domain,1),'element and node',2);35 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2); 36 36 end 37 37 if invert, -
issm/trunk/src/m/classes/public/BasinConstrainShelf.m
r1758 r5024 33 33 end 34 34 %ok, flag elements and nodes 35 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y, expread(domain,1),'element and node',2);35 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2); 36 36 end 37 37 if invert, -
issm/trunk/src/m/classes/public/contourenvelope.m
r2518 r5024 34 34 if nargin==2, 35 35 %get flag list of elements and nodes inside the contour 36 nodein=ContourToMesh(md.elements,md.x,md.y, expread(file,1),'node',1);36 nodein=ContourToMesh(md.elements,md.x,md.y,file,'node',1); 37 37 elemin=(sum(nodein(md.elements),2)==size(md.elements,2)); 38 38 %modify element connectivity -
issm/trunk/src/m/classes/public/contourmassbalance.m
r2541 r5024 22 22 23 23 %get flag list of elements and nodes inside the contour 24 nodein=ContourToMesh(md.elements,md.x,md.y, expread(file,1),'node',1);24 nodein=ContourToMesh(md.elements,md.x,md.y,file,'node',1); 25 25 elemin=(sum(nodein(md.elements),2)==size(md.elements,2)); 26 26 -
issm/trunk/src/m/classes/public/geography2.m
r3116 r5024 15 15 %recover elements and grids on land. 16 16 if ischar(landname), 17 [gridonland,elementonland]=ContourToMesh(elements,x,y, expread(landname,1),'element and node',2);17 [gridonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2); 18 18 elseif isfloat(landname), 19 19 if size(landname,1)~=md.numberofelements, … … 48 48 yelem=y(md.elements)*weights{i}/sum(weights{i}); 49 49 end 50 baryonland=ContourToNodes(xelem,yelem, expread(landname,1),1);50 baryonland=ContourToNodes(xelem,yelem,landname,1); 51 51 pos=find(~baryonland); elementonland(pos)=0; 52 52 pos=find(baryonland); elementonland(pos)=1; -
issm/trunk/src/m/classes/public/mesh/meshbamg.m
r3199 r5024 97 97 %set gridonwater field 98 98 if ~strcmp(groundeddomain,'N/A'), 99 gridground=ContourToMesh(md.elements,md.x,md.y, expread(groundeddomain,1),'node',2);99 gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2); 100 100 md.gridonwater=ones(md.numberofgrids,1); 101 101 md.gridonwater(find(gridground))=0; -
issm/trunk/src/m/classes/public/mesh/meshexprefine.m
r1246 r5024 39 39 40 40 %Read domainame file into a matlab array (x,y): 41 refinearea=ContourToMesh(md.elements,md.x,md.y, expread(domainname,1),'element',1);41 refinearea=ContourToMesh(md.elements,md.x,md.y,domainname,'element',1); 42 42 aires=GetAreas(md.elements,md.x,md.y); 43 43 -
issm/trunk/src/m/classes/public/mesh/meshyams.m
r3260 r5024 81 81 %set gridonwater field 82 82 if ~strcmp(groundeddomain,'N/A'), 83 gridground=ContourToMesh(md.elements,md.x,md.y, expread(groundeddomain,1),'node',2);83 gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2); 84 84 md.gridonwater=ones(md.numberofgrids,1); 85 85 md.gridonwater(find(gridground))=0; … … 120 120 md.elementonsurface=ones(md.numberofelements,1); 121 121 if ~strcmp(groundeddomain,'N/A'), 122 gridground=ContourToMesh(md.elements,md.x,md.y, expread(groundeddomain,1),'node',2);122 gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2); 123 123 md.gridonwater=ones(md.numberofgrids,1); 124 124 md.gridonwater(find(gridground))=0; -
issm/trunk/src/m/classes/public/mesh/rifts/meshprocessoutsiderifts.m
r3269 r5024 12 12 13 13 %first, flag nodes that belong to the domain outline 14 flags=ContourToMesh(md.elements,md.x,md.y, expread(domainoutline,1),'node',0);14 flags=ContourToMesh(md.elements,md.x,md.y,domainoutline,'node',0); 15 15 16 16 rift=md.rifts(i); -
issm/trunk/src/m/classes/public/mesh/rifts/meshprocessrifts.m
r3269 r5024 45 45 46 46 %In case we have rifts that open up the domain outline, we need to open them: 47 flags=ContourToMesh(md.elements,md.x,md.y, expread(domainoutline,1),'node',0);47 flags=ContourToMesh(md.elements,md.x,md.y,domainoutline,'node',0); 48 48 found=0; 49 49 for i=1:md.numrifts, -
issm/trunk/src/m/classes/public/modeldefault/defaultparams.m
r3760 r5024 52 52 53 53 %zones of high md.drag 54 %[rhighmd.drag_coefficient]=ArgusContourToMesh(md.elements,md.x,md.y, expread('HighDrag.exp',1),'node');54 %[rhighmd.drag_coefficient]=ArgusContourToMesh(md.elements,md.x,md.y,'HighDrag.exp','node'); 55 55 %pos=find(highmd.drag);md.drag_coefficient(pos)=10^3; 56 56 … … 79 79 80 80 %zones of shear margin softening 81 %[rweakb]=ArgusContourToMesh(md.elements,md.x,md.y, expread('Weakmd.BPIG.exp',1),'node');81 %[rweakb]=ArgusContourToMesh(md.elements,md.x,md.y,'Weakmd.BPIG.exp','node'); 82 82 %pos=find(weakb);md.rheology_B(pos)=.3*md.rheology_B(pos); 83 83 -
issm/trunk/src/m/classes/public/plot/processmesh.m
r4498 r5024 27 27 if (md.dim==2); 28 28 is2d=1; 29 else 29 elseif (md.dim==3), 30 30 if getfieldvalue(options,'layer',0)>=1, 31 31 is2d=1; … … 33 33 is2d=0; 34 34 end 35 else 36 error(['dim = ' num2str(md.dim) ' not supported yet']); 35 37 end 36 38 -
issm/trunk/src/m/utils/BC/SetIceShelfBC.m
r4962 r5024 19 19 icefrontfile=varargin{1}; 20 20 if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end 21 gridinsideicefront=ContourToMesh(md.elements,md.x,md.y, expread(icefrontfile,1),'node',2);21 gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2); 22 22 gridonicefront=double(md.gridonboundary & gridinsideicefront); 23 23 elseif nargin==1, -
issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
r4877 r5024 23 23 error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']); 24 24 end 25 gridinsideicefront=ContourToMesh(md.elements,md.x,md.y, expread(icefrontfile,1),'node',2);25 gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2); 26 26 gridonicefront=double(md.gridonboundary & gridinsideicefront); 27 27 else -
issm/trunk/src/m/utils/Geometry/FlagElements.m
r3346 r5024 1 function flag=FlagElements(md, area),2 %FLAGELEMENTS - flag the elements in an area1 function flag=FlagElements(md,region), 2 %FLAGELEMENTS - flag the elements in an region 3 3 % 4 % The areacan be given with an exp file, a list of elements.4 % The region can be given with an exp file, a list of elements. 5 5 % 6 6 % Usage: 7 % flag=FlagElements(md, area);7 % flag=FlagElements(md,region); 8 8 % 9 9 % Example: … … 14 14 % flag=FlagElements(md,md.elementonicesheet); 15 15 16 if ischar( area),17 if isempty( area),16 if ischar(region), 17 if isempty(region), 18 18 flag=zeros(md.numberofelements,1); 19 19 invert=0; 20 elseif strcmpi( area,'all')20 elseif strcmpi(region,'all') 21 21 flag=ones(md.numberofelements,1); 22 22 invert=0; 23 23 else 24 24 %make sure that we actually don't want the elements outside the domain outline! 25 if strcmpi( area(1),'~'),26 area=area(2:length(area));25 if strcmpi(region(1),'~'), 26 region=region(2:length(region)); 27 27 invert=1; 28 28 else … … 30 30 end 31 31 32 %does the areadomain outline exist or do we have to look for xlim,ylim in basinzoom?33 if ~exist( area,'file'),34 [xlim,ylim]=basinzoom( area);32 %does the region domain outline exist or do we have to look for xlim,ylim in basinzoom? 33 if ~exist(region,'file'), 34 [xlim,ylim]=basinzoom(region); 35 35 flag_nodes=double(md.x<xlim(2) & md.x>xlim(1) & md.y<ylim(2) & md.y>ylim(1)); 36 36 flag=prod(flag_nodes(md.elements),2); 37 37 else 38 38 %ok, flag elements 39 flag=ContourToMesh(md.elements(:,1:3),md.x,md.y, expread(area,1),'element',1);39 flag=ContourToMesh(md.elements(:,1:3),md.x,md.y,region,'element',1); 40 40 end 41 41 end … … 43 43 flag=~flag; 44 44 end 45 elseif isfloat( area),46 if size( area,1)~=md.numberofelements,45 elseif isfloat(region), 46 if size(region,1)~=md.numberofelements, 47 47 help FlagElements 48 error('Flaglist for areamust be of same size as number of elements in model');48 error('Flaglist for region must be of same size as number of elements in model'); 49 49 end 50 flag= area;50 flag=region; 51 51 else 52 error('Invalid areaoption option');52 error('Invalid region option option'); 53 53 end 54 54 end
Note:
See TracChangeset
for help on using the changeset viewer.