Changeset 3111
- Timestamp:
- 02/24/10 09:46:29 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/geography2.m
r3099 r3111 33 33 elementonland(wrongelements)=1; 34 34 35 %any element with its barycentre on land should be on land: 35 %any element with its barycentre on land should be on land: (only if landname is an expfile) 36 if ischar(landname), 36 37 weights={[1;1;1],[2;1;1],[1;2;1],[1;1;2]}; 37 for i=1:length(weights), 38 xelem=x(md.elements)*weights{i}/sum(weights{i}); 39 yelem=y(md.elements)*weights{i}/sum(weights{i}); 38 for i=1:length(weights), 39 xelem=x(md.elements)*weights{i}/sum(weights{i}); 40 yelem=y(md.elements)*weights{i}/sum(weights{i}); 41 end 42 baryonland=ContourToNodes(xelem,yelem,expread(landname,1),1); 43 pos=find(~baryonland); elementonland(pos)=0; 44 pos=find(baryonland); elementonland(pos)=1; 40 45 end 41 baryonland=ContourToNodes(xelem,yelem,expread(landname,1),1);42 pos=find(~baryonland); elementonland(pos)=0;43 pos=find(baryonland); elementonland(pos)=1;44 46 45 47 %figure out which elements on land are actually in the middle of the ocean!
Note:
See TracChangeset
for help on using the changeset viewer.