Changeset 4835


Ignore:
Timestamp:
07/27/10 13:47:28 (15 years ago)
Author:
Mathieu Morlighem
Message:

no more InputExtrude in solutions

Location:
issm/trunk/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4832 r4835  
    378378        }
    379379        else if (analysis_type==BedSlopeXAnalysisEnum){
    380                 InputUpdateFromBedSlopeX( solution);
     380                InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeXEnum);
    381381        }
    382382        else if (analysis_type==BedSlopeYAnalysisEnum){
    383                 InputUpdateFromBedSlopeY( solution);
     383                InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeYEnum);
    384384        }
    385385        else if (analysis_type==SurfaceSlopeXAnalysisEnum){
    386                 InputUpdateFromSurfaceSlopeX( solution);
     386                InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeXEnum);
    387387        }
    388388        else if (analysis_type==SurfaceSlopeYAnalysisEnum){
    389                 InputUpdateFromSurfaceSlopeY( solution);
     389                InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeYEnum);
    390390        }
    391391        else if (analysis_type==PrognosticAnalysisEnum){
    392                 InputUpdateFromSolutionPrognostic( solution);
     392                InputUpdateFromSolutionOneDofCollapsed(solution,ThicknessEnum);
    393393        }
    394394        else if (analysis_type==BalancedthicknessAnalysisEnum){
    395                 InputUpdateFromSolutionBalancedthickness( solution);
     395                InputUpdateFromSolutionOneDofCollapsed(solution,ThicknessEnum);
    396396        }
    397397        else if (analysis_type==BalancedvelocitiesAnalysisEnum){
    398                 InputUpdateFromSolutionBalancedvelocities( solution);
     398                InputUpdateFromSolutionOneDofCollapsed(solution,VelEnum);
    399399        }
    400400        else if (analysis_type==ThermalAnalysisEnum){
     
    402402        }
    403403        else if (analysis_type==MeltingAnalysisEnum){
    404                 InputUpdateFromSolutionMelting( solution);
     404                InputUpdateFromSolutionOneDof(solution,MeltingRateEnum);
    405405        }
    406406        else{
     
    21362136        if (collapsed){
    21372137                if (!onbed){
     2138                        /*Do nothing. Element on bed will take care of it*/
    21382139                        return;
    21392140                }
     
    21712172        double       gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
    21722173
    2173         Input  *VzInput        = NULL;
    2174         double *VzPtr          = NULL;
     2174        Input  *vz_input        = NULL;
     2175        double *vz_ptr          = NULL;
    21752176        Penta  *penta          = NULL;
    21762177
     
    22052206
    22062207                /*Now Compute vel*/
    2207                 VzInput=inputs->GetInput(VzEnum);
    2208                 if (VzInput){
    2209                         if (VzInput->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(VzInput->Enum()));
    2210                         VzInput->GetValuesPtr(&VzPtr,&dummy);
    2211                         for(i=0;i<numvertices;i++) vz[i]=VzPtr[i];
     2208                vz_input=inputs->GetInput(VzEnum);
     2209                if (vz_input){
     2210                        if (vz_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(vz_input->Enum()));
     2211                        vz_input->GetValuesPtr(&vz_ptr,&dummy);
     2212                        for(i=0;i<numvertices;i++) vz[i]=vz_ptr[i];
    22122213                }
    22132214                else{for(i=0;i<numvertices;i++) vz[i]=0.0;}
     
    22622263        double       gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
    22632264       
    2264         Input  *VzInput        = NULL;
    2265         double *VzPtr          = NULL;
     2265        Input  *vz_input        = NULL;
     2266        double *vz_ptr          = NULL;
    22662267
    22672268        /*Get dof list: */
     
    22832284
    22842285        /*Get Vz*/
    2285         VzInput=inputs->GetInput(VzEnum);
    2286         if (VzInput){
    2287                 if (VzInput->Enum()!=PentaVertexInputEnum){
    2288                         ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(VzInput->Enum()));
     2286        vz_input=inputs->GetInput(VzEnum);
     2287        if (vz_input){
     2288                if (vz_input->Enum()!=PentaVertexInputEnum){
     2289                        ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(vz_input->Enum()));
    22892290                }
    2290                 VzInput->GetValuesPtr(&VzPtr,&dummy);
    2291                 for(i=0;i<numvertices;i++) vz[i]=VzPtr[i];
     2291                vz_input->GetValuesPtr(&vz_ptr,&dummy);
     2292                for(i=0;i<numvertices;i++) vz[i]=vz_ptr[i];
    22922293        }
    22932294        else{
     
    23432344        double       gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
    23442345       
    2345         Input*       VzInput=NULL;
    2346         double*      VzPtr=NULL;
     2346        Input*       vz_input=NULL;
     2347        double*      vz_ptr=NULL;
    23472348
    23482349        /*Get dof list: */
     
    23642365
    23652366        /*Get Vz*/
    2366         VzInput=inputs->GetInput(VzEnum);
    2367         if (VzInput){
    2368                 if (VzInput->Enum()!=PentaVertexInputEnum){
    2369                         ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(VzInput->Enum()));
     2367        vz_input=inputs->GetInput(VzEnum);
     2368        if (vz_input){
     2369                if (vz_input->Enum()!=PentaVertexInputEnum){
     2370                        ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(vz_input->Enum()));
    23702371                }
    2371                 VzInput->GetValuesPtr(&VzPtr,&dummy);
    2372                 for(i=0;i<numvertices;i++) vz[i]=VzPtr[i];
     2372                vz_input->GetValuesPtr(&vz_ptr,&dummy);
     2373                for(i=0;i<numvertices;i++) vz[i]=vz_ptr[i];
    23732374        }
    23742375        else{
     
    24242425        double       gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
    24252426
    2426         Input*       VxInput=NULL;
    2427         double*      VxPtr=NULL;
    2428         Input*       VyInput=NULL;
    2429         double*      VyPtr=NULL;
     2427        Input*       vx_input=NULL;
     2428        double*      vx_ptr=NULL;
     2429        Input*       vy_input=NULL;
     2430        double*      vy_ptr=NULL;
    24302431
    24312432        /*Get dof list: */
     
    24462447
    24472448        /*Get Vx and Vy*/
    2448         VxInput=inputs->GetInput(VxEnum);
    2449         if (VxInput){
    2450                 if (VxInput->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vx is of type %s",EnumAsString(VxInput->Enum()));
    2451                 VxInput->GetValuesPtr(&VxPtr,&dummy);
    2452                 for(i=0;i<numvertices;i++) vx[i]=VxPtr[i];
     2449        vx_input=inputs->GetInput(VxEnum);
     2450        if (vx_input){
     2451                if (vx_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vx is of type %s",EnumAsString(vx_input->Enum()));
     2452                vx_input->GetValuesPtr(&vx_ptr,&dummy);
     2453                for(i=0;i<numvertices;i++) vx[i]=vx_ptr[i];
    24532454        }
    24542455        else for(i=0;i<numvertices;i++) vx[i]=0.0;
    24552456
    2456         VyInput=inputs->GetInput(VyEnum);
    2457         if (VyInput){
    2458                 if (VyInput->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vy is of type %s",EnumAsString(VyInput->Enum()));
    2459                 VyInput->GetValuesPtr(&VyPtr,&dummy);
    2460                 for(i=0;i<numvertices;i++) vy[i]=VyPtr[i];
     2457        vy_input=inputs->GetInput(VyEnum);
     2458        if (vy_input){
     2459                if (vy_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vy is of type %s",EnumAsString(vy_input->Enum()));
     2460                vy_input->GetValuesPtr(&vy_ptr,&dummy);
     2461                for(i=0;i<numvertices;i++) vy[i]=vy_ptr[i];
    24612462        }
    24622463        else for(i=0;i<numvertices;i++) vy[i]=0.0;
     
    25432544
    25442545/*}}}*/
    2545 /*FUNCTION Penta::InputUpdateFromBedSlopeX{{{1*/
    2546 void  Penta::InputUpdateFromBedSlopeX(double* solution){
    2547 
    2548         int i;
    2549 
    2550         const int    numvertices=6;
    2551         const int    numdofpervertex=1;
    2552         const int    numdof=numdofpervertex*numvertices;
    2553 
    2554         int          doflist[numdof];
    2555         double       values[numdof];
    2556 
    2557         int          dummy;
    2558 
    2559         /*Get dof list: */
    2560         GetDofList(&doflist[0],&dummy);
    2561 
    2562         /*Use the dof list to index into the solution vector: */
    2563         for(i=0;i<numdof;i++){
    2564                 values[i]=solution[doflist[i]];
    2565         }
    2566 
    2567         /*Add bedslopex as inputs to the tria element: */
    2568         this->inputs->AddInput(new PentaVertexInput(BedSlopeXEnum,values));
    2569 }
    2570 /*}}}*/
    2571 /*FUNCTION Penta::InputUpdateFromBedSlopeY{{{1*/
    2572 void  Penta::InputUpdateFromBedSlopeY(double* solution){
    2573 
    2574         int i;
    2575 
    2576         const int    numvertices=6;
    2577         const int    numdofpervertex=1;
    2578         const int    numdof=numdofpervertex*numvertices;
    2579 
    2580         int          doflist[numdof];
    2581         double       values[numdof];
    2582 
    2583         int          dummy;
    2584 
    2585         /*Get dof list: */
    2586         GetDofList(&doflist[0],&dummy);
    2587 
    2588         /*Use the dof list to index into the solution vector: */
    2589         for(i=0;i<numdof;i++){
    2590                 values[i]=solution[doflist[i]];
    2591         }
    2592 
    2593         /*Add bedslopey as inputs to the tria element: */
    2594         this->inputs->AddInput(new PentaVertexInput(BedSlopeYEnum,values));
    2595 }
    2596 /*}}}*/
    2597 /*FUNCTION Penta::InputUpdateFromSurfaceSlopeX{{{1*/
    2598 void  Penta::InputUpdateFromSurfaceSlopeX(double* solution){
    2599 
    2600         int i;
    2601 
    2602         const int    numvertices=6;
    2603         const int    numdofpervertex=1;
    2604         const int    numdof=numdofpervertex*numvertices;
    2605 
    2606         int          doflist[numdof];
    2607         double       values[numdof];
    2608 
    2609         int          dummy;
    2610 
    2611         /*Get dof list: */
    2612         GetDofList(&doflist[0],&dummy);
    2613 
    2614         /*Use the dof list to index into the solution vector: */
    2615         for(i=0;i<numdof;i++){
    2616                 values[i]=solution[doflist[i]];
    2617         }
    2618 
    2619         /*Add surfaceslopex as inputs to the tria element: */
    2620         this->inputs->AddInput(new PentaVertexInput(SurfaceSlopeXEnum,values));
    2621 }
    2622 /*}}}*/
    2623 /*FUNCTION Penta::InputUpdateFromSurfaceSlopeY{{{1*/
    2624 void  Penta::InputUpdateFromSurfaceSlopeY(double* solution){
    2625 
    2626         int i;
    2627 
    2628         const int    numvertices=6;
    2629         const int    numdofpervertex=1;
    2630         const int    numdof=numdofpervertex*numvertices;
    2631 
    2632         int          doflist[numdof];
    2633         double       values[numdof];
    2634 
    2635         int          dummy;
    2636 
    2637         /*Get dof list: */
    2638         GetDofList(&doflist[0],&dummy);
    2639 
    2640         /*Use the dof list to index into the solution vector: */
    2641         for(i=0;i<numdof;i++){
    2642                 values[i]=solution[doflist[i]];
    2643         }
    2644 
    2645         /*Add surfaceslopey as inputs to the tria element: */
    2646         this->inputs->AddInput(new PentaVertexInput(SurfaceSlopeYEnum,values));
    2647 }
    2648 /*}}}*/
    26492546/*FUNCTION Penta::InputUpdateFromSolutionAdjointStokes {{{1*/
    26502547void  Penta::InputUpdateFromSolutionAdjointStokes(double* solution){
     
    27252622}
    27262623/*}}}*/
    2727 /*FUNCTION Penta::InputUpdateFromSolutionPrognostic {{{1*/
    2728 void  Penta::InputUpdateFromSolutionPrognostic(double* solution){
    2729 
    2730         int i;
    2731 
    2732         const int    numvertices=6;
    2733         const int    numdofpervertex=1;
    2734         const int    numdof=numdofpervertex*numvertices;
    2735 
    2736         int          doflist[numdof];
    2737         double       values[numdof];
    2738 
    2739         int          dummy;
    2740 
    2741         /*Get dof list: */
    2742         GetDofList(&doflist[0],&dummy);
    2743 
    2744         /*Use the dof list to index into the solution vector: */
    2745         for(i=0;i<numdof;i++){
    2746                 values[i]=solution[doflist[i]];
    2747         }
    2748 
    2749         /*Add thickness as inputs to the tria element: */
    2750         this->inputs->AddInput(new PentaVertexInput(ThicknessEnum,values));
    2751 }
    2752 /*}}}*/
    2753 /*FUNCTION Penta::InputUpdateFromSolutionBalancedthickness {{{1*/
    2754 void  Penta::InputUpdateFromSolutionBalancedthickness(double* solution){
    2755 
    2756         int i;
    2757 
    2758         const int    numvertices=6;
    2759         const int    numdofpervertex=1;
    2760         const int    numdof=numdofpervertex*numvertices;
    2761 
    2762         int          doflist[numdof];
    2763         double       values[numdof];
    2764 
    2765         int          dummy;
    2766 
    2767         /*Get dof list: */
    2768         GetDofList(&doflist[0],&dummy);
    2769 
    2770         /*Use the dof list to index into the solution vector: */
    2771         for(i=0;i<numdof;i++){
    2772                 values[i]=solution[doflist[i]];
    2773         }
    2774 
    2775         /*Add thickness as inputs to the tria element: */
    2776         this->inputs->AddInput(new PentaVertexInput(ThicknessEnum,values));
    2777 }
    2778 /*}}}*/
    2779 /*FUNCTION Penta::InputUpdateFromSolutionBalancedvelocities {{{1*/
    2780 void  Penta::InputUpdateFromSolutionBalancedvelocities(double* solution){
    2781         ISSMERROR(" not supported yet!");
    2782 }
    2783 /*}}}*/
    27842624/*FUNCTION Penta::InputUpdateFromSolutionThermal {{{1*/
    27852625void  Penta::InputUpdateFromSolutionThermal(double* solution){
     
    28222662}
    28232663/*}}}*/
    2824 /*FUNCTION Penta::InputUpdateFromSolutionMelting {{{1*/
    2825 void  Penta::InputUpdateFromSolutionMelting(double* solution){
    2826 
    2827         int i;
    2828 
    2829         const int    numvertices=6;
    2830         const int    numdofpervertex=1;
    2831         const int    numdof=numdofpervertex*numvertices;
    2832 
    2833         int          doflist[numdof];
    2834         double       values[numdof];
    2835 
    2836         int          dummy;
     2664/*FUNCTION Penta::InputUpdateFromSolutionOneDof{{{1*/
     2665void  Penta::InputUpdateFromSolutionOneDof(double* solution,int enum_type){
     2666
     2667        const int numvertices     = 6;
     2668        const int numdofpervertex = 1;
     2669        const int numdof          = numdofpervertex *numvertices;
     2670        int       doflist[numdof];
     2671        double    values[numdof];
     2672        int       dummy;
    28372673
    28382674        /*Get dof list: */
     
    28402676
    28412677        /*Use the dof list to index into the solution vector: */
    2842         for(i=0;i<numdof;i++){
     2678        for(int i=0;i<numdof;i++){
    28432679                values[i]=solution[doflist[i]];
    28442680        }
    28452681
    2846         /*Add thickness as inputs to the tria element: */
    2847         this->inputs->AddInput(new PentaVertexInput(MeltingRateEnum,values));
     2682        /*Add input to the element: */
     2683        this->inputs->AddInput(new PentaVertexInput(enum_type,values));
     2684}
     2685/*}}}*/
     2686/*FUNCTION Penta::InputUpdateFromSolutionOneDofCollpased{{{1*/
     2687void  Penta::InputUpdateFromSolutionOneDofCollapsed(double* solution,int enum_type){
     2688
     2689        const int  numvertices     = 6;
     2690        const int  numdofpervertex = 1;
     2691        const int  numdof          = numdofpervertex *numvertices;
     2692        const int  numdof2d        = numdof/2;
     2693        int        doflist[numdof];
     2694        double     values[numdof];
     2695        int        dummy;
     2696        Penta     *penta           = NULL;
     2697        bool       onbed;
     2698
     2699        /*Recover inputs*/
     2700        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
     2701
     2702        /*If not on bed, return*/
     2703        if (!onbed) return;
     2704
     2705        /*Get dof list: */
     2706        GetDofList(&doflist[0],&dummy);
     2707
     2708        /*Use the dof list to index into the solution vector and extrude it */
     2709        for(int i=0;i<numdof2d;i++){
     2710                values[i]         =solution[doflist[i]];
     2711                values[i+numdof2d]=values[i];
     2712        }
     2713
     2714        /*Start looping over all elements above current element and update all inputs*/
     2715        penta=this;
     2716        for(;;){
     2717
     2718                /*Add input to the element: */
     2719                penta->inputs->AddInput(new PentaVertexInput(enum_type,values));
     2720
     2721                /*Stop if we have reached the surface*/
     2722                if (penta->IsOnSurface()) break;
     2723
     2724                /* get upper Penta*/
     2725                penta=penta->GetUpperElement(); ISSMASSERT(penta->Id()!=this->id);
     2726        }
    28482727}
    28492728/*}}}*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4832 r4835  
    174174                void    InputUpdateFromSolutionAdjointHoriz( double* solutiong);
    175175                void    InputUpdateFromSolutionAdjointStokes( double* solutiong);
    176                 void    InputUpdateFromSolutionBalancedthickness( double* solutiong);
    177                 void    InputUpdateFromSolutionBalancedvelocities( double* solutiong);
    178176                void    InputUpdateFromSolutionDiagnosticHoriz( double* solutiong);
    179177                void    InputUpdateFromSolutionDiagnosticMacAyeal( double* solutiong);
     
    182180                void    InputUpdateFromSolutionDiagnosticVert( double* solutiong);
    183181                void    InputUpdateFromSolutionDiagnosticStokes( double* solutiong);
    184                 void    InputUpdateFromSolutionPrognostic( double* solutiong);
    185                 void    InputUpdateFromBedSlopeX( double* solutiong);
    186                 void    InputUpdateFromBedSlopeY( double* solutiong);
    187                 void    InputUpdateFromSurfaceSlopeX( double* solutiong);
    188                 void    InputUpdateFromSurfaceSlopeY( double* solutiong);
    189182                void    InputUpdateFromSolutionThermal( double* solutiong);
    190                 void    InputUpdateFromSolutionMelting( double* solutiong);
     183                void    InputUpdateFromSolutionOneDof(double* solutiong,int enum_type);
     184                void    InputUpdateFromSolutionOneDofCollapsed(double* solutiong,int enum_type);
    191185                bool      IsInput(int name);
    192186                bool      IsOnSurface(void);
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r4804 r4835  
    377377        }
    378378        else if (analysis_type==BedSlopeXAnalysisEnum){
    379                 InputUpdateFromSolutionBedSlopeX( solution);
     379                InputUpdateFromSolutionOneDof(solution,BedSlopeXEnum);
    380380        }
    381381        else if (analysis_type==BedSlopeYAnalysisEnum){
    382                 InputUpdateFromSolutionBedSlopeY( solution);
     382                InputUpdateFromSolutionOneDof(solution,BedSlopeYEnum);
    383383        }
    384384        else if (analysis_type==SurfaceSlopeXAnalysisEnum){
    385                 InputUpdateFromSolutionSurfaceSlopeX( solution);
     385                InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum);
    386386        }
    387387        else if (analysis_type==SurfaceSlopeYAnalysisEnum){
    388                 InputUpdateFromSolutionSurfaceSlopeY( solution);
     388                InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum);
    389389        }
    390390        else if (analysis_type==PrognosticAnalysisEnum){
    391                 InputUpdateFromSolutionPrognostic( solution);
     391                InputUpdateFromSolutionOneDof(solution,ThicknessEnum);
    392392        }
    393393        else if (analysis_type==BalancedthicknessAnalysisEnum){
    394                 InputUpdateFromSolutionBalancedthickness( solution);
     394                InputUpdateFromSolutionOneDof(solution,ThicknessEnum);
    395395        }
    396396        else if (analysis_type==BalancedvelocitiesAnalysisEnum){
    397                 InputUpdateFromSolutionBalancedvelocities( solution);
     397                InputUpdateFromSolutionOneDof(solution,VelEnum);
    398398        }
    399399        else{
     
    55515551}
    55525552/*}}}*/
    5553 /*FUNCTION Tria::InputUpdateFromSolutionBedSlopeX {{{1*/
    5554 void  Tria::InputUpdateFromSolutionBedSlopeX(double* solution){
    5555 
    5556         int i;
    5557 
    5558         const int    numvertices=3;
    5559         const int    numdofpervertex=1;
    5560         const int    numdof=numdofpervertex*numvertices;
    5561 
    5562         int          doflist[numdof];
    5563         double       values[numdof];
    5564 
    5565         int          dummy;
     5553/*FUNCTION Tria::InputUpdateFromSolutionOneDof{{{1*/
     5554void  Tria::InputUpdateFromSolutionOneDof(double* solution,int enum_type){
     5555
     5556        const int numvertices     = 3;
     5557        const int numdofpervertex = 1;
     5558        const int numdof          = numdofpervertex *numvertices;
     5559        int       doflist[numdof];
     5560        double    values[numdof];
     5561        int       dummy;
    55665562
    55675563        /*Get dof list: */
     
    55695565
    55705566        /*Use the dof list to index into the solution vector: */
    5571         for(i=0;i<numdof;i++){
     5567        for(int i=0;i<numdof;i++){
    55725568                values[i]=solution[doflist[i]];
    55735569        }
    55745570
    5575         /*Add slopex as inputs to the tria element: */
    5576         this->inputs->AddInput(new TriaVertexInput(BedSlopeXEnum,values));
    5577 }
    5578 /*}}}*/
    5579 /*FUNCTION Tria::InputUpdateFromSolutionBedSlopeX {{{1*/
    5580 void  Tria::InputUpdateFromSolutionBedSlopeY(double* solution){
    5581 
    5582         int i;
    5583 
    5584         const int    numvertices=3;
    5585         const int    numdofpervertex=1;
    5586         const int    numdof=numdofpervertex*numvertices;
    5587 
    5588         int          doflist[numdof];
    5589         double       values[numdof];
    5590 
    5591         int          dummy;
    5592 
    5593         /*Get dof list: */
    5594         GetDofList(&doflist[0],&dummy);
    5595 
    5596         /*Use the dof list to index into the solution vector: */
    5597         for(i=0;i<numdof;i++){
    5598                 values[i]=solution[doflist[i]];
    5599         }
    5600 
    5601         /*Add slopex as inputs to the tria element: */
    5602         this->inputs->AddInput(new TriaVertexInput(BedSlopeYEnum,values));
    5603 }
    5604 /*}}}*/
    5605 /*FUNCTION Tria::InputUpdateFromSolutionSurfaceSlopeX {{{1*/
    5606 void  Tria::InputUpdateFromSolutionSurfaceSlopeX(double* solution){
    5607 
    5608         int i;
    5609 
    5610         const int    numvertices=3;
    5611         const int    numdofpervertex=1;
    5612         const int    numdof=numdofpervertex*numvertices;
    5613 
    5614         int          doflist[numdof];
    5615         double       values[numdof];
    5616 
    5617         int          dummy;
    5618 
    5619         /*Get dof list: */
    5620         GetDofList(&doflist[0],&dummy);
    5621 
    5622         /*Use the dof list to index into the solution vector: */
    5623         for(i=0;i<numdof;i++){
    5624                 values[i]=solution[doflist[i]];
    5625         }
    5626 
    5627         /*Add slopex as inputs to the tria element: */
    5628         this->inputs->AddInput(new TriaVertexInput(SurfaceSlopeXEnum,values));
    5629 }
    5630 /*}}}*/
    5631 /*FUNCTION Tria::InputUpdateFromSolutionSurfaceSlopeY {{{1*/
    5632 void  Tria::InputUpdateFromSolutionSurfaceSlopeY(double* solution){
    5633 
    5634         int i;
    5635 
    5636         const int    numvertices=3;
    5637         const int    numdofpervertex=1;
    5638         const int    numdof=numdofpervertex*numvertices;
    5639 
    5640         int          doflist[numdof];
    5641         double       values[numdof];
    5642 
    5643         int          dummy;
    5644 
    5645         /*Get dof list: */
    5646         GetDofList(&doflist[0],&dummy);
    5647 
    5648         /*Use the dof list to index into the solution vector: */
    5649         for(i=0;i<numdof;i++){
    5650                 values[i]=solution[doflist[i]];
    5651         }
    5652 
    5653         /*Add slopex as inputs to the tria element: */
    5654         this->inputs->AddInput(new TriaVertexInput(SurfaceSlopeYEnum,values));
    5655 }
    5656 /*}}}*/
    5657 /*FUNCTION Tria::InputUpdateFromSolutionPrognostic {{{1*/
    5658 void  Tria::InputUpdateFromSolutionPrognostic(double* solution){
    5659 
    5660         int i;
    5661 
    5662         const int    numvertices=3;
    5663         const int    numdofpervertex=1;
    5664         const int    numdof=numdofpervertex*numvertices;
    5665 
    5666         int          doflist[numdof];
    5667         double       values[numdof];
    5668 
    5669         int          dummy;
    5670 
    5671         /*Get dof list: */
    5672         GetDofList(&doflist[0],&dummy);
    5673 
    5674         /*Use the dof list to index into the solution vector: */
    5675         for(i=0;i<numdof;i++){
    5676                 values[i]=solution[doflist[i]];
    5677         }
    5678 
    5679         /*Add thickness as inputs to the tria element: */
    5680         this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,values));
    5681 }
    5682 /*}}}*/
    5683 /*FUNCTION Tria::InputUpdateFromSolutionBalancedthickness {{{1*/
    5684 void  Tria::InputUpdateFromSolutionBalancedthickness(double* solution){
    5685 
    5686         int i;
    5687 
    5688         const int    numvertices=3;
    5689         const int    numdofpervertex=1;
    5690         const int    numdof=numdofpervertex*numvertices;
    5691 
    5692         int          doflist[numdof];
    5693         double       values[numdof];
    5694         double       thickness[numvertices];
    5695 
    5696         int          dummy;
    5697 
    5698         /*Get dof list: */
    5699         GetDofList(&doflist[0],&dummy);
    5700 
    5701         /*Use the dof list to index into the solution vector: */
    5702         for(i=0;i<numdof;i++){
    5703                 values[i]=solution[doflist[i]];
    5704         }
    5705 
    5706         /*Add thickness as inputs to the tria element: */
    5707         this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,values));
    5708 }
    5709 /*}}}*/
    5710 /*FUNCTION Tria::InputUpdateFromSolutionBalancedvelocities {{{1*/
    5711 void  Tria::InputUpdateFromSolutionBalancedvelocities(double* solution){
    5712         ISSMERROR(" not supported yet!");
     5571        /*Add input to the element: */
     5572        this->inputs->AddInput(new TriaVertexInput(enum_type,values));
    57135573}
    57145574/*}}}*/
  • issm/trunk/src/c/objects/Elements/Tria.h

    r4780 r4835  
    151151                void      InputUpdateFromSolutionDiagnosticHoriz( double* solution);
    152152                void      InputUpdateFromSolutionDiagnosticHutter( double* solution);
    153                 void      InputUpdateFromSolutionBedSlopeX( double* solution);
    154                 void      InputUpdateFromSolutionBedSlopeY( double* solution);
    155                 void      InputUpdateFromSolutionSurfaceSlopeX( double* solution);
    156                 void      InputUpdateFromSolutionSurfaceSlopeY( double* solution);
    157                 void      InputUpdateFromSolutionPrognostic( double* solution);
    158                 void      InputUpdateFromSolutionBalancedthickness( double* solution);
    159                 void      InputUpdateFromSolutionBalancedvelocities( double* solution);
     153                void      InputUpdateFromSolutionOneDof(double* solution,int enum_type);
    160154                bool      IsInput(int name);
    161155                void      SetClone(int* minranks);
  • issm/trunk/src/c/solutions/balancedthickness_core.cpp

    r4409 r4835  
    3434        solver_linear(NULL,femmodel);
    3535
    36         _printf_("extrude computed thickness on all layers:\n");
    37         InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,ThicknessEnum);
    38 
    3936        if(verbose)_printf_("saving results:\n");
    4037        if(solution_type==BalancedthicknessSolutionEnum){
  • issm/trunk/src/c/solutions/balancedvelocities_core.cpp

    r4356 r4835  
    3434        solver_linear(NULL,femmodel);
    3535
    36         _printf_("extrude computed velocity on all layers:\n");
    37         InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum);
    38         InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum);
    39 
    4036        if(verbose)_printf_("saving results:\n");
    4137        if(solution_type==BalancedvelocitiesSolutionEnum){
  • issm/trunk/src/c/solutions/bedslope_core.cpp

    r4356 r4835  
    3232        solver_linear(NULL,femmodel);
    3333       
    34         /*extrude inputs if we are in 3D: */
    35         if (dim==3){
    36                 if(verbose)_printf_("%s\n","extruding bed in 3d...");
    37                 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,BedSlopeXEnum);
    38                 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,BedSlopeYEnum);
    39         }
    40        
    4134        if(verbose)_printf_("saving results:\n");
    4235        if(solution_type==BedSlopeSolutionEnum){
  • issm/trunk/src/c/solutions/prognostic_core.cpp

    r4356 r4835  
    3131        solver_linear(NULL,femmodel);
    3232               
    33         _printf_("extrude computed thickness on all layers:\n");
    34         InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,ThicknessEnum);
    35 
    3633        if(verbose)_printf_("saving results:\n");
    3734        if(solution_type==PrognosticSolutionEnum){
  • issm/trunk/src/c/solutions/surfaceslope_core.cpp

    r4356 r4835  
    3232        solver_linear(NULL,femmodel);
    3333       
    34         /*extrude inputs if we are in 3D: */
    35         if (dim==3){
    36                 if(verbose)_printf_("%s\n","extruding slope in 3d...");
    37                 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,SurfaceSlopeXEnum);
    38                 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,SurfaceSlopeYEnum);
    39         }
    40        
    4134        if(verbose)_printf_("saving results:\n");
    4235        if(solution_type==SurfaceSlopeSolutionEnum){
  • issm/trunk/src/m/solutions/balancedthickness_core.m

    r4481 r4835  
    1919        displaystring(verbose,'\n%s',['call computational core...']);
    2020        femmodel=solver_linear(femmodel);
    21        
    22         displaystring(verbose,'\n%s',['extude computed thickness on all layers...']);
    23         femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,ThicknessEnum);
    2421
    2522        if solution_type==BalancedthicknessSolutionEnum,
  • issm/trunk/src/m/solutions/balancedvelocities_core.m

    r4366 r4835  
    2323        femmodel=solver_linear(femmodel);
    2424       
    25         displaystring(verbose,'\n%s',['extude computed thickness on all layers...']);
    26         femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VxEnum);
    27         femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VyEnum);
    28 
    2925        if solution_type==BalancedvelocitiesSolutionEnum,
    3026                displaystring(verbose,'\n%s',['saving results...']);
  • issm/trunk/src/m/solutions/bedslope_core.m

    r4438 r4835  
    1919        femmodel=solver_linear(femmodel);
    2020       
    21         %extrude inputs if we are in 3D: */
    22         if dim==3,
    23                 displaystring(verbose,'\n%s',['extruding bed slope in 3d...']);
    24                 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,BedSlopeXEnum);
    25                 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,BedSlopeYEnum);
    26         end
    27        
    2821        if solution_type==BedSlopeSolutionEnum,
    2922                displaystring(verbose,'\n%s',['saving results...']);
  • issm/trunk/src/m/solutions/prognostic_core.m

    r4366 r4835  
    1919        femmodel=solver_linear(femmodel);
    2020       
    21         displaystring(verbose,'\n%s',['extude computed thickness on all layers...']);
    22         femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,ThicknessEnum);
    23 
    2421        if solution_type==PrognosticSolutionEnum,
    2522                displaystring(verbose,'\n%s',['saving results...']);
  • issm/trunk/src/m/solutions/surfaceslope_core.m

    r4415 r4835  
    1919        femmodel=solver_linear(femmodel);
    2020       
    21         %extrude inputs if we are in 3D: */
    22         if dim==3,
    23                 displaystring(verbose,'\n%s',['extruding surface slope in 3d...']);
    24                 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,SurfaceSlopeXEnum);
    25                 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,SurfaceSlopeYEnum);
    26         end
    27        
    2821        if solution_type==SurfaceSlopeSolutionEnum,
    2922                displaystring(verbose,'\n%s',['saving results...']);
Note: See TracChangeset for help on using the changeset viewer.