Changeset 20322


Ignore:
Timestamp:
03/18/16 09:04:47 (9 years ago)
Author:
Eric.Larour
Message:

CHG: slr: check against the mask to ensure conservation of mass.

model: additional checks.

Location:
issm/trunk-jpl/src/m/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/model.m

    r20059 r20322  
    513513
    514514                        %recreate segments
    515                         if isa(md1.mesh,'mesh2d'),
     515                        if isa(md1.mesh,'mesh2d') | isa(md1.mesh','mesh3dsurface'),
    516516                                md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices);
    517517                                md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
  • issm/trunk-jpl/src/m/classes/slr.m

    r20281 r20322  
    5656
    5757                        if ~ismember(SealevelriseAnalysisEnum(),analyses), return; end
    58                         md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
     58                        md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
     59                        %md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
    5960                        md = checkfield(md,'fieldname','slr.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
    6061                        md = checkfield(md,'fieldname','slr.love_h','NaN',1,'Inf',1);
     
    6970                        if (size(self.love_h,1) ~= size(self.love_k,1)),
    7071                                error('slr error message: love numbers should be provided at the same level of accuracy');
     72                        end
     73
     74                        %cross check that whereever we have an ice load, the mask is <0 on each vertex:
     75                        pos=find(self.deltathickness);
     76                        maskpos=md.mask.ice_levelset(md.mesh.elements(pos,:));
     77                        [els,vertices]=find(maskpos>0);
     78                        if length(els),
     79                                error('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!');
    7180                        end
    7281
     
    94103                end % }}}
    95104                function marshall(self,md,fid) % {{{
    96                         WriteData(fid,'object',self,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',1);
     105                        WriteData(fid,'object',self,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',2);
     106                        %WriteData(fid,'object',self,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',1);
    97107                        WriteData(fid,'data',self.sealevel,'mattype',1,'format','DoubleMat','enum',SealevelEnum(),'timeserieslength',md.mesh.numberofvertices+1);
    98108                        WriteData(fid,'object',self,'class','sealevelrise','fieldname','reltol','format','Double');
Note: See TracChangeset for help on using the changeset viewer.