Changeset 13048


Ignore:
Timestamp:
08/15/12 17:09:32 (13 years ago)
Author:
Mathieu Morlighem
Message:

NEW: added support l1l2 equations (still under development)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/parameterization/setflowequation.m

    r13028 r13048  
    1111%   a string 'all' will be considered as the entire domain
    1212%   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
     13%   NB: l1l2 cannot currently be coupled to any other ice flow model
    1314%
    1415%   Usage:
     
    5253
    5354%check that each element has at least one flag
    54 if any(hutterflag+ macayealflag+pattynflag+stokesflag==0),
    55         error('setflowequation error message: elements type not assigned, must be specified')
     55if any(hutterflag+macayealflag+pattynflag+l1l2flag+stokesflag==0),
     56        error('elements type not assigned, must be specified')
    5657end
    5758
    5859%check that each element has only one flag
    59 if any(hutterflag+ macayealflag+pattynflag+stokesflag>1),
     60if any(hutterflag+macayealflag+pattynflag+l1l2flag+stokesflag>1),
    6061        disp('setflowequation warning message: some elements have several types, higher order type is used for them')
    6162        hutterflag(find(hutterflag & macayealflag))=0;
     
    6465end
    6566
    66 %Check that no pattyn or stokes for 2d mesh
     67%check that l1l2 is not coupled to any other model for now
     68if any(l1l2flag) & any(hutterflag | macayealflag | pattynflag | stokesflag)
     69        error('l1l2 cannot be coupled to any other model');
     70end
     71
     72%Check that no l1l2 or pattyn or stokes for 2d mesh
    6773if (md.mesh.dimension==2),
    68         if any(stokesflag | pattynflag)
    69                 error('setflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')
     74        if any(l1l2flag | stokesflag | pattynflag)
     75                error('stokes and pattyn elements not allowed in 2d mesh, extrude it first')
    7076        end
    7177end
     
    7379%Stokes can only be used alone for now:
    7480if any(stokesflag) &any(hutterflag),
    75         error('setflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere')
     81        error('stokes cannot be used with any other model for now, put stokes everywhere')
    7682end
    7783
     
    8389nodeonpattyn=zeros(md.mesh.numberofvertices,1);
    8490nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
     91nodeonl1l2=zeros(md.mesh.numberofvertices,1);
     92nodeonl1l2(md.mesh.elements(find(l1l2flag),:))=1;
    8593nodeonstokes=zeros(md.mesh.numberofvertices,1);
    8694noneflag=zeros(md.mesh.numberofelements,1);
     
    236244md.flowequation.element_equation(find(hutterflag))=1;
    237245md.flowequation.element_equation(find(macayealflag))=2;
     246md.flowequation.element_equation(find(l1l2flag))=8;
    238247md.flowequation.element_equation(find(pattynflag))=3;
    239248md.flowequation.element_equation(find(stokesflag))=4;
     
    253262pos=find(nodeonmacayeal);
    254263md.flowequation.vertex_equation(pos)=2;
     264pos=find(nodeonl1l2);
     265md.flowequation.vertex_equation(pos)=8;
    255266pos=find(nodeonpattyn);
    256267md.flowequation.vertex_equation(pos)=3;
    257 pos=find(nodeonhutter);
    258 md.flowequation.vertex_equation(pos)=1;
    259268pos=find(nodeonmacayealpattyn);
    260269md.flowequation.vertex_equation(pos)=5;
     
    276285md.flowequation.ismacayealpattyn=double(any(md.flowequation.element_equation==2 | md.flowequation.element_equation==3));
    277286md.flowequation.isstokes=double(any(md.flowequation.element_equation==4));
     287md.flowequation.isl1l2=double(any(md.flowequation.element_equation==8));
    278288
    279289return
Note: See TracChangeset for help on using the changeset viewer.