Changeset 1752
- Timestamp:
- 08/18/09 14:49:38 (15 years ago)
- Location:
- issm/trunk/src/m/solutions/ice
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHoriz.m
r1680 r1752 159 159 160 160 %icefront 161 loads=struct('load',cell(length(md. segmentonneumann_diag),1));162 163 for i=1:size(md. segmentonneumann_diag,1),161 loads=struct('load',cell(length(md.pressureload),1)); 162 163 for i=1:size(md.pressureload,1), 164 164 165 165 if strcmpi(md.type,'3d'), 166 if md.elements_type(md. segmentonneumann_diag(i,end))==MacAyealFormulationEnum(),166 if md.elements_type(md.pressureload(i,end))==MacAyealFormulationEnum(), 167 167 loads(i).load=icefront; 168 loads(i).load.eid=find(el6pos==md. segmentonneumann_diag(i,end));169 loads(i).load.g(1)=md. segmentonneumann_diag(i,1);170 loads(i).load.g(2)=md. segmentonneumann_diag(i,2);168 loads(i).load.eid=find(el6pos==md.pressureload(i,end)); 169 loads(i).load.g(1)=md.pressureload(i,1); 170 loads(i).load.g(2)=md.pressureload(i,2); 171 171 loads(i).load.rho_water=md.rho_water; 172 172 loads(i).load.type='segment'; 173 173 174 elseif md.elements_type(md. segmentonneumann_diag(i,end))==PattynFormulationEnum(),174 elseif md.elements_type(md.pressureload(i,end))==PattynFormulationEnum(), 175 175 %build a quad ice front for the penta element 176 176 loads(i).load=icefront; 177 loads(i).load.eid=find(el6pos==md. segmentonneumann_diag(i,end));178 loads(i).load.g(1)=md. segmentonneumann_diag(i,1);179 loads(i).load.g(2)=md. segmentonneumann_diag(i,2);180 loads(i).load.g(3)=md. segmentonneumann_diag(i,3);181 loads(i).load.g(4)=md. segmentonneumann_diag(i,4);177 loads(i).load.eid=find(el6pos==md.pressureload(i,end)); 178 loads(i).load.g(1)=md.pressureload(i,1); 179 loads(i).load.g(2)=md.pressureload(i,2); 180 loads(i).load.g(3)=md.pressureload(i,3); 181 loads(i).load.g(4)=md.pressureload(i,4); 182 182 loads(i).load.type='quad'; 183 183 184 184 else 185 if ~(md.elements_type(md. segmentonneumann_diag(i,end))==HutterFormulationEnum()),185 if ~(md.elements_type(md.pressureload(i,end))==HutterFormulationEnum()), 186 186 error('diagnostic error message: unsupported element type'); 187 187 end 188 188 end 189 189 else 190 if md.elements_type(md. segmentonneumann_diag(i,end))==MacAyealFormulationEnum(),190 if md.elements_type(md.pressureload(i,end))==MacAyealFormulationEnum(), 191 191 loads(i).load=icefront; 192 loads(i).load.eid=find(el3pos==md. segmentonneumann_diag(i,end));193 loads(i).load.g(1)=md. segmentonneumann_diag(i,1);194 loads(i).load.g(2)=md. segmentonneumann_diag(i,2);192 loads(i).load.eid=find(el3pos==md.pressureload(i,end)); 193 loads(i).load.g(1)=md.pressureload(i,1); 194 loads(i).load.g(2)=md.pressureload(i,2); 195 195 loads(i).load.rho_water=md.rho_water; 196 196 loads(i).load.type='segment'; 197 197 198 198 else 199 if ~(md.elements_type(md. segmentonneumann_diag(i,end))==HutterFormulationEnum()),199 if ~(md.elements_type(md.pressureload(i,end))==HutterFormulationEnum()), 200 200 error('diagnostic error message: unsupported element type'); 201 201 end … … 207 207 208 208 %Initialize constraints structure 209 constraints=struct('constraint',cell( 2*length(find(md.gridondirichlet_diag)),1));209 constraints=struct('constraint',cell(length(find(md.spcvelocity(:,1)))+length(find(md.spcvelocity(:,2))),1)); 210 210 211 211 count=1; … … 228 228 count=count+1; 229 229 230 elseif (md.gridonmacayeal(i) | md.gridonpattyn(i)) & md.gridondirichlet_diag(i), 231 232 %constrain first dof 233 constraints(count).constraint=spc; 234 constraints(count).constraint.grid=i; 235 constraints(count).constraint.dof=1; 236 constraints(count).constraint.value=md.dirichletvalues_diag(i,1)/md.yts; %in m/s 237 count=count+1; 238 239 %constrain second dof 240 constraints(count).constraint=spc; 241 constraints(count).constraint.grid=i; 242 constraints(count).constraint.dof=2; 243 constraints(count).constraint.value=md.dirichletvalues_diag(i,2)/md.yts; %in m/s 244 count=count+1; 230 else 231 if (md.gridonmacayeal(i) | md.gridonpattyn(i)) & md.spcvelocity(i,1), 232 %constrain first dof 233 constraints(count).constraint=spc; 234 constraints(count).constraint.grid=i; 235 constraints(count).constraint.dof=1; 236 constraints(count).constraint.value=md.spcvelocity(i,4)/md.yts; %in m/s 237 count=count+1; 238 end 239 240 if (md.gridonmacayeal(i) | md.gridonpattyn(i)) & md.spcvelocity(i,2), 241 %constrain second dof 242 constraints(count).constraint=spc; 243 constraints(count).constraint.grid=i; 244 constraints(count).constraint.dof=2; 245 constraints(count).constraint.value=md.spcvelocity(i,5)/md.yts; %in m/s 246 count=count+1; 247 end 245 248 end 246 249 end -
issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticStokes.m
r1680 r1752 107 107 108 108 %icefront 109 if isnan(md. segmentonneumann_diag_stokes),110 segmentonneumann_diag_stokes=[];109 if isnan(md.pressureload_stokes), 110 pressureload_stokes=[]; 111 111 else 112 segmentonneumann_diag_stokes=md.segmentonneumann_diag_stokes;112 pressureload_stokes=md.pressureload_stokes; 113 113 end 114 length_ segmentonneumann_diag_stokes= size(segmentonneumann_diag_stokes,1);115 loads=struct('load',cell(length_ segmentonneumann_diag_stokes,1));114 length_pressureload_stokes= size(pressureload_stokes,1); 115 loads=struct('load',cell(length_pressureload_stokes,1)); 116 116 117 for i=1:length_ segmentonneumann_diag_stokes,117 for i=1:length_pressureload_stokes, 118 118 119 119 %build a quad ice front for the penta element 120 120 loads(i).load=icefront; 121 loads(i).load.eid=find( segmentonneumann_diag_stokes(i,end)==find(md.elements_type(:,2)==StokesFormulationEnum())); %elements contain only stokes elements, so we have to renumbered122 loads(i).load.g(1)= segmentonneumann_diag_stokes(i,1);123 loads(i).load.g(2)= segmentonneumann_diag_stokes(i,2);124 loads(i).load.g(3)= segmentonneumann_diag_stokes(i,3);125 loads(i).load.g(4)= segmentonneumann_diag_stokes(i,4);121 loads(i).load.eid=find(pressureload_stokes(i,end)==find(md.elements_type(:,2)==StokesFormulationEnum())); %elements contain only stokes elements, so we have to renumbered 122 loads(i).load.g(1)=pressureload_stokes(i,1); 123 loads(i).load.g(2)=pressureload_stokes(i,2); 124 loads(i).load.g(3)=pressureload_stokes(i,3); 125 loads(i).load.g(4)=pressureload_stokes(i,4); 126 126 loads(i).load.rho_water=md.rho_water; 127 127 loads(i).load.type='quad'; … … 144 144 145 145 %Single point constraints: 146 spcs=find(md. gridondirichlet_diag);146 spcs=find(md.spcvelocity(:,1)); 147 147 constraints=struct('constraint',cell(3*length(spcs),1)); 148 148 -
issm/trunk/src/m/solutions/ice/ModelProcessorPrognostic.m
r1680 r1752 95 95 96 96 %Initialize constraints structure 97 constraints=struct('constraint',cell(length(find(md. gridondirichlet_prog)),1));97 constraints=struct('constraint',cell(length(find(md.spcthickness(:,1))),1)); 98 98 99 pos=find(md. gridondirichlet_prog);99 pos=find(md.spcthickness(:,1)); 100 100 count=1; 101 for i=1:length(find(md. gridondirichlet_prog)),101 for i=1:length(find(md.spcthickness(:,1))), 102 102 103 103 %constrain the thickness … … 105 105 constraints(count).constraint.grid=pos(i); 106 106 constraints(count).constraint.dof=1; 107 constraints(count).constraint.value=md. dirichletvalues_prog(pos(i)); %in m107 constraints(count).constraint.value=md.spcthickness(pos(i),2); %in m 108 108 count=count+1; 109 109 end -
issm/trunk/src/m/solutions/ice/ModelProcessorThermal.m
r1680 r1752 102 102 count=1; 103 103 for i=1:md.numberofgrids, 104 if ~md. gridondirichlet_thermal(i), %No penalty applied on spc grids!104 if ~md.spctemperature(i,1), %No penalty applied on spc grids! 105 105 pengridobject=pengrid; 106 106 pengridobject.id=count; … … 121 121 122 122 %Single point constraints: 123 spcs=find(md. gridondirichlet_thermal);123 spcs=find(md.spctemperature(:,1)); 124 124 constraints=struct('constraint',cell(length(spcs),1)); 125 125 126 126 count=1; 127 127 for i=1:md.numberofgrids, 128 if md. gridondirichlet_thermal(i),128 if md.spctemperature(i,1), 129 129 constraints(count).constraint=spc; 130 130 constraints(count).constraint.grid=i; 131 131 constraints(count).constraint.dof=1; 132 constraints(count).constraint.value=md. dirichletvalues_thermal(i,1);132 constraints(count).constraint.value=md.spctemperature(i,2); 133 133 count=count+1; 134 134 end -
issm/trunk/src/m/solutions/ice/VelocityExtrude.m
r648 r1752 13 13 %Find list of 2d grids that belong to the collapsed macayeal elements. 14 14 %And remove grids on the border. 15 %These grids are on macayeal but not on pattyn nor hutter nor dirichlet15 %These grids are on macayeal but not on pattyn nor hutter nor spc 16 16 grids2d=md.gridonmacayeal(1:md.numberofgrids2d);% & ~(md.gridonhutter(1:md.numberofgrids2d) | md.gridonpattyn(1:md.numberofgrids2d) | md.gridondirichlet_diag(1:md.numberofgrids2d)); 17 17 -
issm/trunk/src/m/solutions/ice/diagnostic3d.m
r1040 r1752 68 68 inputs.velocity_average=velocity_average; 69 69 70 %update dirichletboundary conditions with these new base vertical velocities70 %update spc boundary conditions with these new base vertical velocities 71 71 m_dv=fem.m_dv; 72 72 gridset=m_dv.gridset; … … 105 105 inputs.velocity=u_g; 106 106 107 %update dirichletboundary conditions with the velocities computed previously107 %update spc boundary conditions with the velocities computed previously 108 108 gridset=m_ds.gridset; 109 109 m_ds.y_g=u_g; m_ds.ys=Reducevector_g(m_ds.y_g);
Note:
See TracChangeset
for help on using the changeset viewer.