Changeset 13975 for issm/trunk/src/c/classes/matrix/Matrix.h
- Timestamp:
- 11/16/12 08:10:16 (12 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 13397-13398,13401,13407-13582,13584-13974
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c/classes/matrix/Matrix.h
r13395 r13975 76 76 } 77 77 /*}}}*/ 78 /*FUNCTION Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz,int type){{{*/ 79 #ifdef _HAVE_PETSC_ 80 Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz,int in_type=PetscMatType){ 81 #else 82 Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz,int in_type=SeqMatType){ 83 #endif 84 85 #ifdef _HAVE_PETSC_ 86 pmatrix=NULL; 87 #endif 88 smatrix=NULL; 89 type=in_type; 90 91 if(type==PetscMatType){ 92 #ifdef _HAVE_PETSC_ 93 this->pmatrix=new PetscMat(m,n,M,N,d_nnz,o_nnz); 94 #else 95 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 96 #endif 97 } 98 else if(type==SeqMatType){ 99 this->smatrix=new SeqMat<doubletype>(m,n,M,N,d_nnz,o_nnz); 100 } 101 else _error_("Matrix type: " << type << " not supported yet!"); 102 103 } 104 /*}}}*/ 78 105 /*FUNCTION Matrix(int M,int N,IssmDouble sparsity,int in_type){{{*/ 79 106 #ifdef _HAVE_PETSC_ … … 163 190 #ifdef _HAVE_PETSC_ 164 191 delete this->pmatrix; 165 #else166 _error_("Petsc matrix format not usable, as Petsc has not been compiled!");167 192 #endif 168 193 } … … 170 195 delete this->smatrix; 171 196 } 172 else _error_("Matrix type: " << type << " not supported yet!");173 197 174 198 } … … 192 216 } 193 217 /*}}}*/ 218 /*FUNCTION AllocationInfo{{{*/ 219 void AllocationInfo(void){ 220 _assert_(this); 221 if(type==PetscMatType){ 222 #ifdef _HAVE_PETSC_ 223 this->pmatrix->AllocationInfo(); 224 #endif 225 } 226 else if(type==SeqMatType){ 227 //this->smatrix->AllocationInfo(); 228 } 229 else _error_("Matrix type: " << type << " not supported yet!"); 230 }/*}}}*/ 194 231 /*FUNCTION Assemble{{{*/ 195 232 void Assemble(void){ … … 274 311 Matrix* Duplicate(void){ 275 312 276 Matrix* output=NULL; 277 278 output=new Matrix(); 313 Matrix* output=new Matrix(); 279 314 280 315 if(type==PetscMatType){ … … 306 341 else _error_("Matrix type: " << type << " not supported yet!"); 307 342 308 309 343 return output; 310 344 }
Note:
See TracChangeset
for help on using the changeset viewer.