Start encapsulating ifs_tpfa driving forces into a managing structure.

This commit is contained in:
Bård Skaflestad 2012-03-06 14:00:34 +01:00
parent d1e8525c4d
commit 0d5431aaba
3 changed files with 14 additions and 4 deletions

View File

@ -105,7 +105,10 @@ namespace Opm
}
}
ifs_tpfa_assemble(gg, &trans_[0], &src[0], &gpress_omegaweighted_[0], h_);
ifs_tpfa_forces F;
F.src = &src[0];
ifs_tpfa_assemble(gg, &F, &trans_[0], &gpress_omegaweighted_[0], h_);
linsolver_.solve(h_->A, h_->b, h_->x);

View File

@ -186,8 +186,8 @@ ifs_tpfa_construct(struct UnstructuredGrid *G)
/* ---------------------------------------------------------------------- */
void
ifs_tpfa_assemble(struct UnstructuredGrid *G,
const struct ifs_tpfa_forces *F,
const double *trans,
const double *src,
const double *gpress,
struct ifs_tpfa_data *h)
/* ---------------------------------------------------------------------- */
@ -223,7 +223,9 @@ ifs_tpfa_assemble(struct UnstructuredGrid *G,
}
}
h->b[c] += src[c];
if ((F != NULL) && (F->src != NULL)) {
h->b[c] += F->src[c];
}
}
h->A->sa[0] *= 2;

View File

@ -38,13 +38,18 @@ struct ifs_tpfa_data {
};
struct ifs_tpfa_forces {
const double *src;
};
struct ifs_tpfa_data *
ifs_tpfa_construct(struct UnstructuredGrid *G);
void
ifs_tpfa_assemble(struct UnstructuredGrid *G,
const struct ifs_tpfa_forces *F,
const double *trans,
const double *src,
const double *gpress,
struct ifs_tpfa_data *h);