Backed out changeset 9faef9e37070
This commit is contained in:
parent
e54f1cf147
commit
e3b52c3a44
@ -17,61 +17,9 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sparse_sys.h"
|
||||
#include "compr_quant.h"
|
||||
|
||||
|
||||
void
|
||||
compr_quantities_deallocate(struct compr_quantities *cq)
|
||||
{
|
||||
if (cq != NULL) {
|
||||
free(cq->Ac);
|
||||
}
|
||||
|
||||
free(cq);
|
||||
}
|
||||
|
||||
|
||||
struct compr_quantities *
|
||||
compr_quantities_allocate(size_t nc, size_t nf, int np)
|
||||
{
|
||||
size_t alloc_sz, np2;
|
||||
struct compr_quantities *cq;
|
||||
|
||||
cq = malloc(1 * sizeof *cq);
|
||||
|
||||
if (cq != NULL) {
|
||||
np2 = np * np;
|
||||
|
||||
alloc_sz = np2 * nc; /* Ac */
|
||||
alloc_sz += np2 * nc; /* dAc */
|
||||
alloc_sz += np2 * nf; /* Af */
|
||||
alloc_sz += np * nf; /* phasemobf */
|
||||
alloc_sz += 1 * nc; /* voldiscr */
|
||||
|
||||
cq->Ac = malloc(alloc_sz * sizeof *cq->Ac);
|
||||
|
||||
if (cq->Ac == NULL) {
|
||||
compr_quantities_deallocate(cq);
|
||||
cq = NULL;
|
||||
} else {
|
||||
cq->dAc = cq->Ac + (np2 * nc);
|
||||
cq->Af = cq->dAc + (np2 * nc);
|
||||
cq->phasemobf = cq->Af + (np2 * nf);
|
||||
cq->voldiscr = cq->phasemobf + (np * nf);
|
||||
|
||||
cq->nphases = np;
|
||||
|
||||
vector_zero(alloc_sz, cq->Ac);
|
||||
}
|
||||
}
|
||||
|
||||
return cq;
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Compute B \ (V') == zeta(cellNo) .* faceFlux2CellFlux(fflux) */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -29,21 +29,15 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct compr_quantities {
|
||||
int nphases; /* Number of phases/components */
|
||||
int nphases; /* Number of phases/components */
|
||||
|
||||
double *totcompr; /* Total compressibility per cell */
|
||||
double *voldiscr; /* Volume discrepancy per cell */
|
||||
double *Ac; /* RB^{-1} per cell */
|
||||
double *dAc; /* d/dp (RB^{-1}) per cell */
|
||||
double *Af; /* RB^{-1} per face */
|
||||
double *phasemobf; /* Phase mobility per face */
|
||||
double *voldiscr; /* Volume discrepancy per cell */
|
||||
};
|
||||
|
||||
struct compr_quantities *
|
||||
compr_quantities_allocate(size_t nc, size_t nf, int np);
|
||||
|
||||
void
|
||||
compr_quantities_deallocate(struct compr_quantities *cq);
|
||||
|
||||
void
|
||||
compr_flux_term(grid_t *G,
|
||||
const double *fflux,
|
||||
|
Loading…
Reference in New Issue
Block a user