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

[WIP] Create quarter administration #360

Merged
merged 17 commits into from
Jun 19, 2024
Merged
Prev Previous commit
Next Next commit
info for tests.
martijn-siemerink committed Apr 30, 2024
commit 5804e6ccc9e4ee12eab43bd97e463f1d23278db0
2 changes: 2 additions & 0 deletions threedigrid_builder/grid/quadtree.py
Original file line number Diff line number Diff line change
@@ -263,6 +263,8 @@ def get_quarters_admin(self, nodes, lines):
quarter_line = np.full((n_2d_nodes * 4, 2), -9999, dtype=np.int32, order="F")
neighbour_node = np.full((n_2d_nodes * 4, 2), -9999, dtype=np.int32, order="F")

print(f"u: {self.n_lines_u}, v: {self.n_lines_v}")

m_cells.set_quarter_admin(
nodes.nodk,
nodes.nodm,
2 changes: 2 additions & 0 deletions threedigrid_builder/tests/test_quadtree.py
Original file line number Diff line number Diff line change
@@ -339,6 +339,7 @@ def test_quarter_administration(quadtree_line_refinement, subgrid_meta):

quarters = quadtree_line_refinement.get_quarters_admin(nodes, lines)

# fmt: off
neighbours = np.array(
[[-9999, -9999],
[ 5, -9999],
@@ -520,6 +521,7 @@ def test_quarter_administration(quadtree_line_refinement, subgrid_meta):
[ 18, -9999],
[-9999, -9999]], dtype=np.int32
)
# fmt: on
assert_array_equal(quarters.line, lines)
assert_array_equal(quarters.neighbour_node, neighbours)