Changeset 23220
- Timestamp:
- 09/05/18 09:47:40 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
r23212 r23220 43 43 * [ B^T 0 ] 44 44 * */ 45 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8) 46 MatCreateSubMatrix(Kff,isv,isv,MAT_INITIAL_MATRIX,&A); 47 MatCreateSubMatrix(Kff,isv,isp,MAT_INITIAL_MATRIX,&B); 48 MatCreateSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT); 49 #else 45 50 MatGetSubMatrix(Kff,isv,isv,MAT_INITIAL_MATRIX,&A); 46 51 MatGetSubMatrix(Kff,isv,isp,MAT_INITIAL_MATRIX,&B); 47 52 MatGetSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT); 53 #endif 48 54 49 55 /* Extract preconditioner matrix on the pressure space*/ 56 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8) 57 MatCreateSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP); 58 #else 50 59 MatGetSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP); 60 #endif 51 61 52 62 /* Get number of velocity / pressure nodes */ … … 313 323 * Kff = | | 314 324 * [B^T IP] 315 /* To calculate the residual, only the necessary blocks need to be extracted */325 * To calculate the residual, only the necessary blocks need to be extracted */ 316 326 317 327 /*Extract A, B, B^T */ 328 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8) 329 MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A); 330 MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B); 331 MatCreateSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT); 332 #else 318 333 MatGetSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A); 319 334 MatGetSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B); 320 335 MatGetSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT); 336 #endif 321 337 322 338 /*no. of free nodes in velocity/pressure space*/
Note:
See TracChangeset
for help on using the changeset viewer.