Changeset 4375


Ignore:
Timestamp:
07/01/10 09:03:59 (15 years ago)
Author:
seroussi
Message:

updated InputToSolution for Slope solutions (bed, surface, x and y)

Location:
issm/trunk/src/c/objects/Elements
Files:
2 edited

Legend:

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

    r4374 r4375  
    345345                InputUpdateFromSolutionAdjoint( solution);
    346346        }
    347         else if (analysis_type==BedSlopeXAnalysisEnum || analysis_type==SurfaceSlopeXAnalysisEnum || analysis_type==BedSlopeYAnalysisEnum || analysis_type==SurfaceSlopeYAnalysisEnum){
    348                 InputUpdateFromSolutionSlopeCompute( solution);
     347        else if (analysis_type==BedSlopeXAnalysisEnum){
     348                InputUpdateFromSolutionBedSlopeX( solution);
     349        }
     350        else if (analysis_type==BedSlopeYAnalysisEnum){
     351                InputUpdateFromSolutionBedSlopeY( solution);
     352        }
     353        else if (analysis_type==SurfaceSlopeXAnalysisEnum){
     354                InputUpdateFromSolutionSurfaceSlopeX( solution);
     355        }
     356        else if (analysis_type==SurfaceSlopeYAnalysisEnum){
     357                InputUpdateFromSolutionSurfaceSlopeY( solution);
    349358        }
    350359        else if (analysis_type==PrognosticAnalysisEnum){
     
    54525461}
    54535462/*}}}*/
    5454 /*FUNCTION Tria::InputUpdateFromSolutionSlopeCompute {{{1*/
    5455 void  Tria::InputUpdateFromSolutionSlopeCompute(double* solution){
    5456         ISSMERROR(" not supported yet!");
     5463/*FUNCTION Tria::InputUpdateFromSolutionBedSlopeX {{{1*/
     5464void  Tria::InputUpdateFromSolutionBedSlopeX(double* solution){
     5465
     5466        int i;
     5467
     5468        const int    numvertices=3;
     5469        const int    numdofpervertex=1;
     5470        const int    numdof=numdofpervertex*numvertices;
     5471
     5472        int          doflist[numdof];
     5473        double       values[numdof];
     5474
     5475        int          dummy;
     5476
     5477        /*Get dof list: */
     5478        GetDofList(&doflist[0],&dummy);
     5479
     5480        /*Use the dof list to index into the solution vector: */
     5481        for(i=0;i<numdof;i++){
     5482                values[i]=solution[doflist[i]];
     5483        }
     5484
     5485        /*Add slopex as inputs to the tria element: */
     5486        this->inputs->AddInput(new TriaVertexInput(BedSlopeXEnum,values));
     5487}
     5488/*}}}*/
     5489/*FUNCTION Tria::InputUpdateFromSolutionBedSlopeX {{{1*/
     5490void  Tria::InputUpdateFromSolutionBedSlopeY(double* solution){
     5491
     5492        int i;
     5493
     5494        const int    numvertices=3;
     5495        const int    numdofpervertex=1;
     5496        const int    numdof=numdofpervertex*numvertices;
     5497
     5498        int          doflist[numdof];
     5499        double       values[numdof];
     5500
     5501        int          dummy;
     5502
     5503        /*Get dof list: */
     5504        GetDofList(&doflist[0],&dummy);
     5505
     5506        /*Use the dof list to index into the solution vector: */
     5507        for(i=0;i<numdof;i++){
     5508                values[i]=solution[doflist[i]];
     5509        }
     5510
     5511        /*Add slopex as inputs to the tria element: */
     5512        this->inputs->AddInput(new TriaVertexInput(BedSlopeYEnum,values));
     5513}
     5514/*}}}*/
     5515/*FUNCTION Tria::InputUpdateFromSolutionSurfaceSlopeX {{{1*/
     5516void  Tria::InputUpdateFromSolutionSurfaceSlopeX(double* solution){
     5517
     5518        int i;
     5519
     5520        const int    numvertices=3;
     5521        const int    numdofpervertex=1;
     5522        const int    numdof=numdofpervertex*numvertices;
     5523
     5524        int          doflist[numdof];
     5525        double       values[numdof];
     5526
     5527        int          dummy;
     5528
     5529        /*Get dof list: */
     5530        GetDofList(&doflist[0],&dummy);
     5531
     5532        /*Use the dof list to index into the solution vector: */
     5533        for(i=0;i<numdof;i++){
     5534                values[i]=solution[doflist[i]];
     5535        }
     5536
     5537        /*Add slopex as inputs to the tria element: */
     5538        this->inputs->AddInput(new TriaVertexInput(SurfaceSlopeXEnum,values));
     5539}
     5540/*}}}*/
     5541/*FUNCTION Tria::InputUpdateFromSolutionSurfaceSlopeY {{{1*/
     5542void  Tria::InputUpdateFromSolutionSurfaceSlopeY(double* solution){
     5543
     5544        int i;
     5545
     5546        const int    numvertices=3;
     5547        const int    numdofpervertex=1;
     5548        const int    numdof=numdofpervertex*numvertices;
     5549
     5550        int          doflist[numdof];
     5551        double       values[numdof];
     5552
     5553        int          dummy;
     5554
     5555        /*Get dof list: */
     5556        GetDofList(&doflist[0],&dummy);
     5557
     5558        /*Use the dof list to index into the solution vector: */
     5559        for(i=0;i<numdof;i++){
     5560                values[i]=solution[doflist[i]];
     5561        }
     5562
     5563        /*Add slopex as inputs to the tria element: */
     5564        this->inputs->AddInput(new TriaVertexInput(SurfaceSlopeYEnum,values));
    54575565}
    54585566/*}}}*/
  • issm/trunk/src/c/objects/Elements/Tria.h

    r4353 r4375  
    154154                void      InputUpdateFromSolutionAdjoint( double* solution);
    155155                void      InputUpdateFromSolutionDiagnosticHoriz( double* solution);
    156                 void      InputUpdateFromSolutionSlopeCompute( double* solution);
     156                void      InputUpdateFromSolutionBedSlopeX( double* solution);
     157                void      InputUpdateFromSolutionBedSlopeY( double* solution);
     158                void      InputUpdateFromSolutionSurfaceSlopeX( double* solution);
     159                void      InputUpdateFromSolutionSurfaceSlopeY( double* solution);
    157160                void      InputUpdateFromSolutionPrognostic( double* solution);
    158161                void      InputUpdateFromSolutionPrognostic2(double* solution);
Note: See TracChangeset for help on using the changeset viewer.