Changeset 13329


Ignore:
Timestamp:
09/11/12 14:57:54 (13 years ago)
Author:
Mathieu Morlighem
Message:

CHG: ContourToNodes only takes contour names (no structure) so that the module is compatible with python

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/mesh/bamg.m

    r13009 r13329  
    6464        domainfile=getfieldvalue(options,'domain');
    6565        if ~exist(domainfile,'file') error(['bamg error message: file ' domainfile ' not found ']); end
     66        domain=expread(domainfile);
     67
     68        %Write temporary file, with only the domain outline (exclude holes)
     69        expwrite(domain(1),[domainfile '_TEMPouterboundary.exp']);
    6670
    6771        %Build geometry
    68         domain=expread(domainfile);
    6972        count=0;
    7073        for i=1:length(domain),
     
    7780                %Checks that all holes are INSIDE the principle domain outline
    7881                if i>1,
    79                         flags=ContourToNodes(domain(i).x,domain(i).y,domain(1),0);
     82                        flags=ContourToNodes(domain(i).x,domain(i).y,[domainfile '_TEMPouterboundary.exp'],0);
    8083                        if any(~flags),
    8184                                error('bamg error message: All holes should be stricly inside the principal domain');
     
    106109
    107110                        %detect wether all points of the rift are inside the domain
    108                         flags=ContourToNodes(rift(i).x,rift(i).y,domain(1),0);
     111                        flags=ContourToNodes(rift(i).x,rift(i).y,[domainfile '_TEMPouterboundary.exp'],0);
    109112                        if ~flags,
    110113                                error('one Rift has all his points outside of the domain outline'),
     
    238241       
    239242                %only keep those inside
    240                 flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),domain(1),0);
     243                flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),[domainfile '_TEMPouterboundary.exp'],0);
    241244                requiredvertices=requiredvertices(find(flags),:);
    242245
     
    252255        %process geom
    253256        %bamg_geometry=processgeometry(bamg_geometry,getfieldvalue(options,'tol',NaN),domain(1));
     257        delete([domainfile '_TEMPouterboundary.exp']);
    254258
    255259elseif isstruct(md.private.bamg) & isfield(md.private.bamg,'geometry'),
Note: See TracChangeset for help on using the changeset viewer.