2010-08-20 14:16:59 -05:00
|
|
|
/*
|
2010-10-12 02:25:46 -05:00
|
|
|
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2010-08-20 14:16:59 -05:00
|
|
|
|
2010-10-13 11:35:15 -05:00
|
|
|
#ifndef OPM_MIMETIC_HEADER_INCLUDED
|
|
|
|
#define OPM_MIMETIC_HEADER_INCLUDED
|
2010-06-28 17:47:55 -05:00
|
|
|
|
2010-09-27 02:48:31 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2010-06-29 16:18:23 -05:00
|
|
|
|
2010-08-09 03:51:01 -05:00
|
|
|
void mim_ip_span_nullspace(int nf, int nconn, int d,
|
|
|
|
double *C,
|
|
|
|
double *A,
|
|
|
|
double *X,
|
|
|
|
double *work, int lwork);
|
2010-06-29 16:18:23 -05:00
|
|
|
|
2010-08-09 03:51:01 -05:00
|
|
|
void mim_ip_linpress_exact(int nf, int nconn, int d,
|
|
|
|
double vol, double *K,
|
|
|
|
double *N,
|
|
|
|
double *Binv,
|
|
|
|
double *work, int lwork);
|
2010-06-29 16:18:23 -05:00
|
|
|
|
2010-08-09 03:51:01 -05:00
|
|
|
void mim_ip_simple(int nf, int nconn, int d,
|
|
|
|
double v, double *K, double *C,
|
|
|
|
double *A, double *N,
|
|
|
|
double *Binv,
|
2010-06-29 16:18:23 -05:00
|
|
|
double *work, int lwork);
|
2010-06-28 17:47:55 -05:00
|
|
|
|
2010-10-01 07:21:24 -05:00
|
|
|
|
|
|
|
/** Compute the mimetic inner products given a grid and cellwise
|
|
|
|
* permeability tensors.
|
|
|
|
*
|
|
|
|
* @param ncells Number of cells in grid.
|
|
|
|
* @param d Number of space dimensions.
|
|
|
|
* @param max_ncf Maximum number of faces per cell.
|
|
|
|
* @param ncf Number of faces per cell.
|
|
|
|
* @param pconn Start indices in conn for each cell, plus end
|
|
|
|
* marker. The size of pconn is (ncells + 1), and for a
|
|
|
|
* cell i, [conn[pconn[i]], conn[pconn[i+1]]) is a
|
|
|
|
* half-open interval containing the indices of faces
|
|
|
|
* adjacent to i.
|
|
|
|
* @param conn Cell to face mapping. Size shall be equal to the sum of
|
|
|
|
* ncf. See pconn for explanation.
|
|
|
|
* @param fneighbour Face to cell mapping. Its size shall be equal to
|
|
|
|
* the number of faces times 2. For each face, the
|
|
|
|
* two entries are either a cell number or -1
|
|
|
|
* (signifying the outer boundary). The face normal
|
|
|
|
* points out of the first cell and into the second.
|
|
|
|
* @param fcentroid Face centroids. Size shall be equal to the number
|
|
|
|
* of faces times d.
|
|
|
|
* @param fnormal Face normale. Size shall be equal to the number
|
|
|
|
* of faces times d.
|
|
|
|
* @param farea Face areas.
|
|
|
|
* @param ccentroid Cell centroids. Size shall be ncells*d.
|
|
|
|
* @param cvol Cell volumes.
|
|
|
|
* @param perm Permeability. Size shall be ncells*d*d, storing a
|
|
|
|
* d-by-d positive definite tensor per cell.
|
|
|
|
* @param[out] Binv This is where the inner product will be
|
|
|
|
* stored. Its size shall be equal to \f$\sum_i
|
|
|
|
* n_i^2\f$.
|
|
|
|
*/
|
2010-08-09 03:51:01 -05:00
|
|
|
void mim_ip_simple_all(int ncells, int d, int max_ncf, int *ncf,
|
2010-08-11 13:31:01 -05:00
|
|
|
int *pconn, int *conn,
|
2010-07-04 16:44:04 -05:00
|
|
|
int *fneighbour, double *fcentroid, double *fnormal,
|
|
|
|
double *farea, double *ccentroid, double *cvol,
|
|
|
|
double *perm, double *Binv);
|
2010-06-28 17:47:55 -05:00
|
|
|
|
2010-10-14 07:20:11 -05:00
|
|
|
void
|
|
|
|
mim_ip_compute_gpress(int nc, int d, const double *grav,
|
|
|
|
const int *pconn, const int *conn,
|
|
|
|
const double *fcentroid, const double *ccentroid,
|
|
|
|
double *gpress);
|
|
|
|
|
|
|
|
/* inv(B) <- \lambda_t(s)*inv(B) */
|
|
|
|
void
|
|
|
|
mim_ip_mobility_update(int nc, const int *pconn, const double *totmob,
|
|
|
|
double *Binv);
|
|
|
|
|
|
|
|
/* G <- \sum_i \rho_i f_i(s) * G */
|
|
|
|
void
|
|
|
|
mim_ip_density_update(int nc, const int *pconn, const double *omega,
|
|
|
|
double *gpress);
|
|
|
|
|
2010-09-27 02:48:31 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-10-13 11:35:15 -05:00
|
|
|
#endif /* OPM_MIMETIC_HEADER_INCLUDED */
|