mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add preliminary support for wells in 'mex_ip_simple'. This is
untested, so disable direct MEX building for the time being.
This commit is contained in:
parent
483be79c66
commit
6f01206f60
25
mimetic.c
25
mimetic.c
@ -16,27 +16,27 @@
|
|||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
void
|
void
|
||||||
mim_ip_simple_all(int ncells, int d, int max_ncf, int *ncf,
|
mim_ip_simple_all(int ncells, int d, int max_nconn, int *ncf,
|
||||||
int *nconn, int *cf,
|
int *pconn, int *conn,
|
||||||
int *fneighbour, double *fcentroid, double *fnormal,
|
int *fneighbour, double *fcentroid, double *fnormal,
|
||||||
double *farea, double *ccentroid, double *cvol,
|
double *farea, double *ccentroid, double *cvol,
|
||||||
double *perm, double *Binv)
|
double *perm, double *Binv)
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
{
|
{
|
||||||
int i, j, c, f, nf, fpos, fpos2, lwork;
|
int i, j, c, f, nf, nconn, fpos2, lwork;
|
||||||
|
|
||||||
double *C, *N, *A, *work, s;
|
double *C, *N, *A, *work, s;
|
||||||
|
|
||||||
double cc[3] = { 0.0 }; /* No more than 3 space dimensions */
|
double cc[3] = { 0.0 }; /* No more than 3 space dimensions */
|
||||||
|
|
||||||
lwork = 64 * (max_ncf * d); /* 64 from ILAENV() */
|
lwork = 64 * (max_nconn * d); /* 64 from ILAENV() */
|
||||||
C = malloc((max_ncf * d) * sizeof *C);
|
C = malloc((max_nconn * d) * sizeof *C);
|
||||||
N = malloc((max_ncf * d) * sizeof *N);
|
N = malloc((max_nconn * d) * sizeof *N);
|
||||||
A = malloc(max_ncf * sizeof *A);
|
A = malloc(max_nconn * sizeof *A);
|
||||||
work = malloc(lwork * sizeof *work);
|
work = malloc(lwork * sizeof *work);
|
||||||
|
|
||||||
if ((C != NULL) && (N != NULL) && (A != NULL) && (work != NULL)) {
|
if ((C != NULL) && (N != NULL) && (A != NULL) && (work != NULL)) {
|
||||||
fpos = fpos2 = 0;
|
fpos2 = 0;
|
||||||
|
|
||||||
for (c = 0; c < ncells; c++) {
|
for (c = 0; c < ncells; c++) {
|
||||||
for (j = 0; j < d; j++) {
|
for (j = 0; j < d; j++) {
|
||||||
@ -46,7 +46,7 @@ mim_ip_simple_all(int ncells, int d, int max_ncf, int *ncf,
|
|||||||
nf = ncf[c];
|
nf = ncf[c];
|
||||||
|
|
||||||
for (i = 0; i < nf; i++) {
|
for (i = 0; i < nf; i++) {
|
||||||
f = cf[fpos + i];
|
f = conn[pconn[c] + i];
|
||||||
s = 2.0*(fneighbour[2 * f] == c) - 1.0;
|
s = 2.0*(fneighbour[2 * f] == c) - 1.0;
|
||||||
|
|
||||||
A[i] = farea[f];
|
A[i] = farea[f];
|
||||||
@ -57,11 +57,12 @@ mim_ip_simple_all(int ncells, int d, int max_ncf, int *ncf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mim_ip_simple(nf, nconn[c], d, cvol[c], &perm[c * d * d],
|
nconn = pconn[c + 1] - pconn[c];
|
||||||
|
|
||||||
|
mim_ip_simple(nf, nconn, d, cvol[c], &perm[c * d * d],
|
||||||
C, A, N, &Binv[fpos2], work, lwork);
|
C, A, N, &Binv[fpos2], work, lwork);
|
||||||
|
|
||||||
fpos += nconn[c];
|
fpos2 += nconn * nconn;
|
||||||
fpos2 += nconn[c] * nconn[c];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ void mim_ip_simple(int nf, int nconn, int d,
|
|||||||
double *work, int lwork);
|
double *work, int lwork);
|
||||||
|
|
||||||
void mim_ip_simple_all(int ncells, int d, int max_ncf, int *ncf,
|
void mim_ip_simple_all(int ncells, int d, int max_ncf, int *ncf,
|
||||||
int *nconn, int *conn,
|
int *pconn, int *conn,
|
||||||
int *fneighbour, double *fcentroid, double *fnormal,
|
int *fneighbour, double *fcentroid, double *fnormal,
|
||||||
double *farea, double *ccentroid, double *cvol,
|
double *farea, double *ccentroid, double *cvol,
|
||||||
double *perm, double *Binv);
|
double *perm, double *Binv);
|
||||||
|
Loading…
Reference in New Issue
Block a user