Changeset 13395 for issm/trunk/src/c/modules/Solverx/Solverx.cpp
- Timestamp:
- 09/19/12 09:32:34 (12 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:ignore
-
old new 1 projects 1 2 autom4te.cache 2 3 aclocal.m4
-
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 12710-12871,12873-12877,12881-12896,12898-12900,12902-12916,12920-12935,12937-12945,12948-13100,13107-13110,13112-13116,13119-13393
- Property svn:ignore
-
issm/trunk/src
-
Property svn:mergeinfo
set to
/issm/branches/trunk-jpl-damage/src merged eligible /issm/trunk-jpl/src merged eligible
-
Property svn:mergeinfo
set to
-
issm/trunk/src/c/modules/Solverx/Solverx.cpp
r12706 r13395 14 14 #endif 15 15 16 void Solverx(Vector ** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters){16 void Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters){ 17 17 18 18 /*Intermediary: */ … … 20 20 21 21 /*output: */ 22 Vector *uf=NULL;22 Vector<IssmDouble> *uf=NULL; 23 23 24 24 /*In debugging mode, check that stiffness matrix and load vectors are not NULL (they can be empty)*/ … … 26 26 _assert_(pf); 27 27 28 #ifdef _HAVE_PETSC_ 29 Vec uf0_vector = NULL; 30 Vec df_vector = NULL; 31 Vec uf_vector = NULL; 32 if(uf0) uf0_vector = uf0->vector; 33 if(df) df_vector = df->vector; 28 /*Initialize vector: */ 29 uf=new Vector<IssmDouble>(); 34 30 35 /*In serial mode, the Petsc Options database has not been initialized properly: */ 31 /*According to matrix type, use specific solvers: */ 32 switch(Kff->type){ 33 #ifdef _HAVE_PETSC_ 34 case PetscMatType:{ 35 PetscVec* uf0_vector = NULL; 36 PetscVec* df_vector = NULL; 37 if(uf0) uf0_vector = uf0->pvector; 38 if(df) df_vector = df->pvector; 39 SolverxPetsc(&uf->pvector,Kff->pmatrix,pf->pvector,uf0_vector,df_vector,parameters); 40 break;} 41 #endif 42 case SeqMatType:{ 43 SolverxSeq(&uf->svector,Kff->smatrix,pf->svector,parameters); 44 break;} 45 default: 46 _error_("Matrix type: " << Kff->type << " not supported yet!"); 47 } 36 48 37 SolverxPetsc(&uf_vector,Kff->matrix,pf->vector,uf0_vector,df_vector,parameters); 38 39 /*Create vector out of petsc vector: */ 40 uf=new Vector(uf_vector); 41 42 /*Free ressources: */ 43 VecFree(&uf_vector); 44 #else 45 #ifdef _HAVE_GSL_ 46 SeqVec* uf_vector=NULL; 47 48 SolverxGsl(&uf_vector,Kff->matrix,pf->vector); 49 50 /*Create vector out of SeqVec vector: */ 51 uf=new Vector(uf_vector); 52 53 /*Free ressources: */ 54 delete uf_vector; 55 56 #else 57 _error2_("GSL support not compiled in!"); 58 #endif 59 #endif 60 61 /*Assign output pointers: */ 49 /*Assign output pointers:*/ 62 50 *puf=uf; 63 51 }
Note:
See TracChangeset
for help on using the changeset viewer.