Changeset 5024


Ignore:
Timestamp:
08/06/10 13:31:09 (15 years ago)
Author:
Mathieu Morlighem
Message:

No more expread required to call ContourToNodes

Location:
issm/trunk/src/m
Files:
16 edited

Legend:

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

    r1758 r5024  
    3333                end
    3434                %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);
    3636        end
    3737        if invert,
  • issm/trunk/src/m/classes/public/BasinConstrain2.m

    r1758 r5024  
    3333                end
    3434                %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);
    3636        end
    3737        if invert,
  • issm/trunk/src/m/classes/public/BasinConstrainShelf.m

    r1758 r5024  
    3333                end
    3434                %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);
    3636        end
    3737        if invert,
  • issm/trunk/src/m/classes/public/contourenvelope.m

    r2518 r5024  
    3434if nargin==2,
    3535        %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);
    3737        elemin=(sum(nodein(md.elements),2)==size(md.elements,2));
    3838        %modify element connectivity
  • issm/trunk/src/m/classes/public/contourmassbalance.m

    r2541 r5024  
    2222
    2323%get flag list of elements and nodes inside the contour
    24 nodein=ContourToMesh(md.elements,md.x,md.y,expread(file,1),'node',1);
     24nodein=ContourToMesh(md.elements,md.x,md.y,file,'node',1);
    2525elemin=(sum(nodein(md.elements),2)==size(md.elements,2));
    2626
  • issm/trunk/src/m/classes/public/geography2.m

    r3116 r5024  
    1515%recover elements and grids on land.
    1616if 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);
    1818elseif isfloat(landname),
    1919        if size(landname,1)~=md.numberofelements,
     
    4848                yelem=y(md.elements)*weights{i}/sum(weights{i});
    4949        end
    50         baryonland=ContourToNodes(xelem,yelem,expread(landname,1),1);
     50        baryonland=ContourToNodes(xelem,yelem,landname,1);
    5151        pos=find(~baryonland); elementonland(pos)=0;
    5252        pos=find(baryonland); elementonland(pos)=1;
  • issm/trunk/src/m/classes/public/mesh/meshbamg.m

    r3199 r5024  
    9797        %set gridonwater field
    9898        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);
    100100                md.gridonwater=ones(md.numberofgrids,1);
    101101                md.gridonwater(find(gridground))=0;
  • issm/trunk/src/m/classes/public/mesh/meshexprefine.m

    r1246 r5024  
    3939
    4040%Read domainame file into a matlab array (x,y):
    41 refinearea=ContourToMesh(md.elements,md.x,md.y,expread(domainname,1),'element',1);
     41refinearea=ContourToMesh(md.elements,md.x,md.y,domainname,'element',1);
    4242aires=GetAreas(md.elements,md.x,md.y);
    4343
  • issm/trunk/src/m/classes/public/mesh/meshyams.m

    r3260 r5024  
    8181        %set gridonwater field
    8282        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);
    8484                md.gridonwater=ones(md.numberofgrids,1);
    8585                md.gridonwater(find(gridground))=0;
     
    120120md.elementonsurface=ones(md.numberofelements,1);
    121121if ~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);
    123123        md.gridonwater=ones(md.numberofgrids,1);
    124124        md.gridonwater(find(gridground))=0;
  • issm/trunk/src/m/classes/public/mesh/rifts/meshprocessoutsiderifts.m

    r3269 r5024  
    1212       
    1313        %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);
    1515
    1616        rift=md.rifts(i);
  • issm/trunk/src/m/classes/public/mesh/rifts/meshprocessrifts.m

    r3269 r5024  
    4545
    4646%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);
     47flags=ContourToMesh(md.elements,md.x,md.y,domainoutline,'node',0);
    4848found=0;
    4949for i=1:md.numrifts,
  • issm/trunk/src/m/classes/public/modeldefault/defaultparams.m

    r3760 r5024  
    5252               
    5353        %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');
    5555        %pos=find(highmd.drag);md.drag_coefficient(pos)=10^3;
    5656
     
    7979
    8080        %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');
    8282        %pos=find(weakb);md.rheology_B(pos)=.3*md.rheology_B(pos);
    8383               
  • issm/trunk/src/m/classes/public/plot/processmesh.m

    r4498 r5024  
    2727        if (md.dim==2);
    2828                is2d=1;
    29         else
     29        elseif (md.dim==3),
    3030                if getfieldvalue(options,'layer',0)>=1,
    3131                        is2d=1;
     
    3333                        is2d=0;
    3434                end
     35        else
     36                error(['dim = ' num2str(md.dim) ' not supported yet']);
    3537        end
    3638
  • issm/trunk/src/m/utils/BC/SetIceShelfBC.m

    r4962 r5024  
    1919        icefrontfile=varargin{1};
    2020        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);
    2222        gridonicefront=double(md.gridonboundary & gridinsideicefront);
    2323elseif nargin==1,
  • issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m

    r4877 r5024  
    2323                error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
    2424        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);
    2626        gridonicefront=double(md.gridonboundary & gridinsideicefront);
    2727else
  • issm/trunk/src/m/utils/Geometry/FlagElements.m

    r3346 r5024  
    1 function flag=FlagElements(md,area),
    2 %FLAGELEMENTS - flag the elements in an area
     1function flag=FlagElements(md,region),
     2%FLAGELEMENTS - flag the elements in an region
    33%
    4 %   The area can be given with an exp file, a list of elements.
     4%   The region can be given with an exp file, a list of elements.
    55%
    66%   Usage:
    7 %      flag=FlagElements(md,area);
     7%      flag=FlagElements(md,region);
    88%
    99%   Example:
     
    1414%      flag=FlagElements(md,md.elementonicesheet);
    1515
    16         if ischar(area),
    17                 if isempty(area),
     16        if ischar(region),
     17                if isempty(region),
    1818                        flag=zeros(md.numberofelements,1);
    1919                        invert=0;
    20                 elseif strcmpi(area,'all')
     20                elseif strcmpi(region,'all')
    2121                        flag=ones(md.numberofelements,1);
    2222                        invert=0;
    2323                else
    2424                        %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));
    2727                                invert=1;
    2828                        else
     
    3030                        end
    3131
    32                         %does the area domain 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);
    3535                                flag_nodes=double(md.x<xlim(2) & md.x>xlim(1) &  md.y<ylim(2) & md.y>ylim(1));
    3636                                flag=prod(flag_nodes(md.elements),2);
    3737                        else
    3838                                %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);
    4040                        end
    4141                end
     
    4343                        flag=~flag;
    4444                end
    45         elseif isfloat(area),
    46                 if size(area,1)~=md.numberofelements,
     45        elseif isfloat(region),
     46                if size(region,1)~=md.numberofelements,
    4747                        help FlagElements
    48                         error('Flaglist for area must 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');
    4949                end
    50                 flag=area;
     50                flag=region;
    5151        else
    52                 error('Invalid area option option');
     52                error('Invalid region option option');
    5353        end
    5454end
Note: See TracChangeset for help on using the changeset viewer.