source: issm/branches/trunk-jpl-damage/src/c/classes/matrix/Matrix.h@ 13101

Last change on this file since 13101 was 13101, checked in by cborstad, 13 years ago

merged trunk-jpl through revision 13099 into branch

File size: 1.8 KB
Line 
1/*!\file: Matrix.h
2 * \brief wrapper to matrix objects. The goal is to control which API (PETSc,Scalpack, Plapack?)
3 * implements our underlying matrix format.
4 */
5
6#ifndef _MATRIX_H_
7#define _MATRIX_H_
8
9/*Headers:*/
10/*{{{*/
11#ifdef HAVE_CONFIG_H
12 #include <config.h>
13#else
14#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
15#endif
16#include "../../toolkits/toolkits.h"
17#include "../../EnumDefinitions/EnumDefinitions.h"
18/*}}}*/
19class Vector;
20enum matrixtype{PetscMatType, SeqMatType};
21
22class Matrix{
23
24 public:
25
26 #ifdef _HAVE_PETSC_
27 PetscMat *pmatrix;
28 #endif
29 SeqMat *smatrix;
30 int type;
31
32 /*Matrix constructors, destructors {{{*/
33 Matrix();
34 #ifdef _HAVE_PETSC_
35 Matrix(int M,int N,int type=PetscMatType);
36 Matrix(int M,int N,IssmDouble sparsity,int type=PetscMatType);
37 Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=PetscMatType);
38 Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=PetscMatType);
39 #else
40 Matrix(int M,int N,int type=SeqMatType);
41 Matrix(int M,int N,IssmDouble sparsity,int type=SeqMatType);
42 Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=SeqMatType);
43 Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=SeqMatType);
44 #endif
45 ~Matrix();
46 /*}}}*/
47 /*Matrix specific routines {{{*/
48 void Echo(void);
49 void Assemble(void);
50 IssmDouble Norm(NormMode norm_type);
51 void GetSize(int *pM,int*pN);
52 void GetLocalSize(int *pM,int*pN);
53 void MatMult(Vector *X,Vector*AX);
54 Matrix *Duplicate(void);
55 IssmDouble *ToSerial(void);
56 void SetValues(int m,int *idxm,int n,int*idxn,IssmDouble*values,InsMode mode);
57 void Convert(MatrixType newtype);
58 /*}}}*/
59};
60
61#endif //#ifndef _MATRIX_H_
Note: See TracBrowser for help on using the repository browser.