Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for boundary quatree lines #388

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ Changelog of threedigrid-builder
-------------------

- Define new boundary condition types.
- Add boundaries to quadtree line administration.
- Handle open YZ profiles correctly when the middle is higher than the sides.



nvolp marked this conversation as resolved.
Show resolved Hide resolved
1.19.0 (2024-09-10)
-------------------

Expand Down
3 changes: 2 additions & 1 deletion libthreedigrid/cells.f90
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ subroutine set_quarter_admin(nodk, nodm, nodn, line, kcu, quarter_line, quarter_
! When adjacent cells differ in size due to refinement, each quadrant is associated with its own line for the larger cell. The smaller cell will have the same flow line for both quadrants. Hence the "if" structure.
! Same logic applies to finding neighbouring nodes for quarters.
! The cell quadrant index is illustrated above.

do l=1, liutot
nodd = line(l, 1) + 1 ! This is a 0-based python index, therefore +1
nodu = line(l, 2) + 1
Expand Down Expand Up @@ -384,7 +385,7 @@ subroutine set_quarter_admin(nodk, nodm, nodn, line, kcu, quarter_line, quarter_
select case(kcu(l))
case(LINE_2D_BOUNDARY_WEST)
quarter_line(get_quarter_idx(nodu, 1), 1) = l - 1
quarter_line(get_quarter_idx(nodu, 3), 1) = l
quarter_line(get_quarter_idx(nodu, 3), 1) = l - 1
quarter_neighbour(get_quarter_idx(nodu, 1), 1) = nodd - 1
quarter_neighbour(get_quarter_idx(nodu, 3), 1) = nodd - 1
case(LINE_2D_BOUNDARY_EAST)
Expand Down
2 changes: 1 addition & 1 deletion threedigrid_builder/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def _make_gridadmin(
node_id_counter=node_id_counter,
line_id_counter=line_id_counter,
)
grid.set_quarter_administration(quadtree)

if grid.meta.has_groundwater:
grid.add_groundwater(
Expand All @@ -95,6 +94,7 @@ def _make_gridadmin(
line_id_counter,
)

grid.set_quarter_administration(quadtree)
dem_average_areas = db.get_dem_average_areas()
grid.set_dem_averaged_cells(dem_average_areas)

Expand Down
Loading