Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Data Fields
IssmMat< doubletype > Class Template Reference

#include <IssmMat.h>

Public Member Functions

 IssmMat ()
 
 IssmMat (int M, int N)
 
 IssmMat (int M, int N, doubletype sparsity)
 
 IssmMat (int m, int n, int M, int N, int *d_nnz, int *o_nnz)
 
 IssmMat (doubletype *serial_mat, int M, int N, doubletype sparsity)
 
 IssmMat (int M, int N, int connectivity, int numberofdofspernode)
 
 ~IssmMat ()
 
void Echo (void)
 
void Assemble (void)
 
doubletype Norm (NormMode mode)
 
void GetSize (int *pM, int *pN)
 
void GetLocalSize (int *pM, int *pN)
 
void MatMult (IssmVec< doubletype > *X, IssmVec< doubletype > *AX)
 
IssmMat< doubletype > * Duplicate (void)
 
doubletype * ToSerial (void)
 
void SetValues (int m, int *idxm, int n, int *idxn, doubletype *values, InsMode mode)
 
void Convert (MatrixType type)
 
void SetZero (void)
 
IssmVec< doubletype > * Solve (IssmVec< doubletype > *pf, Parameters *parameters)
 

Data Fields

IssmAbsMat< doubletype > * matrix
 

Detailed Description

template<class doubletype>
class IssmMat< doubletype >

Definition at line 35 of file IssmMat.h.

Constructor & Destructor Documentation

◆ IssmMat() [1/6]

template<class doubletype >
IssmMat< doubletype >::IssmMat ( )
inline

Definition at line 42 of file IssmMat.h.

42  { /*{{{*/
43 
45 
46  case DenseEnum:
47  this->matrix=new IssmDenseMat<doubletype>();
48  break;
49  case MpiDenseEnum:
50  #ifdef _HAVE_MPI_
52  #else
53  _error_("MpiDense matrix requires compilation of MPI!");
54  #endif
55  break;
56  case MpiSparseEnum:
57  #ifdef _HAVE_MPI_
59  #else
60  _error_("MpiSparse matrix requires compilation of MPI!");
61  #endif
62  break;
63  default:
64  _error_("matrix type not supported yet!");
65  }
66  }

◆ IssmMat() [2/6]

template<class doubletype >
IssmMat< doubletype >::IssmMat ( int  M,
int  N 
)
inline

Definition at line 68 of file IssmMat.h.

68  { /*{{{*/
69 
71 
72  case DenseEnum:
73  this->matrix=new IssmDenseMat<doubletype>(M,N);
74  break;
75  case MpiDenseEnum:
76  #ifdef _HAVE_MPI_
77  this->matrix=new IssmMpiDenseMat<doubletype>(M,N);
78  #else
79  _error_("MpiDense matrix requires compilation of MPI!");
80  #endif
81  break;
82  case MpiSparseEnum:
83  #ifdef _HAVE_MPI_
84  this->matrix=new IssmMpiSparseMat<doubletype>(M,N);
85  #else
86  _error_("MpiSparse matrix requires compilation of MPI!");
87  #endif
88  break;
89  default:
90  _error_("matrix type not supported yet!");
91  }
92  }

◆ IssmMat() [3/6]

template<class doubletype >
IssmMat< doubletype >::IssmMat ( int  M,
int  N,
doubletype  sparsity 
)
inline

Definition at line 94 of file IssmMat.h.

94  { /*{{{*/
95 
97 
98  case DenseEnum:
99  this->matrix=new IssmDenseMat<doubletype>(M,N,sparsity);
100  break;
101  case MpiDenseEnum:
102  #ifdef _HAVE_MPI_
103  this->matrix=new IssmMpiDenseMat<doubletype>(M,N,sparsity);
104  #else
105  _error_("MpiDense matrix requires compilation of MPI!");
106  #endif
107  break;
108  case MpiSparseEnum:
109  #ifdef _HAVE_MPI_
110  this->matrix=new IssmMpiSparseMat<doubletype>(M,N,sparsity);
111  #else
112  _error_("MpiSparse matrix requires compilation of MPI!");
113  #endif
114  break;
115  default:
116  _error_("matrix type not supported yet!");
117  }
118  }

◆ IssmMat() [4/6]

