source: issm/oecreview/Archive/16554-17801/ISSM-17244-17245.diff@ 17802

Last change on this file since 17802 was 17802, checked in by Mathieu Morlighem, 11 years ago

Added archives

File size: 2.3 KB
  • ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp

     
    483483                }
    484484                else{
    485485                        IoModelToConstraintsx(constraints,iomodel,StressbalanceSpcvxEnum,StressbalanceAnalysisEnum,finiteelement,1);
    486                         if(iomodel->meshtype==Mesh3DEnum){
     486                        if(iomodel->meshtype!=Mesh2DverticalEnum){
    487487                                IoModelToConstraintsx(constraints,iomodel,StressbalanceSpcvyEnum,StressbalanceAnalysisEnum,finiteelement,2);
    488488                        }
    489489                }
     
    962962void StressbalanceAnalysis::GetSolutionFromInputsHoriz(Vector<IssmDouble>* solution,Element* element){/*{{{*/
    963963
    964964        IssmDouble   vx,vy;
    965         int          meshtype,dim,approximation;
     965        int          meshtype,dim,approximation,dofpernode;
    966966        int*         doflist = NULL;
    967967
    968968        /*Get some parameters*/
    969969        element->FindParam(&meshtype,MeshTypeEnum);
    970970        switch(meshtype){
    971                 case Mesh2DverticalEnum: dim = 2; break;
    972                 case Mesh3DEnum:         dim = 3; break;
     971                case Mesh2DhorizontalEnum: dim = 2; dofpernode = 2; break;
     972                case Mesh2DverticalEnum:   dim = 2; dofpernode = 1; break;
     973                case Mesh3DEnum:           dim = 3; dofpernode = 2; break;
    973974                default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
    974975        }
    975976
    976977        /*Fetch number of nodes and dof for this finite element*/
    977978        int numnodes = element->GetNumberOfNodes();
    978         int numdof   = numnodes*(dim-1);
     979        int numdof   = numnodes*dofpernode;
    979980        element->GetInputValue(&approximation,ApproximationEnum);
    980981
    981982        /*Fetch dof list and allocate solution vector*/
     
    985986        /*Get inputs*/
    986987        Input* vx_input=element->GetInput(VxEnum); _assert_(vx_input);
    987988        Input* vy_input=NULL;
    988         if(dim==3){vy_input=element->GetInput(VyEnum); _assert_(vy_input);}
     989        if(meshtype!=Mesh2DverticalEnum){vy_input=element->GetInput(VyEnum); _assert_(vy_input);}
    989990
    990991        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
    991992        Gauss* gauss=element->NewGauss();
     
    994995
    995996                /*Recover vx and vy*/
    996997                vx_input->GetInputValue(&vx,gauss);
    997                 values[i*(dim-1)+0]=vx;
    998                 if(dim==3){
     998                values[i*dofpernode+0]=vx;
     999                if(dofpernode==2){
    9991000                        vy_input->GetInputValue(&vy,gauss);
    1000                         values[i*(dim-1)+1]=vy;
     1001                        values[i*dofpernode+1]=vy;
    10011002                }
    10021003        }
    10031004
Note: See TracBrowser for help on using the repository browser.