Changeset 5375


Ignore:
Timestamp:
08/18/10 13:58:29 (15 years ago)
Author:
seroussi
Message:

test eismint mass conservation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/test/NightlyRun/test1201.m

    r5106 r5375  
    1 %This test is a test from the EISMINT for Ice shelves
    2 % Vincent Rommelaere 1996
     1%This test is a test from the EISMINT for Ice shelves Vincent Rommelaere 1996
    32
    4 %The goal is to test the prognostic model
    5 %md=bamg(model,'domain','DomainOutline.exp','hmax',4550);
    6 md=bamg(model,'domain','../Exp/SquareEISMINT.exp','hmax',3000);
    7 md=geography(md,'all','');
    8 md=parameterize(md,'../Par/SquareEISMINT.par');
    9 md=setelementstype(md,'macayeal','all');
     3results={};
    104
    11 disp('      initial velocity');
    12 md.vx=zeros(md.numberofgrids,1);
    13 md.vy=-400*ones(md.numberofgrids,1);
    14 md.vz=zeros(md.numberofgrids,1);
     5for type=1:3;
     6        %The goal is to test the prognostic model
     7        md=bamg(model,'domain','../Exp/SquareEISMINT.exp','hmax',3000);
     8        md=geography(md,'all','');
     9        md=parameterize(md,'../Par/SquareEISMINT.par');
     10        md=setelementstype(md,'macayeal','all');
    1511
    16 %analytical test
    17 md.spcvelocity(:,1:3)=1;
    18 md.spcvelocity(:,4)=0;
    19 md.spcvelocity(:,5)=-400;
    20 md.spcvelocity(1,1)=0;
    21 md.prognostic_DG=1;
     12        disp('      initial velocity');
     13        md.vx=zeros(md.numberofgrids,1);
     14        md.vy=-400*ones(md.numberofgrids,1);
     15        md.vz=zeros(md.numberofgrids,1);
    2216
    23 %Launch many prognostic as we don't really want a transient
    24 %FOR NOW:
    25 i=0;
    26 time=0;
    27 md.dummy=struct();
    28 pos=find(md.y>199999.9);
    29 connectivity=full(sparse(md.elements(:),1,1));
    30 while(time<500),
    31         disp(['step ' num2str(i) '/' num2str(500/md.dt)]);
    32         i=i+1;
    33         time=time+md.dt;
    34         md=solve(md,'analysis_type',PrognosticSolutionEnum);
    35         thickness   =zeros(md.numberofgrids,1);
    36         connectivity=sparse(md.results.PrognosticSolution.Thickness.index(:),1,1);
    37         thickness   =sparse(md.results.PrognosticSolution.Thickness.index(:),1,md.results.PrognosticSolution.Thickness.value(:));
    38         md.thickness=full(thickness./connectivity);
    39         md.thickness(pos)=500+100*sin(2*pi*time/200)*ones(size(pos,1),1);
    40         md.surface=md.bed+md.thickness;
    41         md.dummy(i).thickness=md.thickness;
    42         %plotmodel(md,'data',md.thickness,'sectionvalue','CrossLine.exp')
     17        %analytical test
     18        md.spcvelocity(:,1:3)=1;
     19        md.spcvelocity(:,4)=0;
     20        md.spcvelocity(:,5)=-400;
     21        md.spcvelocity(1,1)=0;
     22        if type==1,
     23                md.artificial_diffusivity=1;
     24                md.prognostic_DG=0;
     25        elseif type==2,
     26                md.artificial_diffusivity=0;
     27                md.prognostic_DG=0;
     28        elseif type==3,
     29                md.prognostic_DG=1;
     30        end
     31
     32        %Launch many prognostic as we don't really want a transient
     33        %FOR NOW:
     34        i=0;
     35        time=0;
     36        md.dummy=struct();
     37        pos=find(md.y>199999.9);
     38        connectivity=full(sparse(md.elements(:),1,1));
     39        while(time<500),
     40                disp(['step ' num2str(i) '/' num2str(500/md.dt)]);
     41                i=i+1;
     42                time=time+md.dt;
     43                md=solve(md,'analysis_type',PrognosticSolutionEnum);
     44                md.thickness=PatchToVec(md.results.PrognosticSolution.Thickness);
     45                md.thickness(pos)=500+100*sin(2*pi*time/200)*ones(size(pos,1),1);
     46                md.surface=md.bed+md.thickness;
     47                md.dummy(i).thickness=md.thickness;
     48        end
     49        results{type}=md.thickness;
    4350end
    4451
    4552%plot results
    46 plotmodel(md,'data',md.thickness)
    47 %plotmodel(md,'data',[md.thickness 500+100*sin(2*pi/200*(500-md.y/400))],'sectionvalue','../Exp/CrossLineEISMINT.exp')
     53[elements,x,y,z,s,h1]=SectionValues(md,results{1},'../Exp/CrossLineEISMINT.exp',100);
     54[elements,x,y,z,s,h2]=SectionValues(md,results{2},'../Exp/CrossLineEISMINT.exp',100);
     55[elements,x,y,z,s,h3]=SectionValues(md,results{3},'../Exp/CrossLineEISMINT.exp',100);
     56[elements,x,y,z,s,hth]=SectionValues(md, 500+100*sin(2*pi/200*(500-md.y/400)),'../Exp/CrossLineEISMINT.exp',100);
     57plot(s,h1,'r',s,h2,'b',s,h3,'g',s,hth,'k')
     58legend('Art. diff.','No Art. diff.','Discontinue','Theorique')
     59
     60set(gcf,'Color','w')
     61printmodel('eismintmasscthickness','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
    4862
    4963%Fields and tolerances to track changes
    5064field_names     ={ ...
    51         'Thickness', ...
     65        'ThicknessArtDigg','ThicknessNoArtDiff','ThicknessDG' ...
    5266};
    5367field_tolerances={...
    54         1e-13, ...
     68        1e-13, 1e-13, 1e-13...
    5569};
    5670field_values={
    57         md.thickness, ...
     71        results{1}, ...
     72        results{2}, ...
     73        results{3}, ...
    5874};
Note: See TracChangeset for help on using the changeset viewer.