Changeset 4012
- Timestamp:
- 06/03/10 10:20:31 (15 years ago)
- Location:
- issm/trunk/src/c/solutions
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/solutions/diagnostic_core.cpp
r4004 r4012 87 87 88 88 /*Compute slopes: */ 89 slope_core(&surfaceslopex,&surfaceslopey,femmodel,SurfaceAnalysisEnum); 90 slope_core(&bedslopex,&bedslopey,femmodel,BedAnalysisEnum); 91 92 /*Update: */ 93 model->UpdateInputsFromVector(surfaceslopex,SurfaceSlopexEnum,VertexEnum); 94 model->UpdateInputsFromVector(surfaceslopey,SurfaceSlopeyEnum,VertexEnum); 95 model->UpdateInputsFromVector(bedslopex,BedSlopexEnum,VertexEnum); 96 model->UpdateInputsFromVector(bedslopey,BedSlopeyEnum,VertexEnum); 97 89 slope_core(femmodel,SurfaceXAnalysisEnum); 90 slope_core(femmodel,SurfaceYAnalysisEnum); 91 slope_core(femmodel,BedSlopeXAnalysisEnum); 92 slope_core(femmodel,BedSlopeYAnalysisEnum); 93 98 94 99 95 if(ishutter){ -
issm/trunk/src/c/solutions/slope_core.cpp
r3982 r4012 9 9 #include "../modules/modules.h" 10 10 11 void slope_core( Vec* pslopex,Vec* pslopey,FemModel* femmodel, int AnalysisEnum){11 void slope_core(FemModel* femmodel, int sub_analysis_type){ 12 12 13 13 /*parameters: */ … … 16 16 bool isstokes; 17 17 bool ishutter; 18 int xanalysis;19 int yanalysis;20 18 21 19 /*output: */ 22 Vec slopex=NULL; 23 Vec slopey=NULL; 20 Vec slope=NULL; 24 21 25 22 /*Recover some parameters: */ … … 29 26 femmodel->parameters->FindParam(&ishutter,IsHutterEnum); 30 27 31 if(verbose)_printf_("%s\n","computing slope (x and y derivatives)..."); 32 33 /*Specify type of computations: */ 34 if(AnalysisEnum==SurfaceAnalysisEnum){ 35 xanalysis=SurfaceXAnalysisEnum; 36 yanalysis=SurfaceYAnalysisEnum; 37 } 38 else if(AnalysisEnum==BedAnalysisEnum){ 39 xanalysis=BedXAnalysisEnum; 40 yanalysis=BedYAnalysisEnum; 41 } 42 else ISSMERROR("%s%s%s"," analysis ",EnumAsString(AnalysisEnum)," not supported yet!"); 43 28 if(verbose)_printf_("%s\n","computing slope..."); 44 29 45 30 /*Early return possible? */ 46 if(!ishutter && AnalysisEnum==SurfaceAnalysisEnum){ 47 /*no need to compute Surface Slope except for Hutter: */ 48 *pslopex=NULL; 49 *pslopey=NULL; 50 return; 51 } 52 if(!isstokes && AnalysisEnum==BedAnalysisEnum){ 53 /*no need to compute Bed Slope except for full Stokes: */ 54 *pslopex=NULL; 55 *pslopey=NULL; 56 return; 57 } 31 if(!ishutter && AnalysisEnum==SurfaceAnalysisEnum) return; 32 if(!isstokes && AnalysisEnum==BedAnalysisEnum) return; 33 34 /*Call on core computations: */ 35 solver_linear(&slope,femmodel,SlopecomputeAnalysisEnum,sub_analysis_type); 58 36 59 60 /*Call on core computations: */ 61 diagnostic_core_linear(&slopex,femmodel,SlopecomputeAnalysisEnum,xanalysis); 62 diagnostic_core_linear(&slopey,femmodel,SlopecomputeAnalysisEnum,yanalysis); 37 /*Plug solution into inputs: */ 38 UpdateInputsFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,slope,analysis_type, sub_analysis_type); 63 39 64 40 /*extrude if we are in 3D: */ 65 41 if (dim==3){ 66 if(verbose)_printf_("%s\n","extruding slopes in 3d..."); 67 FieldExtrudex( slopex, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"slopex",0); 68 FieldExtrudex( slopey, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"slopey",0); 42 if(verbose)_printf_("%s\n","extruding slope in 3d..."); 43 switch(sub_analysis_type){ 44 case SurfaceXAnalysisEnum: 45 InputsExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceSlopeXEnum,0); 46 case SurfaceYAnalysisEnum: 47 InputsExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceSlopeYEnum,0); 48 case BedXAnalysisEnum: 49 InputsExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BedSlopeXEnum,0); 50 case BedYAnalysisEnum: 51 InputsExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BedSlopeYEnum,0); 52 default: ISSMERROR("%s%s%s"," sub_analysis_type ",EnumAsString(sub_analysis_type)," not supported yet!"); 53 } 69 54 } 70 55 71 /*Assign output pointers:*/ 72 *pslopex=slopex; 73 *pslopey=slopey; 56 /*Free ressources:*/ 57 VecFree(&slope); 74 58 } -
issm/trunk/src/c/solutions/solutions.h
r3938 r4012 32 32 void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, DataSet* loads, FemModel* fem,int analysis_type,int sub_analysis_type); 33 33 void diagnostic_core_linear(Vec* ppg,FemModel* fem,int analysis_type,int sub_analysis_type); 34 void slope_core(Vec* pslopex,Vec* pslopey,FemModel* fem,int AnalysisEnum); 35 36 37 34 void solver_linear(Vec* ppg,FemModel* fem,int analysis_type,int sub_analysis_type); 35 void slope_core(FemModel* fem,int sub_analysis_type); 38 36 39 37
Note:
See TracChangeset
for help on using the changeset viewer.