Changeset 15802


Ignore:
Timestamp:
08/12/13 15:12:21 (12 years ago)
Author:
seroussi
Message:

BUG: diagnostic class is not stressbalance

File:
1 edited

Legend:

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

    r15771 r15802  
    1 %STRESSBALANCE class definition
     1%DIAGNOSTIC class definition
    22%
    33%   Usage:
    4 %      stressbalance=stressbalance();
    5 
    6 classdef stressbalance
     4%      diagnostic=diagnostic();
     5
     6classdef diagnostic
    77        properties (SetAccess=public)
    88                spcvx                    = NaN;
     
    4545                        end
    4646
    47                         if size(md.stressbalance.icefront,2)==3 || size(md.stressbalance.icefront,2)==5,
    48                                 front=md.stressbalance.icefront;
    49                                 md.stressbalance.icefront=[front 1*md.mask.elementonfloatingice(front(:,end))];
     47                        if size(md.diagnostic.icefront,2)==3 || size(md.diagnostic.icefront,2)==5,
     48                                front=md.diagnostic.icefront;
     49                                md.diagnostic.icefront=[front 1*md.mask.elementonfloatingice(front(:,end))];
    5050                        end
    5151                end% }}}
    5252        end
    5353        methods
    54                 function obj = stressbalance(varargin) % {{{
     54                function obj = diagnostic(varargin) % {{{
    5555                        switch nargin
    5656                                case 0
     
    7777
    7878                         %coefficient to update the viscosity between each iteration of
    79                          %a stressbalance according to the following formula
     79                         %a diagnostic according to the following formula
    8080                         %viscosity(n)=viscosity(n)+viscosity_overshoot(viscosity(n)-viscosity(n-1))
    8181                         obj.viscosity_overshoot=0;
     
    9494                        %Early return
    9595                        if ~ismember(StressbalanceAnalysisEnum(),analyses), return; end
    96                         %if ~ismember(StressbalanceAnalysisEnum(),analyses) |  (solution==TransientSolutionEnum() & md.transient.isstressbalance==0), return; end
    97 
    98                         md = checkfield(md,'stressbalance.spcvx','forcing',1);
    99                         md = checkfield(md,'stressbalance.spcvy','forcing',1);
    100                         if md.mesh.dimension==3, md = checkfield(md,'stressbalance.spcvz','forcing',1); end
    101                         md = checkfield(md,'stressbalance.restol','size',[1 1],'>',0,'NaN',1);
    102                         md = checkfield(md,'stressbalance.reltol','size',[1 1]);
    103                         md = checkfield(md,'stressbalance.abstol','size',[1 1]);
    104                         md = checkfield(md,'stressbalance.isnewton','numel',[1],'values',[0 1 2]);
    105                         md = checkfield(md,'stressbalance.FSreconditioning','size',[1 1],'NaN',1);
    106                         md = checkfield(md,'stressbalance.viscosity_overshoot','size',[1 1],'NaN',1);
     96                        %if ~ismember(StressbalanceAnalysisEnum(),analyses) |  (solution==TransientSolutionEnum() & md.transient.isdiagnostic==0), return; end
     97
     98                        md = checkfield(md,'diagnostic.spcvx','forcing',1);
     99                        md = checkfield(md,'diagnostic.spcvy','forcing',1);
     100                        if md.mesh.dimension==3, md = checkfield(md,'diagnostic.spcvz','forcing',1); end
     101                        md = checkfield(md,'diagnostic.restol','size',[1 1],'>',0,'NaN',1);
     102                        md = checkfield(md,'diagnostic.reltol','size',[1 1]);
     103                        md = checkfield(md,'diagnostic.abstol','size',[1 1]);
     104                        md = checkfield(md,'diagnostic.isnewton','numel',[1],'values',[0 1 2]);
     105                        md = checkfield(md,'diagnostic.FSreconditioning','size',[1 1],'NaN',1);
     106                        md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1 1],'NaN',1);
    107107                        if md.mesh.dimension==2,
    108                                 md = checkfield(md,'stressbalance.icefront','size',[NaN 4],'NaN',1);
     108                                md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
    109109                        else
    110                                 md = checkfield(md,'stressbalance.icefront','size',[NaN 6],'NaN',1);
    111                         end
    112                         md = checkfield(md,'stressbalance.icefront(:,end)','values',[0 1 2]);
    113                         md = checkfield(md,'stressbalance.maxiter','size',[1 1],'>=',1);
    114                         md = checkfield(md,'stressbalance.referential','size',[md.mesh.numberofvertices 6]);
    115                         md = checkfield(md,'stressbalance.loadingforce','size',[md.mesh.numberofvertices 3]);
    116                         if ~isempty(md.stressbalance.requested_outputs),
    117                                 md = checkfield(md,'stressbalance.requested_outputs','size',[NaN 1]);
     110                                md = checkfield(md,'diagnostic.icefront','size',[NaN 6],'NaN',1);
     111                        end
     112                        md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
     113                        md = checkfield(md,'diagnostic.maxiter','size',[1 1],'>=',1);
     114                        md = checkfield(md,'diagnostic.referential','size',[md.mesh.numberofvertices 6]);
     115                        md = checkfield(md,'diagnostic.loadingforce','size',[md.mesh.numberofvertices 3]);
     116                        if ~isempty(md.diagnostic.requested_outputs),
     117                                md = checkfield(md,'diagnostic.requested_outputs','size',[NaN 1]);
    118118                        end
    119119
    120120                        %singular solution
    121                         if ~(any(~isnan(md.stressbalance.spcvx)) & any(~isnan(md.stressbalance.spcvy))),
     121                        if ~(any(~isnan(md.diagnostic.spcvx)) & any(~isnan(md.diagnostic.spcvy))),
    122122                                md = checkmessage(md,['model is not well posed (singular). You need at least one node with fixed velocity!']);
    123123                        end
    124124                        %CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
    125                         if any(sum(isnan(md.stressbalance.referential),2)~=0 & sum(isnan(md.stressbalance.referential),2)~=6),
    126                                 md = checkmessage(md,['Each line of stressbalance.referential should contain either only NaN values or no NaN values']);
     125                        if any(sum(isnan(md.diagnostic.referential),2)~=0 & sum(isnan(md.diagnostic.referential),2)~=6),
     126                                md = checkmessage(md,['Each line of diagnostic.referential should contain either only NaN values or no NaN values']);
    127127                        end
    128128                        %CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
    129                         if any(sum(isnan(md.stressbalance.referential),2)==0),
    130                                 pos=find(sum(isnan(md.stressbalance.referential),2)==0);
    131                                 if any(abs(dot(md.stressbalance.referential(pos,1:3),md.stressbalance.referential(pos,4:6),2))>eps),
    132                                         md = checkmessage(md,['Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal']);
     129                        if any(sum(isnan(md.diagnostic.referential),2)==0),
     130                                pos=find(sum(isnan(md.diagnostic.referential),2)==0);
     131                                if any(abs(dot(md.diagnostic.referential(pos,1:3),md.diagnostic.referential(pos,4:6),2))>eps),
     132                                        md = checkmessage(md,['Vectors in diagnostic.referential (columns 1 to 3 and 4 to 6) must be orthogonal']);
    133133                                end
    134134                        end
     
    136136                        if md.mesh.dimension==3 & md.flowequation.isFS,
    137137                                pos=find(md.mask.vertexongroundedice & md.mesh.vertexonbed);
    138                                 if any(~isnan(md.stressbalance.referential(pos,:))),
     138                                if any(~isnan(md.diagnostic.referential(pos,:))),
    139139                                        md = checkmessage(md,['no referential should be specified for basal vertices of grounded ice']);
    140140                                end
    141                                 md = checkfield(md,'stressbalance.FSreconditioning','>',0);
     141                                md = checkfield(md,'diagnostic.FSreconditioning','>',0);
    142142                        end
    143143                end % }}}
Note: See TracChangeset for help on using the changeset viewer.