Move source term assembly out main loop.

This commit is contained in:
Bård Skaflestad 2012-03-12 09:50:35 +01:00
parent 38aaa867bb
commit f06b5e3589

View File

@ -266,10 +266,6 @@ ifs_tpfa_assemble(struct UnstructuredGrid *G,
h->A->sa[j2] -= trans[f];
}
}
if ((F != NULL) && (F->src != NULL)) {
h->b[c] += F->src[c];
}
}
is_neumann = 1;
@ -277,6 +273,12 @@ ifs_tpfa_assemble(struct UnstructuredGrid *G,
is_neumann = assemble_bc_contrib(G, F->bc, trans, h);
}
if ((F != NULL) && (F->src != NULL)) {
for (c = 0; c < G->number_of_cells; c++) {
h->b[c] += F->src[c];
}
}
if (is_neumann) {
/* Remove zero eigenvalue associated to constant pressure */
h->A->sa[0] *= 2;