Changeset 24731
- Timestamp:
- 04/23/20 11:15:46 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp
r24715 r24731 144 144 *pLHS = LHS; 145 145 }/*}}}*/ 146 void CreateRHS(Vec* pRHS,Mat K,Mat D,Vec Ml,Vec u,IssmDouble theta,IssmDouble deltat,IssmDouble dmax,FemModel* femmodel,int configuration_type){/*{{{*/146 void CreateRHS(Vec* pRHS,Mat K,Mat D,Vec Ml,Vec p,Vec u,IssmDouble theta,IssmDouble deltat,IssmDouble dmax,FemModel* femmodel,int configuration_type){/*{{{*/ 147 147 /*Create Right Hand side of Lower order solution 148 148 * … … 170 170 VecPointwiseMult(RHS,Ml,u); 171 171 VecAXPBYPCZ(RHS,(1-theta)*deltat,(1-theta)*deltat,1,Ku,Du); 172 VecAXPBY(RHS,deltat,1,p); 172 173 VecFree(&Ku); 173 174 VecFree(&Du); … … 392 393 Matrix<IssmDouble>* K = NULL; 393 394 Matrix<IssmDouble>* Mc = NULL; 395 Vector<IssmDouble>* p = NULL; 394 396 Vector<IssmDouble>* ug = NULL; 395 397 Vector<IssmDouble>* uf = NULL; … … 401 403 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 402 404 femmodel->UpdateConstraintsx(); 403 theta = 0.5; 405 theta = 0.5; //0.5==Crank-Nicolson, 1==Backward Euler 404 406 405 407 /*Create analysis*/ … … 410 412 manalysis->MassMatrix(&Mc,femmodel); 411 413 manalysis->FctKMatrix(&K,NULL,femmodel); 414 manalysis->FctPVector(&p,femmodel); 412 415 break; 413 416 case DamageEvolutionAnalysisEnum: … … 431 434 Mat K_petsc = K->pmatrix->matrix; 432 435 Mat Mc_petsc = Mc->pmatrix->matrix; 436 Vec p_petsc = p->pvector->vector; 433 437 434 438 /*Get previous solution u^n*/ … … 449 453 450 454 /*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); 452 456 delete uf; 457 delete p; 453 458 454 459 /*Go solve lower order solution*/
Note:
See TracChangeset
for help on using the changeset viewer.