Changeset 13048
- Timestamp:
- 08/15/12 17:09:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/parameterization/setflowequation.m
r13028 r13048 11 11 % a string 'all' will be considered as the entire domain 12 12 % You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling' 13 % NB: l1l2 cannot currently be coupled to any other ice flow model 13 14 % 14 15 % Usage: … … 52 53 53 54 %check that each element has at least one flag 54 if any(hutterflag+ macayealflag+pattynflag+stokesflag==0),55 error(' setflowequation error message:elements type not assigned, must be specified')55 if any(hutterflag+macayealflag+pattynflag+l1l2flag+stokesflag==0), 56 error('elements type not assigned, must be specified') 56 57 end 57 58 58 59 %check that each element has only one flag 59 if any(hutterflag+ macayealflag+pattynflag+stokesflag>1),60 if any(hutterflag+macayealflag+pattynflag+l1l2flag+stokesflag>1), 60 61 disp('setflowequation warning message: some elements have several types, higher order type is used for them') 61 62 hutterflag(find(hutterflag & macayealflag))=0; … … 64 65 end 65 66 66 %Check that no pattyn or stokes for 2d mesh 67 %check that l1l2 is not coupled to any other model for now 68 if any(l1l2flag) & any(hutterflag | macayealflag | pattynflag | stokesflag) 69 error('l1l2 cannot be coupled to any other model'); 70 end 71 72 %Check that no l1l2 or pattyn or stokes for 2d mesh 67 73 if (md.mesh.dimension==2), 68 if any( stokesflag | pattynflag)69 error('s etflowequation error message: stokes and pattyn elements not allowed in 2d mesh, extrude it first')74 if any(l1l2flag | stokesflag | pattynflag) 75 error('stokes and pattyn elements not allowed in 2d mesh, extrude it first') 70 76 end 71 77 end … … 73 79 %Stokes can only be used alone for now: 74 80 if any(stokesflag) &any(hutterflag), 75 error('s etflowequation error message: stokes cannot be used with any other model for now, put stokes everywhere')81 error('stokes cannot be used with any other model for now, put stokes everywhere') 76 82 end 77 83 … … 83 89 nodeonpattyn=zeros(md.mesh.numberofvertices,1); 84 90 nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1; 91 nodeonl1l2=zeros(md.mesh.numberofvertices,1); 92 nodeonl1l2(md.mesh.elements(find(l1l2flag),:))=1; 85 93 nodeonstokes=zeros(md.mesh.numberofvertices,1); 86 94 noneflag=zeros(md.mesh.numberofelements,1); … … 236 244 md.flowequation.element_equation(find(hutterflag))=1; 237 245 md.flowequation.element_equation(find(macayealflag))=2; 246 md.flowequation.element_equation(find(l1l2flag))=8; 238 247 md.flowequation.element_equation(find(pattynflag))=3; 239 248 md.flowequation.element_equation(find(stokesflag))=4; … … 253 262 pos=find(nodeonmacayeal); 254 263 md.flowequation.vertex_equation(pos)=2; 264 pos=find(nodeonl1l2); 265 md.flowequation.vertex_equation(pos)=8; 255 266 pos=find(nodeonpattyn); 256 267 md.flowequation.vertex_equation(pos)=3; 257 pos=find(nodeonhutter);258 md.flowequation.vertex_equation(pos)=1;259 268 pos=find(nodeonmacayealpattyn); 260 269 md.flowequation.vertex_equation(pos)=5; … … 276 285 md.flowequation.ismacayealpattyn=double(any(md.flowequation.element_equation==2 | md.flowequation.element_equation==3)); 277 286 md.flowequation.isstokes=double(any(md.flowequation.element_equation==4)); 287 md.flowequation.isl1l2=double(any(md.flowequation.element_equation==8)); 278 288 279 289 return
Note:
See TracChangeset
for help on using the changeset viewer.