From 9205fc318e6d4ba6cdf8c076e63e2fba42e03823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Fri, 29 Oct 2010 11:07:37 +0200 Subject: [PATCH] Re-purpose tpfa_compr_htran_mult to computing compr. htrans. In other words, assume that transmissibility effects are already included in the 'xf' parameter. Rename tpfa_compr_htran_mult() to tpfa_compr_htrans() to reflect new purpose. --- trans_tpfa.c | 43 +++++++++++++++++++++---------------------- trans_tpfa.h | 12 ++++++------ 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/trans_tpfa.c b/trans_tpfa.c index 8576fef4..d2bdde4e 100644 --- a/trans_tpfa.c +++ b/trans_tpfa.c @@ -140,14 +140,14 @@ small_matvec(size_t n, int sz, const double *A, const double *X, double *Y) /* ---------------------------------------------------------------------- */ static void -compr_htran_mult_core(grid_t *G, - int np, - const double *Ac, - const double *xf, - double *ht_mult, - double *luAc, - double *v, - MAT_SIZE_T *ipiv) +compr_htran_core(grid_t *G , + int np , + const double *Ac , + const double *xf , + double *htrans, + double *luAc , + double *v , + MAT_SIZE_T *ipiv) /* ---------------------------------------------------------------------- */ { int c, i, f, p, np2; @@ -179,12 +179,12 @@ compr_htran_mult_core(grid_t *G, dgetrs_("No Transpose", &nrows, &nrhs, luAc, &ldA, ipiv, v, &ldX, &info); - /* Compute local tran-multipliers by summing over phases */ + /* Compute half-trans by summing over phases */ for (i = G->cell_facepos[c + 0], nrhs = 0; i < G->cell_facepos[c + 1]; i++, nrhs++) { - ht_mult[i] = 0.0; + htrans[i] = 0.0; for (p = 0; p < np; p++) { - ht_mult[i] += v[nrhs*np + p]; + htrans[i] += v[nrhs*np + p]; } } } @@ -192,11 +192,11 @@ compr_htran_mult_core(grid_t *G, /* ---------------------------------------------------------------------- */ -/* ht_mult <- Ac \ xf +/* htrans <- Ac \ xf * * np is number of phases. * Ac is R/B per cell. - * xf is (R/B)*{\lambda_\alpha}_f, pre-computed in small_matvec(). + * xf is (R/B)*T_f*{\lambda_\alpha}_f, pre-computed in small_matvec(). * * Result, ht_mult, is a scalar per half-face. * @@ -205,15 +205,15 @@ compr_htran_mult_core(grid_t *G, * Ac <- LU(Ac) * for each face(cell), * Solve Ac*v = xf(f) - * ht_mult[c,f] = sum(v) over phases */ + * htrans[c,f] = sum(v) over phases */ /* ---------------------------------------------------------------------- */ void -tpfa_compr_htran_mult(grid_t *G , - int np, - size_t max_ngconn, - const double *Ac, - const double *xf, - double *ht_mult) +tpfa_compr_htran(grid_t *G , + int np , + size_t max_ngconn, + const double *Ac , + const double *xf , + double *htrans) /* ---------------------------------------------------------------------- */ { double *luAc, *v; @@ -224,8 +224,7 @@ tpfa_compr_htran_mult(grid_t *G , ipiv = malloc(np * sizeof *ipiv); if ((luAc != NULL) && (v != NULL) && (ipiv != NULL)) { - compr_htran_mult_core(G, np, Ac, xf, ht_mult, - luAc, v, ipiv); + compr_htran_core(G, np, Ac, xf, htrans, luAc, v, ipiv); } free(ipiv); diff --git a/trans_tpfa.h b/trans_tpfa.h index 3983d990..1be204c2 100644 --- a/trans_tpfa.h +++ b/trans_tpfa.h @@ -45,12 +45,12 @@ small_matvec(size_t n, int sz, double *Y); void -tpfa_compr_htran_mult(grid_t *G , - int np , - size_t max_ngconn, - const double *Ac , - const double *xf , - double *ht_mult); +tpfa_compr_htran(grid_t *G , + int np , + size_t max_ngconn, + const double *Ac , + const double *xf , + double *htrans); #ifdef __cplusplus }