opm-simulators
prec.h
1 #pragma once
2 
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #include "bsr.h"
8 
12 typedef
13 struct prec_t
14 {
15  // lower triangular factor
16  bsr_matrix *L;
17  // diagonal factor
18  bsr_matrix *D;
19  // upper triangular factor
20  bsr_matrix *U;
21  // number of off-diagonal ilu0 updates
22  int noffsets;
23  // triplets uniquely identifying off-diagonal ilu0 updates
24  int(*offsets)[3];
25 }
26 prec_t;
27 
33 prec_t *prec_alloc();
34 
40 void prec_free(prec_t *P);
41 
48 void prec_init(prec_t *P, bsr_matrix const *A);
49 
58 int prec_analyze(bsr_matrix *M, int (*offsets)[3]);
59 
66 void prec_dilu_factorize(prec_t *P, bsr_matrix *A);
67 
74 void prec_ilu0_factorize(prec_t *P, bsr_matrix *A);
75 
84 void prec_mapply3c(prec_t *P, double *x);
85 
94 void prec_dapply3c(prec_t *P, double *x);
95 
101 void prec_downcast(prec_t *P);
102 
108 void prec_info(prec_t *P);
109 
110 #ifdef __cplusplus
111 }
112 #endif
Mixed-precision bsr matrix.
Definition: bsr.h:10
Preconditioner struct.
Definition: prec.h:12