Changeset 1651
- Timestamp:
- 08/11/09 15:59:46 (16 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 5 added
- 5 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp
r1632 r1651 53 53 /*Formulations: */ 54 54 int FormulationEnum(void){ return 300; } 55 int None Enum(void){return 301; }56 int Hutter Enum(void){return 302; }57 int MacAyeal Enum(void){return 303; }58 int Pattyn Enum(void){return 304; }59 int Stokes Enum(void){return 305; }55 int NoneFormulationEnum(void){ return 301; } 56 int HutterFormulationEnum(void){ return 302; } 57 int MacAyealFormulationEnum(void){ return 303; } 58 int PattynFormulationEnum(void){ return 304; } 59 int StokesFormulationEnum(void){ return 305; } 60 60 61 61 /*OBJECTS: */ -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r1628 r1651 7 7 #define _ENUM_DEFINITIONS_ 8 8 9 /*objects: */ 10 int NodeEnum(void); 11 int TriaEnum(void); 12 int SingEnum(void); 13 int BeamEnum(void); 14 int PentaEnum(void); 15 int MaterialEnum(void); 16 int MaticeEnum(void); 17 int MatparEnum(void); 18 int SpcEnum(void); 19 int PenpairEnum(void); 20 int PengridEnum(void); 21 int IcefrontEnum(void); 22 int RiftfrontEnum(void); 23 int ParamEnum(void); 24 int ElementEnum(void); 25 int LoadEnum(void); 26 int RgbEnum(void); 27 int InputEnum(void); 28 int ResultEnum(void); 29 30 /*formulations: */ 31 int NoneEnum(void); 32 int HutterEnum(void); 33 int MacAyealEnum(void); 34 int PattynEnum(void); 35 int StokesEnum(void); 36 37 /* analysis enums: */ 38 int DiagnosticAnalysisEnum(void); 39 int ControlAnalysisEnum(void); 40 int ThermalAnalysisEnum(void); 41 int PrognosticAnalysisEnum(void); 42 int MeltingAnalysisEnum(void); 43 int SlopeComputeAnalysisEnum(void); 44 int StokesAnalysisEnum(void); 45 int HutterAnalysisEnum(void); 46 int SurfaceXAnalysisEnum(void); 47 int SurfaceYAnalysisEnum(void); 48 int BedXAnalysisEnum(void); 49 int BedYAnalysisEnum(void); 50 int HorizAnalysisEnum(void); 51 int VertAnalysisEnum(void); 52 int NoneAnalysisEnum(void); 53 int SteadyAnalysisEnum(void); 54 int TransientAnalysisEnum(void); 55 int AdjointAnalysisEnum(void); 56 int InverseAnalysisEnum(void); 57 int GradientAnalysisEnum(void); 58 59 /*datasets: */ 9 /*Datasets: */ 10 int DatasetsEnum(void); 60 11 int ElementsEnum(void); 61 12 int NodesEnum(void); … … 66 17 int ResultsEnum(void); 67 18 19 /*ANALYSIS TYPES: */ 20 int AnalysisEnum(void); 21 //diagnostic 22 int DiagnosticAnalysisEnum(void); 23 int HorizAnalysisEnum(void); 24 int StokesAnalysisEnum(void); 25 int HutterAnalysisEnum(void); 26 int VertAnalysisEnum(void); 27 //control 28 int ControlAnalysisEnum(void); 29 int AdjointAnalysisEnum(void); 30 int InverseAnalysisEnum(void); 31 int GradientAnalysisEnum(void); 32 //thermal 33 int ThermalAnalysisEnum(void); 34 int SteadyAnalysisEnum(void); 35 int TransientAnalysisEnum(void); 36 //slope 37 int SlopeComputeAnalysisEnum(void); 38 int SurfaceXAnalysisEnum(void); 39 int SurfaceYAnalysisEnum(void); 40 int BedXAnalysisEnum(void); 41 int BedYAnalysisEnum(void); 42 //prognostic 43 int PrognosticAnalysisEnum(void); 44 //melting 45 int MeltingAnalysisEnum(void); 46 //mesh2grid 47 int Mesh2gridAnalysisEnum(void); 48 //parameters 49 int ParametersAnalysisEnum(void); 50 //none 51 int NoneAnalysisEnum(void); 52 53 54 /*Formulations: */ 55 int FormulationEnum(void); 56 int NoneFormulationEnum(void); 57 int HutterFormulationEnum(void); 58 int MacAyealFormulationEnum(void); 59 int PattynFormulationEnum(void); 60 int StokesFormulationEnum(void); 61 62 /*OBJECTS: */ 63 int ObjectEnum(void); 64 /*Elements: */ 65 int ElementEnum(void); 66 int TriaEnum(void); 67 int PentaEnum(void); 68 int SingEnum(void); 69 int BeamEnum(void); 70 /*Grids: */ 71 int NodeEnum(void); 72 /*Loads: */ 73 int LoadEnum(void); 74 int IcefrontEnum(void); 75 int RiftfrontEnum(void); 76 int PenpairEnum(void); 77 int PengridEnum(void); 78 /*Materials: */ 79 int MaterialEnum(void); 80 int MaticeEnum(void); 81 int MatparEnum(void); 82 /*Inputs: */ 83 int InputEnum(void); 84 /*Params: */ 85 int ParamEnum(void); 86 /*Results: */ 87 int ResultEnum(void); 88 /*Rgb: */ 89 int RgbEnum(void); 90 /*Spc: */ 91 int SpcEnum(void); 92 68 93 /*Functions on enums: */ 69 94 int EnumIsElement(int en); -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
r1648 r1651 224 224 #endif 225 225 226 if (*(model->elements_type+2*i+0)==MacAyeal Enum()){ //elements of type 1 are Hutter type Tria. Don't create this elements.226 if (*(model->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements. 227 227 228 228 /*ids: */ … … 302 302 materials->AddObject(matice); 303 303 304 } //if(! HutterEnum)304 } //if(!MacAyealFormulationEnum) 305 305 306 306 #ifdef _PARALLEL_ … … 362 362 #endif 363 363 364 if (*(model->elements_type+2*i+0)==MacAyeal Enum() | *(model->elements_type+2*i+0)==PattynEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements.364 if (*(model->elements_type+2*i+0)==MacAyealFormulationEnum() | *(model->elements_type+2*i+0)==PattynFormulationEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements. 365 365 366 366 /*name and id: */ … … 397 397 penta_viscosity_overshoot=model->viscosity_overshoot; 398 398 399 if (*(model->elements_type+2*i+0)==MacAyeal Enum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base.399 if (*(model->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base. 400 400 penta_collapse=1; 401 401 } -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r1632 r1651 120 120 icefront_b[1]=model->bed[i2-1]; 121 121 122 if ((int)*(model->elements_type+2*element+0)==MacAyeal Enum()){ //this is a collapsed 3d element, icefront will be 2d122 if ((int)*(model->elements_type+2*element+0)==MacAyealFormulationEnum()){ //this is a collapsed 3d element, icefront will be 2d 123 123 strcpy(icefront_type,"segment"); 124 124 } 125 else if ((int)*(model->elements_type+2*element+0)==Pattyn Enum()){ //this is a real 3d element, icefront will be 3d.125 else if ((int)*(model->elements_type+2*element+0)==PattynFormulationEnum()){ //this is a real 3d element, icefront will be 3d. 126 126 strcpy(icefront_type,"quad"); 127 127 i3=(int)*(model->segmentonneumann_diag+segment_width*i+2); -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
r1648 r1651 230 230 231 231 232 if (*(model->elements_type+2*i+1)==Stokes Enum()){232 if (*(model->elements_type+2*i+1)==StokesFormulationEnum()){ 233 233 234 234 /*Create Penta using its constructor:*/ … … 254 254 matice_n=(double)*(model->n+i); 255 255 256 if (*(model->elements_type+2*i+1)==Stokes Enum()){256 if (*(model->elements_type+2*i+1)==StokesFormulationEnum()){ 257 257 258 258 /*Create matice using its constructor:*/ -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
r1648 r1651 200 200 201 201 /*We need the field collapse for transient, so that we can use compute B with the average temperature*/ 202 if (*(model->elements_type+2*i+0)==MacAyeal Enum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base.202 if (*(model->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base. 203 203 penta_collapse=1; 204 204 } -
issm/trunk/src/m/classes/@pentaelem/Stress.m
r1299 r1651 80 80 81 81 %Build Pressure 82 if elementonstokes_param(pentaelem.id)==Stokes Enum();82 if elementonstokes_param(pentaelem.id)==StokesFormulationEnum(); 83 83 pressure_g=GetParameterValue(pentaelem,pressure,gauss_coord); 84 84 else %use pattyn's and MacAyeal's assumption: P=sigma_zz'+rho_ice*g*(s-z) -
issm/trunk/src/m/classes/@pentaelem/StressBed.m
r1299 r1651 84 84 85 85 %Build Pressure 86 if elementonstokes_param(pentaelem.id)==Stokes Enum(),86 if elementonstokes_param(pentaelem.id)==StokesFormulationEnum(), 87 87 pressure_g=GetParameterValue(pentaelem,pressure,gauss_coord); 88 88 else %use pattyn's and MacAyeal's assumption: P=sigma_zz'+rho_ice*g*(s-z) -
issm/trunk/src/m/classes/@pentaelem/StressSurface.m
r1299 r1651 84 84 85 85 %Build Pressure 86 if elementonstokes_param(pentaelem.id)==Stokes Enum(),86 if elementonstokes_param(pentaelem.id)==StokesFormulationEnum(), 87 87 pressure_g=GetParameterValue(pentaelem,pressure,gauss_coord); 88 88 else %use pattyn's and MacAyeal's assumption: P=sigma_zz'+rho_ice*g*(s-z) -
issm/trunk/src/m/classes/public/extrude.m
r1338 r1651 140 140 %dead grids 141 141 md.deadgrids=ones(md.numberofgrids,1); 142 md.deadgrids(md.elements(md.elements_type(:,1)~=MacAyeal Enum,:))=0;%non macayeal grids are not dead142 md.deadgrids(md.elements(md.elements_type(:,1)~=MacAyealFormulationEnum,:))=0;%non macayeal grids are not dead 143 143 md.deadgrids(find(md.gridonbed))=0;%grids from elements on bed are not dead 144 144 end -
issm/trunk/src/m/classes/public/ismodelselfconsistent.m
r1490 r1651 41 41 bool=0;return; 42 42 end 43 if any(ones(md.numberofelements,1)-((md.elements_type(:,1)==Hutter Enum) + (md.elements_type(:,1)==MacAyealEnum) + (md.elements_type(:,1)==PattynEnum)))43 if any(ones(md.numberofelements,1)-((md.elements_type(:,1)==HutterFormulationEnum) + (md.elements_type(:,1)==MacAyealFormulationEnum) + (md.elements_type(:,1)==PattynFormulationEnum))) 44 44 disp(['Types of elements have not been set properly, run setelementstype first']) 45 45 bool=0;return; 46 46 end 47 if any(ones(md.numberofelements,1)-((md.elements_type(:,2)==Stokes Enum) + (md.elements_type(:,2)==NoneEnum)))47 if any(ones(md.numberofelements,1)-((md.elements_type(:,2)==StokesFormulationEnum) + (md.elements_type(:,2)==NoneFormulationEnum))) 48 48 disp(['Types of elements have not been set properly, run setelementstype first']) 49 49 bool=0;return; 50 50 end 51 51 if strcmpi(md.type,'2d'), 52 if (ismember(Pattyn Enum,md.elements_type(:,1)) | ismember(StokesEnum,md.elements_type(:,2))),52 if (ismember(PattynFormulationEnum,md.elements_type(:,1)) | ismember(StokesFormulationEnum,md.elements_type(:,2))), 53 53 disp(['For a 2d model, only MacAyeal''s and Hutter''s elements are allowed']); 54 54 bool=0;return; … … 186 186 187 187 %HUTTER ON ICESHELF WARNING 188 if any(md.elements_type(:,1)==Hutter Enum & md.elementoniceshelf),188 if any(md.elements_type(:,1)==HutterFormulationEnum & md.elementoniceshelf), 189 189 disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n')); 190 190 end … … 299 299 300 300 %HUTTER 301 if any(md.elements_type(:,1)==Hutter Enum);301 if any(md.elements_type(:,1)==HutterFormulationEnum); 302 302 disp(['The model has Hutter''s elements. Impossible to compute parameters']); 303 303 bool=0;return; -
issm/trunk/src/m/classes/public/isresultconsistent.m
r1043 r1651 1 function bool=isresultconsistent(md, solution)1 function bool=isresultconsistent(md,analysis_type) 2 2 %ISRESULTCONSISTENT: check that results are consistent 3 3 % … … 6 6 % 7 7 % Usage: 8 % bool=IsModelSelfConsistent(model, solution)8 % bool=IsModelSelfConsistent(model,analysis_type) 9 9 10 10 %tolerance we use in litmus tests for the consistency of the model … … 26 26 27 27 %DIAGNOSTIC 28 if strcmp(solution,'diagnostic'),28 if analysis_type==DiagnosticAnalysisEnum(), 29 29 30 30 if strcmpi(md.type,'3d') … … 59 59 60 60 %CONTROL 61 if strcmp(solution,'control'),61 if analysis_type==ControlAnalysisEnum(), 62 62 63 63 fields1={'results.control.vx','results.control.vy','results.control.vel','results.control.parameter'}; … … 101 101 102 102 %THERMAL 103 if strcmp(solution,'thermal')103 if analysis_type==ThermalAnalysisEnum(), 104 104 105 105 for iter=1:length(md.results.thermal) … … 137 137 end 138 138 139 if strcmp(solution,'transient')139 if analysis_type==TransientAnalysisEnum(), 140 140 141 141 for iter=1:length(md.results.transient) -
issm/trunk/src/m/classes/public/loadresultsfromdisk.m
r1316 r1651 26 26 end 27 27 28 %convert analysis type to string 29 md.analysis_type=AnalysisTypeAsEnum(md.analysis_type); 30 md.sub_analysis_type=AnalysisTypeAsEnum(md.sub_analysis_type); 31 28 32 %post processes qmu results if necessary 29 33 if md.qmu_analysis, -
issm/trunk/src/m/classes/public/mechanicalproperties.m
r1298 r1651 20 20 error('only 2d model supported yet'); 21 21 end 22 if any(md.elements_type(:,1)~=MacAyeal Enum),22 if any(md.elements_type(:,1)~=MacAyealFormulationEnum), 23 23 disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements'); 24 24 end -
issm/trunk/src/m/classes/public/modelextract.m
r1495 r1651 216 216 pos=find(md2.gridondirichlet_diag); %find all the grids on the boundary of the domain without icefront 217 217 md2.gridonstokes(pos)=0; %we have to constrain all the boundary of the domain without icefront 218 stokes_elements=find(md2.elements_type(:,2)==Stokes Enum()); %find the elements on the stokes domain218 stokes_elements=find(md2.elements_type(:,2)==StokesFormulationEnum()); %find the elements on the stokes domain 219 219 borderflags=zeros(numberofgrids2,1); 220 220 borderflags(md2.elements(stokes_elements,:))=1; %find all the grids of the elements on stokes domain, ie stokes grids and borderstokes -
issm/trunk/src/m/classes/public/plot/plot_elementstype.m
r1298 r1651 25 25 if is2d 26 26 %Hutter elements 27 posH=find(data(:,1)==Hutter Enum);27 posH=find(data(:,1)==HutterFormulationEnum); 28 28 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 29 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',Hutter Enum,'FaceColor','flat','EdgeColor',edgecolor);29 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',HutterFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 30 30 %MacAyeal element 31 posH=find(data(:,1)==MacAyeal Enum);31 posH=find(data(:,1)==MacAyealFormulationEnum); 32 32 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 33 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',MacAyeal Enum,'FaceColor','flat','EdgeColor',edgecolor);33 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',MacAyealFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 34 34 %Pattyn element 35 posH=find(data(:,1)==Pattyn Enum);35 posH=find(data(:,1)==PattynFormulationEnum); 36 36 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 37 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',Pattyn Enum,'FaceColor','flat','EdgeColor',edgecolor);37 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',PattynFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 38 38 %Stokes elements 39 39 alpha=0.35; 40 posS=find(data(:,2)==Stokes Enum);40 posS=find(data(:,2)==StokesFormulationEnum); 41 41 if ~isempty(posS) 42 42 A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); 43 % p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',Stokes Enum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);43 % p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',StokesFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha); 44 44 % legend([p1 p2 p3 p4],'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements','Stokes''s elements'); 45 45 else … … 48 48 else 49 49 %Hutter elements 50 posH=find(data(:,1)==Hutter Enum);50 posH=find(data(:,1)==HutterFormulationEnum); 51 51 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); D=elements(posH,4); E=elements(posH,5); F=elements(posH,6); 52 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', Hutter Enum,'FaceColor','flat','EdgeColor',edgecolor);53 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', Hutter Enum,'FaceColor','flat','EdgeColor',edgecolor);54 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', Hutter Enum,'FaceColor','flat','EdgeColor',edgecolor);55 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', Hutter Enum,'FaceColor','flat','EdgeColor',edgecolor);56 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', Hutter Enum,'FaceColor','flat','EdgeColor',edgecolor);52 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', HutterFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 53 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', HutterFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 54 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', HutterFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 55 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', HutterFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 56 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', HutterFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 57 57 %MacAyeal elements 58 posM=find(data(:,1)==MacAyeal Enum);58 posM=find(data(:,1)==MacAyealFormulationEnum); 59 59 A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); D=elements(posM,4); E=elements(posM,5); F=elements(posM,6); 60 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', MacAyeal Enum,'FaceColor','flat','EdgeColor',edgecolor);61 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', MacAyeal Enum,'FaceColor','flat','EdgeColor',edgecolor);62 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', MacAyeal Enum,'FaceColor','flat','EdgeColor',edgecolor);63 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', MacAyeal Enum,'FaceColor','flat','EdgeColor',edgecolor);64 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', MacAyeal Enum,'FaceColor','flat','EdgeColor',edgecolor);60 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', MacAyealFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 61 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', MacAyealFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 62 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', MacAyealFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 63 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', MacAyealFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 64 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', MacAyealFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 65 65 %Pattyn elements 66 posP=find(data(:,1)==Pattyn Enum);66 posP=find(data(:,1)==PattynFormulationEnum); 67 67 A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6); 68 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', Pattyn Enum,'FaceColor','flat','EdgeColor',edgecolor);69 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', Pattyn Enum,'FaceColor','flat','EdgeColor',edgecolor);70 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', Pattyn Enum,'FaceColor','flat','EdgeColor',edgecolor);71 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', Pattyn Enum,'FaceColor','flat','EdgeColor',edgecolor);72 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', Pattyn Enum,'FaceColor','flat','EdgeColor',edgecolor);68 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', PattynFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 69 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', PattynFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 70 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', PattynFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 71 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', PattynFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 72 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', PattynFormulationEnum,'FaceColor','flat','EdgeColor',edgecolor); 73 73 %Stokes elements 74 74 alpha=0.35; 75 posS=find(data(:,2)==Stokes Enum);75 posS=find(data(:,2)==StokesFormulationEnum); 76 76 if ~isempty(posS) 77 77 A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); D=elements(posS,4); E=elements(posS,5); F=elements(posS,6); -
issm/trunk/src/m/classes/public/process_solve_options.m
r1650 r1651 13 13 package=options{i,2}; 14 14 found=1; 15 break 15 16 end 16 17 end … … 20 21 package='cielo'; 21 22 end 22 if ~(strcmpi(package,'cielo') | ... 23 strcmpi(package,'ice') | ... 24 strcmpi(package,'macayeal') ), 23 if ~ismemberi(package,{'cielo','ice','macayeal'}), 25 24 error(['process_solve_options error message: package ' package ' not supported yet!']); 26 25 end … … 32 31 analysis_type=options{i,2}; 33 32 found=1; 33 break 34 34 end 35 35 end … … 44 44 sub_analysis_type=options{i,2}; 45 45 found=1; 46 break 46 47 end 47 48 end … … 64 65 batch=options{i,2}; 65 66 found=1; 67 break 66 68 end 67 69 end -
issm/trunk/src/m/classes/public/setelementstype.m
r1622 r1651 77 77 gridonhutter(md.elements(find(hutterflag),:))=1; 78 78 md.gridonhutter=gridonhutter; 79 md.elements_type(find(hutterflag),1)=Hutter Enum();79 md.elements_type(find(hutterflag),1)=HutterFormulationEnum(); 80 80 81 81 %2: MacAyeal elements … … 83 83 gridonmacayeal(md.elements(find(macayealflag),:))=1; 84 84 md.gridonmacayeal=gridonmacayeal; 85 md.elements_type(find(macayealflag),1)=MacAyeal Enum();85 md.elements_type(find(macayealflag),1)=MacAyealFormulationEnum(); 86 86 87 87 %3: Pattyn elements … … 89 89 gridonpattyn(md.elements(find(pattynflag),:))=1; 90 90 md.gridonpattyn=gridonpattyn; 91 md.elements_type(find(pattynflag),1)=Pattyn Enum();91 md.elements_type(find(pattynflag),1)=PattynFormulationEnum(); 92 92 93 93 %4: Stokes elements 94 94 md.gridonstokes=gridonstokes; 95 md.elements_type(find(stokesflag),2)=Stokes Enum();95 md.elements_type(find(stokesflag),2)=StokesFormulationEnum(); 96 96 97 97 %5: None elements (non Stokes) 98 md.elements_type(find(~stokesflag),2)=None Enum();98 md.elements_type(find(~stokesflag),2)=NoneFormulationEnum(); 99 99 100 100 %Create the border grids between Pattyn and MacAyeal and extrude them … … 121 121 122 122 %figure out the border stokes grids 123 stokes_elements=find(md.elements_type(:,2)==Stokes Enum()); %find the elements on the stokes domain123 stokes_elements=find(md.elements_type(:,2)==StokesFormulationEnum()); %find the elements on the stokes domain 124 124 borderflags=zeros(md.numberofgrids,1); 125 125 borderflags(md.elements(stokes_elements,:))=1; %find all the grids of the elements on stokes domain, ie stokes grids and borderstokes … … 132 132 133 133 %figure out solution types 134 md.ishutter=double(any(md.elements_type(:,1)==Hutter Enum));135 md.ismacayealpattyn=double(any(md.elements_type(:,1)==MacAyeal Enum | md.elements_type(:,1)==PattynEnum));136 md.isstokes=double(any(md.elements_type(:,2)==Stokes Enum));134 md.ishutter=double(any(md.elements_type(:,1)==HutterFormulationEnum)); 135 md.ismacayealpattyn=double(any(md.elements_type(:,1)==MacAyealFormulationEnum | md.elements_type(:,1)==PattynFormulationEnum)); 136 md.isstokes=double(any(md.elements_type(:,2)==StokesFormulationEnum)); 137 137 138 138 end -
issm/trunk/src/m/classes/public/solve.m
r1650 r1651 92 92 end 93 93 94 %convert analysis type to string finally 95 md.analysis_type=AnalysisTypeAsEnum(options.analysis_type); 96 md.sub_analysis_type=AnalysisTypeAsEnum(options.sub_analysis_type); 97 94 98 %re-add the paths 95 99 addpath(genpath_ice([ISSM_DIR '/src/m/solutions/macayeal'])); -
issm/trunk/src/m/shared/AnalysisTypeAsEnum.m
r1644 r1651 141 141 end 142 142 143 if enum==None Enum(),144 string='none enum';145 end 146 147 if enum==Hutter Enum(),148 string='hutter enum';149 end 150 151 if enum==MacAyeal Enum(),152 string='macayeal enum';153 end 154 155 if enum==Pattyn Enum(),156 string='pattyn enum';157 end 158 159 if enum==Stokes Enum(),160 string='stokes enum';143 if enum==NoneFormulationEnum(), 144 string='noneformulationenum'; 145 end 146 147 if enum==HutterFormulationEnum(), 148 string='hutterformulationenum'; 149 end 150 151 if enum==MacAyealFormulationEnum(), 152 string='macayealformulationenum'; 153 end 154 155 if enum==PattynFormulationEnum(), 156 string='pattynformulationenum'; 157 end 158 159 if enum==StokesFormulationEnum(), 160 string='stokesformulationenum'; 161 161 end 162 162 -
issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticHoriz.m
r1623 r1651 13 13 %Allocate grids and elements 14 14 if strcmpi(md.type,'2d'), 15 numberofelements_horiz=length(find(md.elements_type(:,1)==MacAyeal Enum()));15 numberofelements_horiz=length(find(md.elements_type(:,1)==MacAyealFormulationEnum())); 16 16 else 17 numberofelements_horiz=length(find(md.elements_type(:,1)==MacAyeal Enum() | md.elements_type(:,1)==PattynEnum()));17 numberofelements_horiz=length(find(md.elements_type(:,1)==MacAyealFormulationEnum() | md.elements_type(:,1)==PattynFormulationEnum())); 18 18 end 19 19 elements=struct('element',cell(numberofelements_horiz,1)); … … 22 22 %Deal with 2d elements 23 23 if strcmpi(md.type,'2d'), 24 el3pos=find(md.elements_type(:,1)==MacAyeal Enum);24 el3pos=find(md.elements_type(:,1)==MacAyealFormulationEnum); 25 25 if ~isempty(el3pos), 26 26 pos=[1:length(el3pos)]'; … … 54 54 %3d elements 55 55 %First create penta elements (ie non hutter) 56 el6pos=find(md.elements_type(:,1)==MacAyeal Enum | md.elements_type(:,1)==PattynEnum);56 el6pos=find(md.elements_type(:,1)==MacAyealFormulationEnum | md.elements_type(:,1)==PattynFormulationEnum); 57 57 58 58 if ~isempty(el6pos), … … 87 87 %For penta elements where we want to implement MacAyeal's element, we need to collapse 88 88 %the formulation into trias: 89 pos=find(ismember(el6pos,find(md.elements_type(:,1)==MacAyeal Enum())));89 pos=find(ismember(el6pos,find(md.elements_type(:,1)==MacAyealFormulationEnum()))); 90 90 elements(pos)=SetStructureField(elements(pos),'element','collapse',ones(length(pos),1)); 91 91 … … 140 140 if strcmpi(md.type,'3d'), 141 141 for n=1:length(elements), 142 if md.elements_type(el6pos(n),1)==MacAyeal Enum(),142 if md.elements_type(el6pos(n),1)==MacAyealFormulationEnum(), 143 143 %all dofs associated to this element are frozen, except if the element is on the bed, and acts as a 'fake' pentaelem, 144 144 %and a true 'macayeal' tria element. … … 164 164 165 165 if strcmpi(md.type,'3d'), 166 if md.elements_type(md.segmentonneumann_diag(i,end))==MacAyeal Enum(),166 if md.elements_type(md.segmentonneumann_diag(i,end))==MacAyealFormulationEnum(), 167 167 loads(i).load=icefront; 168 168 loads(i).load.eid=find(el6pos==md.segmentonneumann_diag(i,end)); … … 172 172 loads(i).load.type='segment'; 173 173 174 elseif md.elements_type(md.segmentonneumann_diag(i,end))==Pattyn Enum(),174 elseif md.elements_type(md.segmentonneumann_diag(i,end))==PattynFormulationEnum(), 175 175 %build a quad ice front for the penta element 176 176 loads(i).load=icefront; … … 183 183 184 184 else 185 if ~(md.elements_type(md.segmentonneumann_diag(i,end))==Hutter Enum()),185 if ~(md.elements_type(md.segmentonneumann_diag(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))==MacAyeal Enum(),190 if md.elements_type(md.segmentonneumann_diag(i,end))==MacAyealFormulationEnum(), 191 191 loads(i).load=icefront; 192 192 loads(i).load.eid=find(el3pos==md.segmentonneumann_diag(i,end)); … … 197 197 198 198 else 199 if ~(md.elements_type(md.segmentonneumann_diag(i,end))==Hutter Enum()),199 if ~(md.elements_type(md.segmentonneumann_diag(i,end))==HutterFormulationEnum()), 200 200 error('diagnostic error message: unsupported element type'); 201 201 end -
issm/trunk/src/m/solutions/ice/ModelProcessorDiagnosticStokes.m
r1646 r1651 12 12 13 13 %Allocate grids and elements 14 numberofstokeselements=size(find(md.elements_type(:,2)==Stokes Enum()),1);14 numberofstokeselements=size(find(md.elements_type(:,2)==StokesFormulationEnum()),1); 15 15 elements=struct('element',cell(numberofstokeselements,1)); 16 16 materials=struct('material',cell(numberofstokeselements+1,1)); 17 17 18 18 %3d elements 19 pos=find(md.elements_type(:,2)==Stokes Enum);19 pos=find(md.elements_type(:,2)==StokesFormulationEnum); 20 20 stokesnewnumber=[1:numberofstokeselements]'; 21 21 [elements(stokesnewnumber).element]=deal(pentaelem); … … 89 89 %Build grids on the border of stokes 90 90 %Get border grids 91 stokes_elements=find(md.elements_type(:,2)==Stokes Enum()); %find the elements on the stokes domain91 stokes_elements=find(md.elements_type(:,2)==StokesFormulationEnum()); %find the elements on the stokes domain 92 92 borderflags=zeros(md.numberofgrids,1); 93 93 borderflags(md.elements(stokes_elements,:))=1; %find all the grids of the elements on stokes domain, ie stokes grids and borderstokes … … 115 115 %build a quad ice front for the penta element 116 116 loads(i).load=icefront; 117 loads(i).load.eid=find(segmentonneumann_diag_stokes(i,end)==find(md.elements_type(:,2)==Stokes Enum())); %elements contain only stokes elements, so we have to renumbered117 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 renumbered 118 118 loads(i).load.g(1)=segmentonneumann_diag_stokes(i,1); 119 119 loads(i).load.g(2)=segmentonneumann_diag_stokes(i,2); -
issm/trunk/src/m/solutions/ice/ModelProcessorThermal.m
r1623 r1651 39 39 %For penta elements where we want to implement MacAyeal's element, we need to collapse 40 40 %the formulation into trias: 41 el6pos=find(md.elements_type(:,1)==MacAyeal Enum | md.elements_type(:,1)==PattynEnum);42 pos2=find(ismember(el6pos,find(md.elements_type(:,1)==MacAyeal Enum())));41 el6pos=find(md.elements_type(:,1)==MacAyealFormulationEnum | md.elements_type(:,1)==PattynFormulationEnum); 42 pos2=find(ismember(el6pos,find(md.elements_type(:,1)==MacAyealFormulationEnum()))); 43 43 elements(pos2)=SetStructureField(elements(pos2),'element','collapse',ones(length(pos2),1)); 44 44
Note:
See TracChangeset
for help on using the changeset viewer.