Changeset 18309
- Timestamp:
- 07/31/14 10:32:07 (11 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/flowequation.m
r18227 r18309 128 128 function md = checkconsistency(obj,md,solution,analyses) % {{{ 129 129 130 if ismember(StressbalanceAnalysisEnum(),analyses), 131 132 md = checkfield(md,'fieldname','flowequation.isSIA','numel',[1],'values',[0 1]); 133 md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0 1]); 134 md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0 1]); 135 md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0 1]); 136 md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]); 137 md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'}); 138 md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'}); 139 md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'}); 140 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.); 141 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>',0.); 142 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.); 143 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>',0.); 144 md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5); 145 md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]); 146 md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices 1],'values',[0 1]); 147 md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices 1],'values',[0 1]); 148 if strcmp(domaintype(md.mesh),'2Dhorizontal') 149 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]); 150 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]); 151 elseif strcmp(domaintype(md.mesh),'2Dvertical') 152 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[2,4,5]); 153 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[2,4,5]); 154 elseif strcmp(domaintype(md.mesh),'3D'), 155 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:8]); 156 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:8]); 157 else 158 error('Case not supported yet'); 159 end 160 if ~(obj.isSIA || obj.isSSA || obj.isL1L2 || obj.isHO || obj.isFS), 161 md = checkmessage(md,['no element types set for this model']); 162 end 130 131 %Early return 132 if (~ismember(StressbalanceAnalysisEnum(),analyses) & ~ismember(StressbalanceSIAAnalysisEnum(),analyses)) | (solution==TransientSolutionEnum() & md.transient.isstressbalance==0), return; end 133 134 md = checkfield(md,'fieldname','flowequation.isSIA','numel',[1],'values',[0 1]); 135 md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0 1]); 136 md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0 1]); 137 md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0 1]); 138 md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]); 139 md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'}); 140 md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'}); 141 md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'}); 142 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.); 143 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>',0.); 144 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.); 145 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>',0.); 146 md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5); 147 md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]); 148 md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices 1],'values',[0 1]); 149 md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices 1],'values',[0 1]); 150 if strcmp(domaintype(md.mesh),'2Dhorizontal') 151 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]); 152 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]); 153 elseif strcmp(domaintype(md.mesh),'2Dvertical') 154 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[2,4,5]); 155 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[2,4,5]); 156 elseif strcmp(domaintype(md.mesh),'3D'), 157 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:8]); 158 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:8]); 159 else 160 error('Case not supported yet'); 161 end 162 if ~(obj.isSIA || obj.isSSA || obj.isL1L2 || obj.isHO || obj.isFS), 163 md = checkmessage(md,['no element types set for this model']); 163 164 end 164 165 if ismember(StressbalanceSIAAnalysisEnum(),analyses), -
issm/trunk-jpl/src/m/classes/flowequation.py
r18227 r18309 73 73 def checkconsistency(self,md,solution,analyses): # {{{ 74 74 75 if StressbalanceAnalysisEnum() in analyses: 76 md = checkfield(md,'fieldname','flowequation.isSIA','numel',[1],'values',[0,1]) 77 md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0,1]) 78 md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0,1]) 79 md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0,1]) 80 md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0,1]) 81 md = checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble']) 82 md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4']) 83 md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart']) 84 md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices],'values',[0,1]) 85 md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices],'values',[0,1]) 86 md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices],'values',[0,1]) 87 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.) 88 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.) 89 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>',0.) 90 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>',0.) 91 md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',.5) 92 if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'): 93 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2]) 94 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements],'values',[1,2]) 95 elif m.strcmp(md.mesh.domaintype(),'3D'): 96 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',numpy.arange(0,8+1)) 97 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements],'values',numpy.arange(0,8+1)) 98 else: 99 raise RuntimeError('mesh type not supported yet') 100 if not (self.isSIA or self.isSSA or self.isL1L2 or self.isHO or self.isFS): 101 md.checkmessage("no element types set for this model") 75 #Early return 76 if (StressbalanceAnalysisEnum() not in analyses and StressbalanceSIAAnalysisEnum() not in analyses) or (solution==TransientSolutionEnum() and not md.transient.isstressbalance): 77 return md 78 79 md = checkfield(md,'fieldname','flowequation.isSIA','numel',[1],'values',[0,1]) 80 md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0,1]) 81 md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0,1]) 82 md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0,1]) 83 md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0,1]) 84 md = checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble']) 85 md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4']) 86 md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart']) 87 md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices],'values',[0,1]) 88 md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices],'values',[0,1]) 89 md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices],'values',[0,1]) 90 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.) 91 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.) 92 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>',0.) 93 md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>',0.) 94 md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',.5) 95 if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'): 96 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2]) 97 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements],'values',[1,2]) 98 elif m.strcmp(md.mesh.domaintype(),'3D'): 99 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',numpy.arange(0,8+1)) 100 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements],'values',numpy.arange(0,8+1)) 101 else: 102 raise RuntimeError('mesh type not supported yet') 103 if not (self.isSIA or self.isSSA or self.isL1L2 or self.isHO or self.isFS): 104 md.checkmessage("no element types set for this model") 102 105 103 106 if StressbalanceSIAAnalysisEnum() in analyses:
Note:
See TracChangeset
for help on using the changeset viewer.