Encapsulate ifs_tpfa pressure solution in ad-hoc structure.

This is to limit the number of explicit interface changes when we
produce solution variables for wells too.

Update callers accordingly.
This commit is contained in:
Bård Skaflestad 2012-03-15 14:26:40 +01:00
parent bc106cb286
commit 27226eaacb
3 changed files with 20 additions and 7 deletions

View File

@ -118,9 +118,11 @@ namespace Opm
pressure.resize(grid_.number_of_cells);
faceflux.resize(grid_.number_of_faces);
ifs_tpfa_press_flux(gg, &F, &trans_[0], h_,
&pressure[0],
&faceflux[0]);
ifs_tpfa_solution soln;
soln.cell_press = &pressure[0];
soln.face_flux = &faceflux[0];
ifs_tpfa_press_flux(gg, &F, &trans_[0], h_, &soln);
}

View File

@ -355,14 +355,22 @@ ifs_tpfa_press_flux(struct UnstructuredGrid *G,
const struct ifs_tpfa_forces *F,
const double *trans,
struct ifs_tpfa_data *h,
double *cpress,
double *fflux)
struct ifs_tpfa_solution *soln)
/* ---------------------------------------------------------------------- */
{
int c1, c2, f;
size_t i, j;
double dh, s;
double *cpress, *fflux;
assert (soln != NULL);
assert (soln->cell_press != NULL);
assert (soln->face_flux != NULL);
cpress = soln->cell_press;
fflux = soln->face_flux ;
/* Assign cell pressure directly from solution vector */
memcpy(cpress, h->x, G->number_of_cells * sizeof *cpress);

View File

@ -39,6 +39,10 @@ struct ifs_tpfa_data {
struct ifs_tpfa_impl *pimpl;
};
struct ifs_tpfa_solution {
double *cell_press;
double *face_flux ;
};
struct ifs_tpfa_forces {
const double *src;
@ -62,8 +66,7 @@ ifs_tpfa_press_flux(struct UnstructuredGrid *G,
const struct ifs_tpfa_forces *F,
const double *trans,
struct ifs_tpfa_data *h,
double *cpress,
double *fflux);
struct ifs_tpfa_solution *soln);
void
ifs_tpfa_destroy(struct ifs_tpfa_data *h);