Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Expose functionality to clip HorizontalFlowBarrier class #1414

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

Closed
JoerivanEngelen opened this issue Feb 6, 2025 · 0 comments Β· Fixed by #1426
Closed

Expose functionality to clip HorizontalFlowBarrier class #1414

JoerivanEngelen opened this issue Feb 6, 2025 · 0 comments Β· Fixed by #1426
Assignees
Milestone

Comments

@JoerivanEngelen
Copy link
Contributor

We have quite some internal logic to clip HorizontalFlowBarrier packages away from inactive cells. However, it isn't really exposed to the user. Right now we throw validation errors when barriers are intersecting a grid. When users set strict_hfb_validation to false, the models run without error as barrier segments connecting to inactive cells are filtered away. The latter is hard to do when running models with primod (probably worthy of its own issue).

I see two ways we could do this. Either by modifying the already existing mask method, which at present doesn't do anything because vector data is independent from grid. I therefore is quite a useless method right now, just existing to keep the API consistent. The other way we could go by this is introduce a cleanup_hfb function, which takes a grid an cleans it based on that. Or both?

@github-project-automation github-project-automation bot moved this to πŸ“― New in iMOD Suite Feb 6, 2025
@JoerivanEngelen JoerivanEngelen changed the title Expose functinionality to clip HorizontalFlowBarrier class Expose functionality to clip HorizontalFlowBarrier class Feb 6, 2025
@JoerivanEngelen JoerivanEngelen self-assigned this Feb 13, 2025
@JoerivanEngelen JoerivanEngelen moved this from πŸ“― New to πŸ— In Progress in iMOD Suite Feb 13, 2025
@JoerivanEngelen JoerivanEngelen added this to the v1.0 release milestone Feb 14, 2025
@JoerivanEngelen JoerivanEngelen moved this from πŸ— In Progress to 🧐 In Review in iMOD Suite Feb 24, 2025
JoerivanEngelen added a commit that referenced this issue Feb 28, 2025
Fixes #1414 

# Description
- Adds ``cleanup_hfb`` function to clip barrier lines/Z polygons outside
the active domain. This unfortunately cannot deal with the edge case
where a hfb line is snapped to the outer edge of the active domain.
(These edges are filtered out when calling ``to_mf6_pkg``, but a
ValidationError is thrown when ``strict_hfb_validation`` is switched
on).
- Adds ``HorizontalFlowBarrierBase.cleanup`` method
- Moves some utility functions from ``imod.mf6.utilities`` to
``imod.prepare.hfb`` and ``imod.util.hfb``, to avoid circular imports.

# Checklist
<!---
Before requesting review, please go through this checklist:
-->

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
@github-project-automation github-project-automation bot moved this from 🧐 In Review to βœ… Done in iMOD Suite Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: βœ… Done
Development

Successfully merging a pull request may close this issue.

1 participant