Changeset 24731


Ignore:
Timestamp:
04/23/20 11:15:46 (5 years ago)
Author:
tsantos
Message:

CHG: inserting PVector in the FCT method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp

    r24715 r24731  
    144144        *pLHS  = LHS;
    145145}/*}}}*/
    146 void CreateRHS(Vec* pRHS,Mat K,Mat D,Vec Ml,Vec u,IssmDouble theta,IssmDouble deltat,IssmDouble dmax,FemModel* femmodel,int configuration_type){/*{{{*/
     146void CreateRHS(Vec* pRHS,Mat K,Mat D,Vec Ml,Vec p,Vec u,IssmDouble theta,IssmDouble deltat,IssmDouble dmax,FemModel* femmodel,int configuration_type){/*{{{*/
    147147        /*Create Right Hand side of Lower order solution
    148148         *
     
    170170        VecPointwiseMult(RHS,Ml,u);
    171171        VecAXPBYPCZ(RHS,(1-theta)*deltat,(1-theta)*deltat,1,Ku,Du);
     172        VecAXPBY(RHS,deltat,1,p);
    172173        VecFree(&Ku);
    173174        VecFree(&Du);
     
    392393        Matrix<IssmDouble>*  K  = NULL;
    393394        Matrix<IssmDouble>*  Mc = NULL;
     395        Vector<IssmDouble>*  p  = NULL;
    394396        Vector<IssmDouble>*  ug = NULL;
    395397        Vector<IssmDouble>*  uf = NULL;
     
    401403        femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
    402404        femmodel->UpdateConstraintsx();
    403         theta = 0.5;
     405        theta = 0.5; //0.5==Crank-Nicolson, 1==Backward Euler
    404406
    405407        /*Create analysis*/
     
    410412                        manalysis->MassMatrix(&Mc,femmodel);
    411413                        manalysis->FctKMatrix(&K,NULL,femmodel);
     414                        manalysis->FctPVector(&p,femmodel);
    412415                        break;
    413416                case DamageEvolutionAnalysisEnum:
     
    431434        Mat K_petsc  = K->pmatrix->matrix;
    432435        Mat Mc_petsc = Mc->pmatrix->matrix;
     436        Vec p_petsc      = p->pvector->vector;
    433437
    434438        /*Get previous solution u^n*/
     
    449453
    450454        /*Create RHS: [ML + (1 - theta) deltaT L^n] u^n */
    451         CreateRHS(&RHS,K_petsc,D_petsc,Ml_petsc,uf->pvector->vector,theta,deltat,dmax,femmodel,configuration_type);
     455        CreateRHS(&RHS,K_petsc,D_petsc,Ml_petsc,p_petsc,uf->pvector->vector,theta,deltat,dmax,femmodel,configuration_type);
    452456        delete uf;
     457        delete p;
    453458
    454459        /*Go solve lower order solution*/
Note: See TracChangeset for help on using the changeset viewer.