Changeset 4891


Ignore:
Timestamp:
07/29/10 16:27:19 (15 years ago)
Author:
seroussi
Message:

put back penalties for MacAyeal/Pattyn models

Location:
issm/trunk/src/m/classes/public
Files:
2 edited

Legend:

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

    r4870 r4891  
    5454%}}}
    5555%ELEMENTSTYPE{{{1
    56 if size(md.elements_type,1)~=md.numberofelements | size(md.elements_type,2)~=2,
    57         error(['model not consistent: types of elements have not been set properly, run setelementstype first'])
    58 end
    59 if any(ones(md.numberofelements,1)-((md.elements_type(:,1)==HutterFormulationEnum) + (md.elements_type(:,1)==MacAyealFormulationEnum)  + (md.elements_type(:,1)==PattynFormulationEnum)))
    60         error(['model not consistent: types of elements have not been set properly, run setelementstype first'])
    61 end
    62 if any(ones(md.numberofelements,1)-((md.elements_type(:,2)==StokesFormulationEnum) + (md.elements_type(:,2)==NoneFormulationEnum)))
    63         error(['model not consistent: types of elements have not been set properly, run setelementstype first'])
    64 end
     56%Check the size of elements_type
     57fields={'elements_type'};
     58checksize(md,fields,[md.numberofelements 2]);
     59%Check the values of elements_type(1)
     60checkvalues(md,{'elements_type(:,1)'},[MacAyealFormulationEnum() HutterFormulationEnum() PattynFormulationEnum()]);
     61%Check the values of elements_type(2)
     62checkvalues(md,{'elements_type(:,2)'},[StokesFormulationEnum() NoneFormulationEnum()]);
    6563if (md.dim==2),
    66         if (ismember(PattynFormulationEnum,md.elements_type(:,1)) |  ismember(StokesFormulationEnum,md.elements_type(:,2))),
    67                 error(['model not consistent: for a 2d model, only MacAyeal''s and Hutter''s elements are allowed']);
    68         end
     64        checkvalues(md,{'elements_type(:,1)'},[MacAyealFormulationEnum() HutterFormulationEnum()]);
    6965end
    7066if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0),
    7167        error(['model not consistent: no elements type set for this model. at least one of ismacayealpattyn, ishutter and isstokes need to be =1']);
    72 end
    73 if (md.analysis_type==DiagnosticSolutionEnum & any(ismember(MacAyealFormulationEnum,md.elements_type(:,1)) & ismember(PattynFormulationEnum,md.elements_type(:,1))))
    74         error(['model not consistent: coupling MacAyeal/Pattyn not implemented yet']);
    75 end
    76 if (md.isstokes & md.analysis_type==Transient3DSolutionEnum());
    77         error(['model not consistent: Stokes transient not implemented yet']);
    7868end
    7969%}}}
  • issm/trunk/src/m/classes/public/setelementstype.m

    r3994 r4891  
    107107if ~isnan(bordergrids2d),
    108108        penalties=[];
    109         for     i=1:numlayers,
    110                 penalties=[penalties [bordergrids2d+md.numberofgrids2d*(i-1)]];
     109        for     i=1:numlayers-1,
     110                penalties=[penalties; [bordergrids2d bordergrids2d+md.numberofgrids2d*(i)]];
    111111        end
    112112        md.penalties=penalties;
Note: See TracChangeset for help on using the changeset viewer.