proteus  1.8.1
C/C++/Fortran libraries
sparsity.h
Go to the documentation of this file.
1 #ifndef SPARSITYINFO_H
2 #define SPARSITYINFO_H
3 #include <map>
4 #include <set>
5 #include <cassert>
6 #include <algorithm>
7 
8 namespace proteus
9 {
11  {
12  public:
13  SparsityInfo();
14  ~SparsityInfo();
15  void findNonzeros(int nElements_global,
16  int nDOF_test_element,
17  int nDOF_trial_element,
18  int* nFreeDOF_test,
19  int* freeGlobal_test,
20  int* nFreeDOF_trial,
21  int* freeGlobal_trial,
22  int offset_test,
23  int stride_test,
24  int offset_trial,
25  int stride_trial,
26  int hasNumericalFlux,
27  int hasDiffusionInMixedForm,
28  int needNumericalFluxJacobian,
29  int nElementBoundaries_element,
30  int* elementNeighborsArray,
31  int nInteriorElementBoundaries_global,
32  int* interiorElementBoundariesArray,
33  int* elementBoundaryElementsArray,
34  int* elementBoundaryLocalElementBoundariesArray,
35  int hasFluxBoundaryConditions,
36  int nExteriorElementBoundaries_global,
37  int* exteriorElementBoundariesArray,
38  int hasOutflowBoundary,
39  int needOutflowJacobian);
40  void getOffsets_CSR(int nElements_global,
41  int nDOF_test_element,
42  int nDOF_trial_element,
43  int* nFreeDOF_test,
44  int* freeGlobal_test,
45  int* nFreeDOF_trial,
46  int* freeGlobal_trial,
47  int offset_test,
48  int stride_test,
49  int offset_trial,
50  int stride_trial,
51  int hasNumericalFlux,
52  int hasDiffusionInMixedForm,
53  int needNumericalFluxJacobian,
54  int nElementBoundaries_element,
55  int* elementNeighborsArray,
56  int nInteriorElementBoundaries_global,
57  int* interiorElementBoundariesArray,
58  int* elementBoundaryElementsArray,
59  int* elementBoundaryLocalElementBoundariesArray,
60  int hasFluxBoundaryConditions,
61  int nExteriorElementBoundaries_global,
62  int* exteriorElementBoundariesArray,
63  int hasOutflowBoundary,
64  int needOutflowJacobian,
65  int* rowptr,
66  int* csrRowIndeces,
67  int* csrColumnOffsets,
68  int* csrColumnOffsets_eNebN,
69  int* csrColumnOffsets_eb,
70  int* csrColumnOffsets_eb_eNebN);
71  void getCSR();
72  int nrows;
73  int nnz;
74  int *rowptr, *colind;
75  double* nzval;
76  private:
77  std::map<int,std::set<int> > columnIndecesMap;
78  std::map<int,std::map<int,int> > columnOffsetsMap;
79  };
80 }
81 #endif
proteus::SparsityInfo::nnz
int nnz
Definition: sparsity.h:73
proteus::SparsityInfo::findNonzeros
void findNonzeros(int nElements_global, int nDOF_test_element, int nDOF_trial_element, int *nFreeDOF_test, int *freeGlobal_test, int *nFreeDOF_trial, int *freeGlobal_trial, int offset_test, int stride_test, int offset_trial, int stride_trial, int hasNumericalFlux, int hasDiffusionInMixedForm, int needNumericalFluxJacobian, int nElementBoundaries_element, int *elementNeighborsArray, int nInteriorElementBoundaries_global, int *interiorElementBoundariesArray, int *elementBoundaryElementsArray, int *elementBoundaryLocalElementBoundariesArray, int hasFluxBoundaryConditions, int nExteriorElementBoundaries_global, int *exteriorElementBoundariesArray, int hasOutflowBoundary, int needOutflowJacobian)
Definition: sparsity.cpp:5
proteus::SparsityInfo
Definition: sparsity.h:11
proteus::SparsityInfo::nzval
double * nzval
Definition: sparsity.h:75
proteus::SparsityInfo::nrows
int nrows
Definition: sparsity.h:72
proteus::SparsityInfo::rowptr
int * rowptr
Definition: sparsity.h:74
proteus::SparsityInfo::colind
int * colind
Definition: sparsity.h:74
proteus::SparsityInfo::getOffsets_CSR
void getOffsets_CSR(int nElements_global, int nDOF_test_element, int nDOF_trial_element, int *nFreeDOF_test, int *freeGlobal_test, int *nFreeDOF_trial, int *freeGlobal_trial, int offset_test, int stride_test, int offset_trial, int stride_trial, int hasNumericalFlux, int hasDiffusionInMixedForm, int needNumericalFluxJacobian, int nElementBoundaries_element, int *elementNeighborsArray, int nInteriorElementBoundaries_global, int *interiorElementBoundariesArray, int *elementBoundaryElementsArray, int *elementBoundaryLocalElementBoundariesArray, int hasFluxBoundaryConditions, int nExteriorElementBoundaries_global, int *exteriorElementBoundariesArray, int hasOutflowBoundary, int needOutflowJacobian, int *rowptr, int *csrRowIndeces, int *csrColumnOffsets, int *csrColumnOffsets_eNebN, int *csrColumnOffsets_eb, int *csrColumnOffsets_eb_eNebN)
Definition: sparsity.cpp:206
proteus::SparsityInfo::~SparsityInfo
~SparsityInfo()
Definition: sparsity.cpp:497
proteus
Definition: ADR.h:17
proteus::SparsityInfo::getCSR
void getCSR()
Definition: sparsity.cpp:457
proteus::SparsityInfo::SparsityInfo
SparsityInfo()
Definition: sparsity.cpp:491