Changeset 4012


Ignore:
Timestamp:
06/03/10 10:20:31 (15 years ago)
Author:
Eric.Larour
Message:

New solver linear core + remodeled slope_core solution

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  
    8787
    8888        /*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               
    9894       
    9995        if(ishutter){
  • issm/trunk/src/c/solutions/slope_core.cpp

    r3982 r4012  
    99#include "../modules/modules.h"
    1010
    11 void slope_core(Vec* pslopex,Vec* pslopey,FemModel* femmodel, int AnalysisEnum){
     11void slope_core(FemModel* femmodel, int sub_analysis_type){
    1212
    1313        /*parameters: */
     
    1616        bool isstokes;
    1717        bool ishutter;
    18         int xanalysis;
    19         int yanalysis;
    2018
    2119        /*output: */
    22         Vec slopex=NULL;
    23         Vec slopey=NULL;
     20        Vec slope=NULL;
    2421
    2522        /*Recover some parameters: */
     
    2926        femmodel->parameters->FindParam(&ishutter,IsHutterEnum);
    3027
    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...");
    4429
    4530        /*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);
    5836       
    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);
    6339
    6440        /*extrude if we are in 3D: */
    6541        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                }
    6954        }
    7055
    71         /*Assign output pointers:*/
    72         *pslopex=slopex;
    73         *pslopey=slopey;
     56        /*Free ressources:*/
     57        VecFree(&slope);
    7458}
  • issm/trunk/src/c/solutions/solutions.h

    r3938 r4012  
    3232void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, DataSet* loads, FemModel* fem,int analysis_type,int sub_analysis_type);
    3333void 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 
     34void solver_linear(Vec* ppg,FemModel* fem,int  analysis_type,int sub_analysis_type);
     35void slope_core(FemModel* fem,int sub_analysis_type);
    3836
    3937
Note: See TracChangeset for help on using the changeset viewer.