void River::flow(Grid<FlowData> * source, Grid<FlowData> * dest) { copyFlowData(*dest); copyFlowData(*source); for (int t = 0; t < ITERATIONS_TO_FLOW_RIVER; t++) { std::swap(source, dest); flowSingleTimestep(*source, *dest, config); } storeFlowData(*dest); }
void River::flow(Grid<FlowData> * source, Grid<FlowData> * dest) { //TODO Replace with CarbonFlowMap stuff copyFlowData(*dest); copyFlowData(*source); int max_time = 60/config.timestep; g.nan_trigger = false; for (int t = 0; t < max_time; t++) { std::swap(source, dest); flowSingleTimestep(*source, *dest, config); if (g.nan_trigger) { break; } } storeFlowData(*dest); }