Assemble_bhp_well(): Don't look up wdof diagonal element multiple times.

This commit is contained in:
Bård Skaflestad 2012-03-21 10:59:21 +01:00
parent af80492ff3
commit 18cdd5f1e3

View File

@ -207,13 +207,14 @@ assemble_bhp_well(int nc, int w,
wdof = nc + w; wdof = nc + w;
bhp = ctrls->target[ ctrls->current ]; bhp = ctrls->target[ ctrls->current ];
jw = csrmatrix_elm_index(wdof, wdof, h->A);
for (i = W->well_connpos[w]; i < W->well_connpos[w + 1]; i++) { for (i = W->well_connpos[w]; i < W->well_connpos[w + 1]; i++) {
c = W->well_cells [ i ]; c = W->well_cells [ i ];
trans = mt[ c ] * W->WI[ i ]; trans = mt[ c ] * W->WI[ i ];
jc = csrmatrix_elm_index(c , c , h->A); jc = csrmatrix_elm_index(c, c, h->A);
jw = csrmatrix_elm_index(wdof, wdof, h->A);
/* c<->c diagonal contribution from well */ /* c<->c diagonal contribution from well */
h->A->sa[ jc ] += trans; h->A->sa[ jc ] += trans;