Changeset 15802
- Timestamp:
- 08/12/13 15:12:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/oldclasses/diagnostic.m
r15771 r15802 1 % STRESSBALANCEclass definition1 %DIAGNOSTIC class definition 2 2 % 3 3 % Usage: 4 % stressbalance=stressbalance();5 6 classdef stressbalance4 % diagnostic=diagnostic(); 5 6 classdef diagnostic 7 7 properties (SetAccess=public) 8 8 spcvx = NaN; … … 45 45 end 46 46 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))]; 50 50 end 51 51 end% }}} 52 52 end 53 53 methods 54 function obj = stressbalance(varargin) % {{{54 function obj = diagnostic(varargin) % {{{ 55 55 switch nargin 56 56 case 0 … … 77 77 78 78 %coefficient to update the viscosity between each iteration of 79 %a stressbalanceaccording to the following formula79 %a diagnostic according to the following formula 80 80 %viscosity(n)=viscosity(n)+viscosity_overshoot(viscosity(n)-viscosity(n-1)) 81 81 obj.viscosity_overshoot=0; … … 94 94 %Early return 95 95 if ~ismember(StressbalanceAnalysisEnum(),analyses), return; end 96 %if ~ismember(StressbalanceAnalysisEnum(),analyses) | (solution==TransientSolutionEnum() & md.transient.is stressbalance==0), return; end97 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); end101 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); 107 107 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); 109 109 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]); 118 118 end 119 119 120 120 %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))), 122 122 md = checkmessage(md,['model is not well posed (singular). You need at least one node with fixed velocity!']); 123 123 end 124 124 %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']); 127 127 end 128 128 %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']); 133 133 end 134 134 end … … 136 136 if md.mesh.dimension==3 & md.flowequation.isFS, 137 137 pos=find(md.mask.vertexongroundedice & md.mesh.vertexonbed); 138 if any(~isnan(md. stressbalance.referential(pos,:))),138 if any(~isnan(md.diagnostic.referential(pos,:))), 139 139 md = checkmessage(md,['no referential should be specified for basal vertices of grounded ice']); 140 140 end 141 md = checkfield(md,' stressbalance.FSreconditioning','>',0);141 md = checkfield(md,'diagnostic.FSreconditioning','>',0); 142 142 end 143 143 end % }}}
Note:
See TracChangeset
for help on using the changeset viewer.