Changeset 14971


Ignore:
Timestamp:
05/08/13 21:00:42 (12 years ago)
Author:
adhikari
Message:

CHG: dWdt now assembles solution properly in parallel runs as well

Location:
issm/trunk-jpl/src/c
Files:
5 edited

Legend:

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

    r14970 r14971  
    18811881void  Tria::InputUpdateFromVector(IssmDouble* vector, int name, int type){
    18821882
    1883        
    18841883        const int   numdof         = NDOF1 *NUMVERTICES;
    18851884        int        *doflist        = NULL;
     
    18901889
    18911890        switch(type){
     1891        #ifdef _HAVE_GIA_
     1892        case GiaAnalysisEnum:
     1893                InputUpdateFromVectorGia(vector);
     1894                break;
     1895        #endif
    18921896        case VertexEnum:
    18931897                /*Get values on the 3 vertices*/
     
    19021906                        this->inputs->AddInput(new TriaP1Input(name,values));
    19031907                }
    1904                 return;
     1908                return; 
    19051909
    19061910        case NodesEnum:
     
    19151919                /*Add input to the element: */
    19161920                this->inputs->AddInput(new TriaP1Input(name,values));
     1921               
    19171922                /*Free ressources:*/
    19181923                xDelete<int>(doflist);
     
    19201925
    19211926        default:
    1922        
    1923                         _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
    1924         }
     1927                _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
     1928        }
     1929
    19251930}
    19261931/*}}}*/
     
    32353240        /*Add input to the element: */
    32363241        this->inputs->AddInput(new TriaP1Input(GiaWEnum,values));
     3242
     3243}
     3244/*}}}*/
     3245/*FUNCTION Tria::InputUpdateFromVectorGia{{{*/
     3246void  Tria::InputUpdateFromVectorGia(IssmDouble* vector){
     3247
     3248        int vertexsidlist[NUMVERTICES];
     3249        IssmDouble    values[NUMVERTICES];
     3250
     3251        /*Get sid list: */
     3252        this->GetVertexSidList(&vertexsidlist[0]);
     3253
     3254        /*Use the dof list to index into the solution vector: */
     3255        for(int i=0;i<NUMVERTICES;i++){
     3256                values[i]=vector[vertexsidlist[i]];
     3257                if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
     3258        }
     3259
     3260        /*Add input to the element: */
     3261        this->inputs->AddInput(new TriaP1Input(GiadWdtEnum,values));
    32373262
    32383263}
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h

    r14967 r14971  
    142142                #ifdef _HAVE_GIA_
    143143                void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
    144                 void   InputUpdateFromSolutionGia(IssmDouble* solution);
     144                void   InputUpdateFromSolutionGia(IssmDouble* solution);
     145                void   InputUpdateFromVectorGia(IssmDouble* vector);
    145146                #endif
    146147
  • issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp

    r14960 r14971  
    176176        }
    177177        else if (irate==1){
     178                *pwi=0;
    178179                dwidt = blocks_.aswokm;
    179180                *pdwidt=dwidt;
    180                 *pwi=0;
    181181        }
    182182
    183         //printf("deflection: %g deflection rate %g\n",wi, dwidt);
    184 
    185183}
  • issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp

    r14960 r14971  
    120120                        analyses[7]=EnthalpyAnalysisEnum;
    121121                        analyses[8]=PrognosticAnalysisEnum;
    122                         //analyses[9]=GiaAnalysisEnum;
    123122                        break;
    124123
  • issm/trunk-jpl/src/c/solutions/gia_core.cpp

    r14960 r14971  
    1010#include "../modules/modules.h"
    1111#include "../solvers/solvers.h"
    12 
    1312void gia_core(FemModel* femmodel){
    1413
    1514        int i;
    1615        Vector<IssmDouble>*  wg  = NULL;
    17         Vector<IssmDouble>*  dwgdt  = NULL;
     16        Vector<IssmDouble>*  dwdtg  = NULL;
    1817        IssmDouble*          x   = NULL;
    1918        IssmDouble*          y   = NULL;
     
    3635        gsize      = femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum);
    3736        wg = new Vector<IssmDouble>(gsize);
    38         dwgdt = new Vector<IssmDouble>(gsize);
     37        dwdtg = new Vector<IssmDouble>(gsize);
    3938
    4039        /*first, recover x and y vectors from vertices: */
     
    4241
    4342        /*call the main module: */
    44         femmodel->Deflection(wg,dwgdt,x,y);
     43        femmodel->Deflection(wg,dwdtg,x,y);
    4544
    4645        /*assemble vector: */
    4746        wg->Assemble();
    48         dwgdt->Assemble();
     47        dwdtg->Assemble();
    4948
    5049        InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,wg);
    51         InputUpdateFromVectorx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,dwgdt,GiadWdtEnum,VertexEnum);
     50        InputUpdateFromVectorx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,dwdtg,GiadWdtEnum,GiaAnalysisEnum);
    5251
    5352        if(save_results){
Note: See TracChangeset for help on using the changeset viewer.