Changeset 11004
- Timestamp:
- 12/01/11 14:24:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/model/setflowequation.m
r11003 r11004 67 67 end 68 68 69 % 1: Hutter elements69 %Initialize node fields 70 70 nodeonhutter=zeros(md.mesh.numberofvertices,1); 71 71 nodeonhutter(md.mesh.elements(find(hutterflag),:))=1; 72 73 %2: MacAyeal elements74 72 nodeonmacayeal=zeros(md.mesh.numberofvertices,1); 75 73 nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1; 76 77 %3: Pattyn elements78 74 nodeonpattyn=zeros(md.mesh.numberofvertices,1); 79 75 nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1; 80 81 %4: Stokes elements 76 nodeonstokes=zeros(md.mesh.numberofvertices,1); 77 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1; 78 noneflag=zeros(md.mesh.numberofelements,1); 79 82 80 %First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal) 83 81 if any(stokesflag), 84 nodeonstokes=zeros(md.mesh.numberofvertices,1);85 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;86 82 fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes)); %find all the nodes on the boundary of the domain without icefront 87 83 fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6); %find all the nodes on the boundary of the domain without icefront 88 84 stokesflag(find(fullspcelems))=0; 89 end 90 nodeonstokes=zeros(md.mesh.numberofvertices,1); 91 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1; 92 93 %5: None elements 94 noneflag=zeros(md.mesh.numberofelements,1); 85 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1; 86 end 95 87 96 88 %Then complete with NoneApproximation or the other model used if there is no stokes … … 139 131 macayealflag(find(commonelements))=0; %these elements are now macayealpattynelements 140 132 macayealpattynflag(find(commonelements))=1; 141 nodeonmacayeal =zeros(md.mesh.numberofvertices,1);133 nodeonmacayeal(:)=0; 142 134 nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1; 143 135 … … 148 140 list = list - any(sum(nodeonpattyn(md.mesh.elements(pos,:)) ,2),2); 149 141 pos1=find(list==1); 150 pattynflag(pos(pos1))=0;151 142 macayealflag(pos(pos1))=1; 152 143 macayealpattynflag(pos(pos1))=0; 153 144 pos2=find(list==-1); 154 145 pattynflag(pos(pos2))=1; 155 macayealflag(pos(pos2))=0;156 146 macayealpattynflag(pos(pos2))=0; 157 147 148 %Recompute nodes associated to these elements 158 149 nodeonmacayeal(:)=0; 159 150 nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1; … … 175 166 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1; 176 167 177 %Now recreate nodeonpattynstokes 178 nodeonpattynstokes=zeros(md.mesh.numberofvertices,1); 168 %rule out elements that don't touch the 2 boundaries 169 pos=find(pattynstokesflag); 170 list=zeros(length(pos),1); 171 list = list + any(sum(nodeonstokes(md.mesh.elements(pos,:)),2),2); 172 list = list - any(sum(nodeonpattyn(md.mesh.elements(pos,:)),2),2); 173 pos1=find(list==1); 174 stokesflag(pos(pos1))=1; 175 pattynstokesflag(pos(pos1))=0; 176 pos2=find(list==-1); 177 pattynflag(pos(pos2))=1; 178 pattynstokesflag(pos(pos2))=0; 179 180 %Recompute nodes associated to these elements 181 nodeonstokes(:)=0; 182 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1; 183 nodeonpattyn(:)=0; 184 nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1; 185 nodeonpattynstokes(:)=0; 179 186 nodeonpattynstokes(md.mesh.elements(find(pattynstokesflag),:))=1; 187 180 188 elseif any(stokesflag) & any(macayealflag), 181 189 %Find node at the border … … 190 198 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1; 191 199 192 %Now recreate nodeonmacayealstokes 193 nodeonmacayealstokes=zeros(md.mesh.numberofvertices,1); 200 %rule out elements that don't touch the 2 boundaries 201 pos=find(macayealstokesflag); 202 list=zeros(length(pos),1); 203 list = list + any(sum(nodeonmacayeal(md.mesh.elements(pos,:)),2),2); 204 list = list - any(sum(nodeonstokes(md.mesh.elements(pos,:)) ,2),2); 205 pos1=find(list==1); 206 macayealflag(pos(pos1))=1; 207 macayealstokesflag(pos(pos1))=0; 208 pos2=find(list==-1); 209 stokesflag(pos(pos2))=1; 210 macayealstokesflag(pos(pos2))=0; 211 212 %Recompute nodes associated to these elements 213 nodeonmacayeal(:)=0; 214 nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1; 215 nodeonstokes(:)=0; 216 nodeonstokes(md.mesh.elements(find(stokesflag),:))=1; 217 nodeonmacayealstokes(:)=0; 194 218 nodeonmacayealstokes(md.mesh.elements(find(macayealstokesflag),:))=1; 219 195 220 elseif any(stokesflag) & any(hutterflag), 196 221 error('type of coupling not supported yet');
Note:
See TracChangeset
for help on using the changeset viewer.