mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Added compute_sequence_graph(), which also returns the upwind graph.
This commit is contained in:
parent
42413c6a35
commit
b5eb8543aa
@ -117,6 +117,31 @@ compute_reorder_sequence(int nc, int nf, int *cellfaces, int *faceptr, int *face
|
|||||||
free(work);
|
free(work);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
compute_reorder_sequence_graph(int nc, int nf, int *cellfaces, int *faceptr, int *face2cell,
|
||||||
|
const double *flux, int *sequence, int *components, int *ncomponents,
|
||||||
|
int *ia, int *ja)
|
||||||
|
{
|
||||||
|
int *work;
|
||||||
|
int sz = nf;
|
||||||
|
if (nf < 3*nc)
|
||||||
|
{
|
||||||
|
sz = 3*nc;
|
||||||
|
}
|
||||||
|
|
||||||
|
work = (int*) malloc( sz * sizeof *work);
|
||||||
|
|
||||||
|
|
||||||
|
make_upwind_graph(nc, cellfaces, faceptr, face2cell,
|
||||||
|
flux, ia, ja, work);
|
||||||
|
|
||||||
|
tarjan (nc, ia, ja, sequence, components, ncomponents, work);
|
||||||
|
|
||||||
|
free(work);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void compute_sequence(const struct UnstructuredGrid *grid, const double *flux,
|
void compute_sequence(const struct UnstructuredGrid *grid, const double *flux,
|
||||||
int *sequence,
|
int *sequence,
|
||||||
int *components, int *ncomponents)
|
int *components, int *ncomponents)
|
||||||
@ -133,6 +158,24 @@ void compute_sequence(const struct UnstructuredGrid *grid, const double *flux,
|
|||||||
ncomponents);
|
ncomponents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void compute_sequence_graph(const struct UnstructuredGrid *grid, const double *flux,
|
||||||
|
int *sequence,
|
||||||
|
int *components, int *ncomponents,
|
||||||
|
int *ia, int *ja)
|
||||||
|
{
|
||||||
|
|
||||||
|
compute_reorder_sequence_graph(grid->number_of_cells,
|
||||||
|
grid->number_of_faces,
|
||||||
|
grid->cell_faces,
|
||||||
|
grid->cell_facepos,
|
||||||
|
grid->face_cells,
|
||||||
|
flux,
|
||||||
|
sequence,
|
||||||
|
components,
|
||||||
|
ncomponents,
|
||||||
|
ia, ja);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Local Variables: */
|
/* Local Variables: */
|
||||||
/* c-basic-offset:4 */
|
/* c-basic-offset:4 */
|
||||||
|
@ -7,9 +7,13 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct UnstructuredGrid;
|
struct UnstructuredGrid;
|
||||||
|
|
||||||
void compute_sequence(const struct UnstructuredGrid *grid, const double *flux,
|
void compute_sequence(const struct UnstructuredGrid *grid, const double *flux,
|
||||||
int *sequence, int *components, int *ncomponents);
|
int *sequence, int *components, int *ncomponents);
|
||||||
|
|
||||||
|
void compute_sequence_graph(const struct UnstructuredGrid *grid, const double *flux,
|
||||||
|
int *sequence, int *components, int *ncomponents,
|
||||||
|
int *ia, int *ja);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
Reference in New Issue
Block a user