Fix indexing bug in well handling code for incremental (Newton) pressure assembly.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-05-10 15:31:51 +02:00
parent 1aa5d6b293
commit a4b32311b2

View File

@ -760,7 +760,7 @@ ifs_tpfa_assemble_comprock_increment(struct UnstructuredGrid *G ,
struct ifs_tpfa_data *h )
/* ---------------------------------------------------------------------- */
{
int c, w, system_singular, ok;
int c, w, wdof, system_singular, ok;
size_t j;
double *v;
@ -782,7 +782,8 @@ ifs_tpfa_assemble_comprock_increment(struct UnstructuredGrid *G ,
}
if (F->W != NULL) {
for (w = 0; w < F->W->number_of_wells; ++w) {
h->b[c] += -v[c];
wdof = G->number_of_cells + w;
h->b[wdof] += -v[wdof];
}
}
}