Changeset 6852
- Timestamp:
- 12/29/10 18:16:08 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/Solverx/Solverx.cpp
r6412 r6852 31 31 bool fromlocalsize = true; 32 32 33 #if _PETSC_VERSION_ == 3 34 const MatType type; 35 #endif 36 33 37 34 38 /*Display message*/ … … 40 44 *puf=NULL; return; 41 45 } 46 47 /*Now, check that we are not getting an initial guess to the solver, if we are running a direct solver: */ 48 #if _PETSC_VERSION_ == 3 49 MatGetType(Kff,&type); 50 if (strcmp(type,"mpidense")==0)uf0=NULL; 51 #endif 42 52 43 53 -
issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r6412 r6852 30 30 /*Display message*/ 31 31 _printf_(VerboseModule()," Generating matrices\n"); 32 33 32 34 33 35 /*retrive parameters: */ … … 74 76 MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY); 75 77 MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY); 78 #if _PETSC_VERSION_ == 2 76 79 MatCompress(Kgg); 80 #endif 77 81 } 78 82 else{ 79 83 MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY); 80 84 MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY); 85 #if _PETSC_VERSION_ == 2 81 86 MatCompress(Kff); 87 #endif 82 88 83 89 MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY); 84 90 MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY); 91 #if _PETSC_VERSION_ == 2 85 92 MatCompress(Kfs); 93 #endif 86 94 } 87 95 } 88 96 if(pflag){ 89 97 90 98 if(!buildkff)pg=NewVec(gsize); … … 130 138 MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY); 131 139 MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY); 140 #if _PETSC_VERSION_ == 2 132 141 MatCompress(Kgg); 142 #endif 133 143 } 134 144 else{ 135 145 MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY); 136 146 MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY); 147 #if _PETSC_VERSION_ == 2 137 148 MatCompress(Kff); 149 #endif 138 150 139 151 MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY); 140 152 MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY); 153 #if _PETSC_VERSION_ == 2 141 154 MatCompress(Kfs); 155 #endif 142 156 } 143 157 } 144 158 if(penalty_pflag){ 145 159 146 160 /*Fill right hand side vector, from loads: */ -
issm/trunk/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp
r6412 r6852 65 65 /*now, reset the options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This 66 66 *capability is not covered by Petsc!: */ 67 68 #if _PETSC_VERSION_ == 2 67 69 PetscOptionsDestroy(); 68 70 PetscOptionsCreate(); … … 71 73 PetscOptionsSetFromOptions(); 72 74 PetscOptionsInsertMultipleString(string); //our patch 75 #else 76 PetscOptionsSetFromOptions(); 77 PetscOptionsClear(); 78 //PetscOptionsSetFromOptions(); 79 PetscOptionsInsertMultipleString(string); //our patch 80 #endif 81 73 82 74 83 /*Free ressources:{{{1*/ -
issm/trunk/src/c/toolkits/petsc/patches/MatPartition.cpp
r3595 r6852 91 91 csize=PetscDetermineLocalSize(col_partition_vector_size); 92 92 if(col_partition_vector_size==row_partition_vector_size){ 93 #if _PETSC_VERSION_ == 3 94 MatGetSubMatrix(matrixA,row_index,col_index,MAT_INITIAL_MATRIX,&outmatrix); 95 #else 93 96 MatGetSubMatrix(matrixA,row_index,col_index,count,MAT_INITIAL_MATRIX,&outmatrix); 97 #endif 94 98 } 95 99 else{ 100 #if _PETSC_VERSION_ == 3 101 MatGetSubMatrix(matrixA,row_index,col_index,MAT_INITIAL_MATRIX,&outmatrix); 102 #else 96 103 MatGetSubMatrix(matrixA,row_index,col_index,csize,MAT_INITIAL_MATRIX,&outmatrix); 104 #endif 97 105 } 98 106 -
issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp
r6006 r6852 77 77 int d_nz,o_nz; 78 78 int nnz; 79 80 #if _PETSC_VERSION_ == 3 81 const MatType type; 82 #else 79 83 MatType type; 84 #endif 85 80 86 81 87 … … 83 89 m=PetscDetermineLocalSize(M); 84 90 n=PetscDetermineLocalSize(N); 85 91 86 92 /*Figure out number of non zeros per row: */ 87 93 d_nz=(int)connectivity*numberofdofspernode/2; … … 92 98 MatSetFromOptions(outmatrix); 93 99 100 101 94 102 /*preallocation according to type: */ 95 103 MatGetType(outmatrix,&type); 104 105 #if _PETSC_VERSION_ == 2 96 106 if((strcmp(type,"mpiaij")==0) || (strcmp(type,"aijmumps")==0)){ 97 107 MatMPIAIJSetPreallocation(outmatrix,d_nz,NULL,o_nz,NULL); 98 108 } 109 #else 110 if((strcmp(type,"mpiaij")==0) || (strcmp(type,"mpidense")==0)){ 111 MatMPIAIJSetPreallocation(outmatrix,d_nz,NULL,o_nz,NULL); 112 } 113 #endif 99 114 100 115 return outmatrix;
Note:
See TracChangeset
for help on using the changeset viewer.