upstream#
Signature#
- upstream(flow_direction, material) Field#
Assign the sum of the values from each cell’s upstream neighbours to the cell itself
- Parameters:
flow_direction (Field) – Integral array
material (Field) – Arithmetic array
- Returns:
New arithmetic array
Description#
All material is transported downstream by one cell, according to the flow direction field.
No-data handling#
A no-data value in the material array is transported downstream. Also, a no-data value in the material array results in a no-data value in the output material array. The output array may contain more no-data values than the input arrays.
Example#
/* TODO */
auto const output_material = lue::value_policies::upstream(flow_direction, input_material);
// TODO
output_material = lfr.upstream(flow_direction, input_material)