Ice Sheet System Model  4.18
Code documentation
ISSMToPetscMatrixType.cpp
Go to the documentation of this file.
1 /* \file ISSMToPetscMatrixType.cpp
2  * \brief: convert MatrixType from ISSM to Petsc
3  */
4 
5 #ifdef HAVE_CONFIG_H
6  #include <config.h>
7 #else
8 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
9 #endif
10 
11 /*Petsc includes: */
12 #include <petscmat.h>
13 #include <petscvec.h>
14 #include <petscksp.h>
15 
16 /*ISSM includes: */
17 #include "../../toolkitsenums.h"
18 #include "../../../shared/shared.h"
19 
21 
22  switch(type){
23  case DENSE_SEQUENTIAL:
24  return MATSEQDENSE;
25  break;
26  case SPARSE_SEQUENTIAL:
27  return MATSEQAIJ;
28  break;
29  default:
30  _error_("unknown matrix type !");
31  break;
32  }
33 }
DENSE_SEQUENTIAL
@ DENSE_SEQUENTIAL
Definition: toolkitsenums.h:16
ISSMToPetscMatrixType
MatType ISSMToPetscMatrixType(MatrixType type)
Definition: ISSMToPetscMatrixType.cpp:20
SPARSE_SEQUENTIAL
@ SPARSE_SEQUENTIAL
Definition: toolkitsenums.h:16
MatrixType
MatrixType
Definition: toolkitsenums.h:16
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49