'on_diagonals' diffusion missing grid attribute
See original GitHub issueI’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:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!
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.