template<class doubletype >
IssmMat< doubletype >::IssmMat ( int  m,
int  n,
int  M,
int  N,
int *  d_nnz,
int *  o_nnz 
)
inline

Definition at line 120 of file IssmMat.h.

120  { /*{{{*/
121 
123 
124  case DenseEnum:
125  this->matrix=new IssmDenseMat<doubletype>(m,n,M,N,d_nnz,o_nnz);
126  break;
127  case MpiDenseEnum:
128  #ifdef _HAVE_MPI_
129  this->matrix=new IssmMpiDenseMat<doubletype>(m,n,M,N,d_nnz,o_nnz);
130  #else
131  _error_("MpiDense matrix requires compilation of MPI!");
132  #endif
133  break;
134  case MpiSparseEnum:
135  #ifdef _HAVE_MPI_
136  this->matrix=new IssmMpiSparseMat<doubletype>(m,n,M,N,d_nnz,o_nnz);
137  #else
138  _error_("MpiSparse matrix requires compilation of MPI!");
139  #endif
140  break;
141  default:
142  _error_("matrix type not supported yet!");
143  }
144  }

◆ IssmMat() [5/6]

template<class doubletype >
IssmMat< doubletype >::IssmMat ( doubletype *  serial_mat,
int  M,
int  N,
doubletype  sparsity 
)
inline

Definition at line 146 of file IssmMat.h.

146  { /*{{{*/
147 
149 
150  case DenseEnum:
151  this->matrix=new IssmDenseMat<doubletype>(serial_mat,M,N,sparsity);
152  break;
153  case MpiDenseEnum:
154  #ifdef _HAVE_MPI_
155  this->matrix=new IssmMpiDenseMat<doubletype>(serial_mat,M,N,sparsity);
156  #else
157  _error_("MpiDense matrix requires compilation of MPI!");
158  #endif
159  break;
160  case MpiSparseEnum:
161  #ifdef _HAVE_MPI_
162  this->matrix=new IssmMpiSparseMat<doubletype>(serial_mat,M,N,sparsity);
163  #else
164  _error_("MpiSparse matrix requires compilation of MPI!");
165  #endif
166  break;
167  default:
168  _error_("matrix type not supported yet!");
169  }
170 
171  }

◆ IssmMat() [6/6]

template<class doubletype >
IssmMat< doubletype >::IssmMat ( int  M,
int  N,
int  connectivity,
int  numberofdofspernode 
)
inline

Definition at line 173 of file IssmMat.h.

173  { /*{{{*/
174 
176 
177  case DenseEnum:
178  this->matrix=new IssmDenseMat<doubletype>(M,N,connectivity,numberofdofspernode);
179  break;
180  case MpiDenseEnum:
181  #ifdef _HAVE_MPI_
182  this->matrix=new IssmMpiDenseMat<doubletype>(M,N,connectivity,numberofdofspernode);
183  #else
184  _error_("MpiDense matrix requires compilation of MPI!");
185  #endif
186  break;
187  case MpiSparseEnum:
188  #ifdef _HAVE_MPI_
189  this->matrix=new IssmMpiSparseMat<doubletype>(M,N,connectivity,numberofdofspernode);
190  #else
191  _error_("MpiSparse matrix requires compilation of MPI!");
192  #endif
193  break;
194  default:
195  _error_("matrix type not supported yet!");
196  }
197  }

◆ ~IssmMat()

template<class doubletype >
IssmMat< doubletype >::~IssmMat ( )
inline

Definition at line 199 of file IssmMat.h.

199  { /*{{{*/
200  delete matrix;
201  } /*}}}*/

Member Function Documentation

◆ Echo()

template<class doubletype >
void IssmMat< doubletype >::Echo ( void  )
inline

Definition at line 204 of file IssmMat.h.

204  { /*{{{*/
205  matrix->Echo();
206  } /*}}}*/

◆ Assemble()

template<class doubletype >
void IssmMat< doubletype >::Assemble ( void  )
inline

Definition at line 207 of file IssmMat.h.

207  { /*{{{*/
208  matrix->Assemble();
209  } /*}}}*/

◆ Norm()

template<class doubletype >
doubletype IssmMat< doubletype >::Norm ( NormMode  mode)
inline

Definition at line 210 of file IssmMat.h.

210  { /*{{{*/
211  return matrix->Norm(mode);
212  }

◆ GetSize()

