Go to the source code of this file.
|
void | compute_sequence (const struct UnstructuredGrid *grid, const double *flux, 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) |
|
Facilities for computing a causal permutation of the cells in an UnstructuredGrid such that fluid transport may be subsequently solved by going from sources and up-stream cells to sinks and down-stream cells.
void compute_sequence |
( |
const struct UnstructuredGrid * |
grid, |
|
|
const double * |
flux, |
|
|
int * |
sequence, |
|
|
int * |
components, |
|
|
int * |
ncomponents |
|
) |
| |
Compute causal permutation sequence of grid cells with respect to specific Darcy flux field.
- Parameters
-
[in] | grid | Grid structure for which to compute causal cell permutation. |
[in] | flux | Darcy flux field. One scalar value for each interface/connection in the grid, including the boundary. We assume that flux[f] is positive if the flow is from cell grid->face_cells[2*f + 0] to cell grid->face_cells[2*f + 1] . |
[out] | sequence | Causal grid cell permutation. Ordered according to topological sorting of the strongly connected components of the Darcy flux upwind graph. Array of size grid->number_of_cells . |
[out] | components | Indirection pointers that describe the strongly connected components (i.e., loops) of the Darcy flux upwind graph. Specifically, the 'th strongly connected component constitutes cells sequence[components[i] ... components[i + 1]
|
In the ideal case of a perfectly reordered upwind graph, this array will hold grid->number_of_cells + 1 elements, and the relation components[i + 1] - components[i] == 1 holds for all . Thus, the components parameter must point to an array of grid->number_of_cells + 1 elements.
- Parameters
-
[out] | ncomponents | Number of strongly connected components. Pointer to a single integer. The components output are valid for all i = 0 ... *ncomponents - 1 . Furthermore, the number of components must be in the interval [1 .. grid->number_of_cells] . |
void compute_sequence_graph |
( |
const struct UnstructuredGrid * |
grid, |
|
|
const double * |
flux, |
|
|
int * |
sequence, |
|
|
int * |
components, |
|
|
int * |
ncomponents, |
|
|
int * |
ia, |
|
|
int * |
ja |
|
) |
| |
Compute causal permutation sequence of grid cells with respect to specific Darcy flux field. Also return the permuted upwind graph.
- Parameters
-
[in] | grid | Grid structure for which to compute causal cell permutation. |
[in] | flux | Darcy flux field. One scalar value for each interface/connection in the grid, including the boundary. We assume that flux[f] is positive if the flow is from cell grid->face_cells[2*f + 0] to cell grid->face_cells[2*f + 1] . |
[out] | sequence | Causal grid cell permutation. Ordered according to topological sorting of the strongly connected components of the Darcy flux upwind graph. Array of size grid->number_of_cells . |
[out] | components | Indirection pointers that describe the strongly connected components (i.e., loops) of the Darcy flux upwind graph. Specifically, the 'th strongly connected component constitutes cells sequence[components[i] ... components[i + 1]
|
In the ideal case of a perfectly reordered upwind graph, this array will hold grid->number_of_cells + 1 elements, and the relation components[i + 1] - components[i] == 1 holds for all . Thus, the components parameter must point to an array of grid->number_of_cells + 1 elements.
- Parameters
-
[out] | ncomponents | Number of strongly connected components. Pointer to a single integer. The components output are valid for all i = 0 ... *ncomponents - 1 . Furthermore, the number of components must be in the interval [1 .. grid->number_of_cells] . |
[out] | ia | Indirection pointers into ja that define the "upwind" cells that influence a particular grid cell. |
[out] | ja | Compressed-sparse representation of the upwind graph. Specifically, the upwind cells that influence cell are ja[ia[i] .. ia[i+1]-1] . Array of size at least equal to the number of internal faces of grid . The number grid->number_of_faces is an upper bound of the array size. |
|