Changeset 22758 for issm/trunk/src/m/classes/model.m
- Timestamp:
- 05/10/18 10:24:27 (7 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/classes/model.m
r21729 r22758 40 40 levelset = 0; 41 41 calving = 0; 42 love = 0; 42 43 gia = 0; 43 44 esa = 0; … … 127 128 %2016 October 11 128 129 if isa(md.esa,'double'); md.esa=esa(); end 130 %2017 Dec 21st (needs to be here) 131 if isempty(md.settings) 132 disp('Warning: md.settings had to be reset, make sure to adjust md.settings.output_frequency and other fields'); 133 md.settings = issmsettings(); 134 end 129 135 %2017 February 10th 130 136 if md.settings.solver_residue_threshold==0, … … 135 141 %2017 May 4th 136 142 if isa(md.amr,'double'); md.amr=amr(); end 143 %2017 Aug 29th 144 if isa(md.love,'double'); md.love=fourierlove(); end 145 %2017 Oct 26th 146 if isa(md.calving,'calvingdev') 147 disp('Warning: calvingdev is now calvingvonmises'); 148 md.calving=calvingvonmises(md.calving); 149 end 137 150 138 151 end% }}} … … 177 190 %Start with changing all the fields from the 3d mesh 178 191 179 %dealing with the fric iton law192 %dealing with the friction law 180 193 %drag is limited to nodes that are on the bedrock. 181 194 if isa(md.friction,'friction'), 182 195 md.friction.coefficient=project2d(md,md.friction.coefficient,1); 196 md.friction.p=project2d(md,md.friction.p,1); 197 md.friction.q=project2d(md,md.friction.q,1); 198 elseif isa(md.friction,'frictioncoulomb'), 199 md.friction.coefficient=project2d(md,md.friction.coefficient,1); 200 md.friction.coefficientcoulomb=project2d(md,md.friction.coefficientcoulomb,1); 183 201 md.friction.p=project2d(md,md.friction.p,1); 184 202 md.friction.q=project2d(md,md.friction.q,1); … … 201 219 else 202 220 disp('friction type not supported'); 203 221 end 204 222 205 223 %observations … … 260 278 if(md.hydrology.isefficientlayer==1) 261 279 md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1); 262 263 280 end 281 end 264 282 265 283 %materials … … 308 326 if ~isnan(md.mask.ice_levelset), 309 327 md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1); 328 end 329 330 %outputdefinitions 331 for i=1:length(md.outputdefinition.definitions) 332 if isobject(md.outputdefinition.definitions{i}) 333 %get subfields 334 solutionsubfields=fields(md.outputdefinition.definitions{i}); 335 for j=1:length(solutionsubfields), 336 field=md.outputdefinition.definitions{i}.(solutionsubfields{j}); 337 if length(field)==md.mesh.numberofvertices | length(field)==md.mesh.numberofelements, 338 md.outputdefinition.definitions{i}.(solutionsubfields{j})=project2d(md,md.outputdefinition.definitions{i}.(solutionsubfields{j}),1); 339 end 340 end 341 end 310 342 end 311 343 … … 320 352 if numel(md.mesh.long)==md.mesh.numberofvertices, mesh.long=project2d(md,md.mesh.long,1); end 321 353 mesh.epsg=md.mesh.epsg; 354 if numel(md.mesh.scale_factor)==md.mesh.numberofvertices, mesh.scale_factor=project2d(md,md.mesh.scale_factor,1); end 322 355 if ~isnan(md.mesh.vertexonboundary), mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1); end 323 356 if ~isnan(md.mesh.elementconnectivity), mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1); end … … 607 640 end 608 641 642 %OutputDefinitions fields 643 for i=1:length(md1.outputdefinition.definitions), 644 if isobject(md1.outputdefinition.definitions{i}) 645 %get subfields 646 solutionsubfields=fields(md1.outputdefinition.definitions{i}); 647 for j=1:length(solutionsubfields), 648 field=md1.outputdefinition.definitions{i}.(solutionsubfields{j}); 649 if length(field)==numberofvertices1, 650 md2.outputdefinition.definitions{i}.(solutionsubfields{j})=field(pos_node); 651 elseif length(field)==numberofelements1, 652 md2.outputdefinition.definitions{i}.(solutionsubfields{j})=field(pos_elem); 653 end 654 end 655 end 656 end 657 609 658 %Keep track of pos_node and pos_elem 610 659 md2.mesh.extractedvertices=pos_node; … … 689 738 md.mesh.long = mesh2d.long; 690 739 md.mesh.epsg = mesh2d.epsg; 740 md.mesh.scale_factor = mesh2d.scale_factor; 691 741 692 742 md.mesh.vertexonboundary = mesh2d.vertexonboundary; … … 762 812 md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node'); 763 813 md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node'); 814 md.mesh.scale_factor=project3d(md,'vector',md.mesh.scale_factor,'type','node'); 764 815 765 816 md.geometry=extrude(md.geometry,md); … … 793 844 md.qmu=extrude(md.qmu,md); 794 845 md.basalforcings=extrude(md.basalforcings,md); 846 md.outputdefinition=extrude(md.outputdefinition,md); 795 847 796 848 %increase connectivity if less than 25: … … 915 967 if isfield(structmd,'lat'), md.mesh.lat=structmd.lat; end 916 968 if isfield(structmd,'long'), md.mesh.long=structmd.long; end 969 if isfield(structmd,'scale_factor'), md.mesh.scale_factor=structmd.scale_factor; end 917 970 if isfield(structmd,'segments'), md.mesh.segments=structmd.segments; end 918 971 if isfield(structmd,'segmentmarkers'), md.mesh.segmentmarkers=structmd.segmentmarkers; end … … 1102 1155 md.debug = debug(); 1103 1156 md.verbose = verbose(); 1104 md.settings = settings();1157 md.settings = issmsettings(); 1105 1158 md.toolkits = toolkits(); 1106 1159 md.cluster = generic(); … … 1112 1165 md.steadystate = steadystate(); 1113 1166 md.transient = transient(); 1114 md.levelset 1167 md.levelset = levelset(); 1115 1168 md.calving = calving(); 1116 md.gia = giaivins(); 1169 md.gia = giaivins(); 1170 md.love = fourierlove(); 1117 1171 md.esa = esa(); 1118 1172 md.autodiff = autodiff(); 1119 1173 md.inversion = inversion(); 1120 1174 md.qmu = qmu(); 1121 md.amr 1175 md.amr = amr(); 1122 1176 md.radaroverlay = radaroverlay(); 1123 1177 md.results = struct(); … … 1288 1342 disp(sprintf('%19s: %-22s -- %s','calving' ,['[1x1 ' class(self.calving) ']'],'parameters for calving')); 1289 1343 disp(sprintf('%19s: %-22s -- %s','gia' ,['[1x1 ' class(self.gia) ']'],'parameters for gia solution')); 1344 disp(sprintf('%19s: %-22s -- %s','love' ,['[1x1 ' class(self.love) ']'],'parameters for love solution')); 1290 1345 disp(sprintf('%19s: %-22s -- %s','esa' ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution')); 1291 1346 disp(sprintf('%19s: %-22s -- %s','autodiff' ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
Note:
See TracChangeset
for help on using the changeset viewer.