- Timestamp:
- 03/12/12 14:40:42 (13 years ago)
- Location:
- issm/branches/trunk-jpl-damage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-jpl-damage ¶
-
TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Reduceloadx/Reduceloadx.cpp ¶
r9761 r11684 12 12 #include "../../io/io.h" 13 13 14 void Reduceloadx( Vec pf, Mat Kfs, Vecy_s,bool flag_ys0){14 void Reduceloadx( Vector* pf, Matrix* Kfs, Vector* y_s,bool flag_ys0){ 15 15 16 16 /*intermediary*/ 17 Vec 18 Vec 17 Vector* y_s0 = NULL; 18 Vector* Kfsy_s = NULL; 19 19 int Kfsm,Kfsn; 20 20 int global_m,global_n; 21 PetscScalar a;22 21 bool fromlocalsize = true; 23 22 int verbose; … … 25 24 _printf_(VerboseModule()," Dirichlet lifting applied to load vector\n"); 26 25 27 MatGetSize(Kfs,&global_m,&global_n);26 Kfs->GetSize(&global_m,&global_n); 28 27 if(pf && global_m*global_n){ 29 28 … … 32 31 33 32 /*pf = pf - Kfs * y_s;*/ 34 MatGetLocalSize(Kfs,&Kfsm,&Kfsn);35 Kfsy_s= NewVec(Kfsm,fromlocalsize);33 Kfs->GetLocalSize(&Kfsm,&Kfsn); 34 Kfsy_s=new Vector(Kfsm,fromlocalsize); 36 35 if (flag_ys0){ 37 36 38 37 /*Create y_s0, full of 0: */ 39 VecDuplicate(y_s,&y_s0); 40 VecSet(y_s0,0.0); 41 VecAssemblyBegin(y_s0); 42 VecAssemblyEnd(y_s0); 38 y_s0=y_s->Duplicate(); 39 y_s0->Set(0.0); 40 y_s0->Assemble(); 43 41 44 MatMultPatch(Kfs,y_s0,Kfsy_s);42 Kfs->MatMult(y_s0,Kfsy_s); 45 43 } 46 44 else{ 47 MatMultPatch(Kfs,y_s,Kfsy_s);45 Kfs->MatMult(y_s,Kfsy_s); 48 46 } 49 47 50 a=-1; 51 VecAXPY(pf,a,Kfsy_s); 48 pf->AXPY(Kfsy_s,-1); 52 49 } 53 50 54 51 55 52 /*Free ressources and return*/ 56 VecFree(&y_s0);57 VecFree(&Kfsy_s);53 delete y_s0; 54 delete Kfsy_s; 58 55 59 56 }
Note:
See TracChangeset
for help on using the changeset viewer.