template<class doubletype >
void IssmMat< doubletype >::GetSize ( int *  pM,
int *  pN 
)
inline

Definition at line 214 of file IssmMat.h.

214  { /*{{{*/
215  matrix->GetSize(pM,pN);
216  } /*}}}*/

◆ GetLocalSize()

template<class doubletype >
void IssmMat< doubletype >::GetLocalSize ( int *  pM,
int *  pN 
)
inline

Definition at line 217 of file IssmMat.h.

217  { /*{{{*/
218  matrix->GetLocalSize(pM,pN);
219  } /*}}}*/

◆ MatMult()

template<class doubletype >
void IssmMat< doubletype >::MatMult ( IssmVec< doubletype > *  X,
IssmVec< doubletype > *  AX 
)
inline

Definition at line 220 of file IssmMat.h.

220  { /*{{{*/
221  matrix->MatMult(X->vector,AX->vector);
222  } /*}}}*/

◆ Duplicate()

template<class doubletype >
IssmMat<doubletype>* IssmMat< doubletype >::Duplicate ( void  )
inline

Definition at line 223 of file IssmMat.h.

223  { /*{{{*/
224 
225  IssmMat<doubletype>* issmmatrix=NULL;
226 
227  issmmatrix=new IssmMat<doubletype>();
228  issmmatrix->matrix=this->matrix->Duplicate();
229 
230  return issmmatrix;
231  } /*}}}*/

◆ ToSerial()

template<class doubletype >
doubletype* IssmMat< doubletype >::ToSerial ( void  )
inline

Definition at line 232 of file IssmMat.h.

232  {/*{{{*/
233  return matrix->ToSerial();
234  }/*}}}*/

◆ SetValues()

template<class doubletype >
void IssmMat< doubletype >::SetValues ( int  m,
int *  idxm,
int  n,
int *  idxn,
doubletype *  values,
InsMode  mode 
)
inline

Definition at line 235 of file IssmMat.h.

235  {/*{{{*/
236  matrix->SetValues(m,idxm,n,idxn,values,mode);
237  }/*}}}*/

◆ Convert()

template<class doubletype >
void IssmMat< doubletype >::Convert ( MatrixType  type)
inline

Definition at line 238 of file IssmMat.h.

238  {/*{{{*/
239  matrix->convert(type);
240  }/*}}}*/

◆ SetZero()

template<class doubletype >
void IssmMat< doubletype >::SetZero ( void  )
inline

Definition at line 241 of file IssmMat.h.

241  {/*{{{*/
242  matrix->SetZero();
243  }/*}}}*/

◆ Solve()

template<class doubletype >
IssmVec<doubletype>* IssmMat< doubletype >::Solve ( IssmVec< doubletype > *  pf,
Parameters parameters 
)
inline

Definition at line 245 of file IssmMat.h.

245  { /*{{{*/
246 
247  IssmVec<doubletype>* outvector=NULL;
248 
249  outvector=new IssmVec<doubletype>();
250 
251  outvector->vector=this->matrix->Solve(pf->vector,parameters);
252 
253  return outvector;
254 
255  }/*}}}*/

Field Documentation

◆ matrix

template<class doubletype >
IssmAbsMat<doubletype>* IssmMat< doubletype >::matrix

Definition at line 39 of file IssmMat.h.


The documentation for this class was generated from the following files:
IssmMatTypeFromToolkitOptions
int IssmMatTypeFromToolkitOptions(void)
Definition: IssmToolkitUtils.cpp:23
IssmDenseMat
Definition: IssmDenseMat.h:39
DenseEnum
@ DenseEnum
Definition: EnumDefinitions.h:1034
IssmMat
Definition: IssmMat.h:35
IssmMat::matrix
IssmAbsMat< doubletype > * matrix
Definition: IssmMat.h:39
IssmVec
Definition: IssmVec.h:34
IssmVec::vector
IssmAbsVec< doubletype > * vector
Definition: IssmVec.h:38
IssmMpiDenseMat
Definition: IssmMpiDenseMat.h:37
MpiSparseEnum
@ MpiSparseEnum
Definition: EnumDefinitions.h:1194
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
IssmMpiSparseMat
Definition: IssmMpiSparseMat.h:37
MpiDenseEnum
@ MpiDenseEnum
Definition: EnumDefinitions.h:1192