question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'on_diagonals' diffusion missing grid attribute

See original GitHub issue

I’m experimenting with the diffusion to all adjacent cells in landlab, and I’ve run into an issue.

Instantiating LinearDiffuser with method ‘on_diagonals’ is possible but calling run_one_step gives AttributeError: 'RasterModelGrid' object has no attribute _diag_activelink_tonode.

I searched in the whole code repository, and line 552 in diffusion.py appears to be the only place where this attribute exists. This seems to be similar for _diag_activelink_fromnode too. Maybe these were orphaned somewhere in the LL2.0 process? I would be interested in helping if there is a simple fix.

Furthermore, there are no component tests for methods other than ‘simple’. Seems like this would be useful.

Here is an example:

from landlab import RasterModelGrid
from landlab.components import LinearDiffuser

grid = RasterModelGrid((10, 10), xy_spacing=10)
z = grid.add_ones('node', 'topographic__elevation')

ld = LinearDiffuser(grid, 0.001, method='on_diagonals')
ld.run_one_step(1)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
SiccarPointcommented, Aug 28, 2020

Yes, I too was struggling with conflict between D8 flow and D4 diffusion. Do feel free just to remove it. Can always reinstate later. I was never totally happy that the scheme I had going for this was justified, and couldn’t justify sinking any more time into it after a certain point. This was long enough ago that our modern QC processes weren’t in place!

0reactions
gregtuckercommented, Aug 31, 2020

I’m surprised to hear that you got slower performance with hex. In principle, you do have ~50% more links in a hex grid (not counting diagonals), but that shouldn’t be a huge hit. One area where hex grids are notably slower is in imshow_grid plotting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Components — landlab 2.1.1+1.g695269aa documentation
This component adjusts topographic elevation. Parameters: grid (RasterModelGrid) – A landlab grid. K_sp (float, optional) – K in the stream power ...
Read more >
Wasserstein diffusion on graphs with missing attributes
In this paper, we propose a general non-parametric framework to mitigate this problem. Starting from a decomposition of the attribute matrix, we transform...
Read more >
Wavelet Operators Applied to Multigrid Methods
shows oscillation on diagonals, 16 16 grid; (c) shows oscillation in ... and then by truncating to allow no ll-in in the inverse....
Read more >
MATLAB Implementation of a Multigrid Solver for Diffusion ...
as the multigrid method is often called multilevel methods, but there is no official unified term for these methods. The multigrid algorithm implemented...
Read more >
Marek Rosa - dev blog: VRAGE: Volumetric Water
Planetary scale (or small pond); Volumetric 3D (no 2D plane or height field) ... Grid based simulation where there is a mass and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found