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

Skip to content

Issue #788 and # 789 gwf gwt exchanges and ims #791

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

Merged

Conversation

luitjansl
Copy link
Contributor

@luitjansl luitjansl commented Jan 30, 2024

Fixes #788 and #789

Description

now adds split models to the solution group (ims) that the source model belonged to.
When writing a split simulation with flow and transport, gwfgwt exchanges are created. The models are connected based on type and domain.

Checklist

  • Links to correct issue
  • Update changelog, if changes affect users
  • PR title starts with Issue #nr, e.g. Issue #737
  • Unit tests were added
  • If feature added: Added/extended example

Copy link
Contributor

@JoerivanEngelen JoerivanEngelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I have some comments/remarks

new_simulation["solver"]["modelnames"] = xr.DataArray(
list(get_models(new_simulation).keys())
)
if isinstance(model, GroundwaterFlowModel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative to an if statement if passing the entire model to the method and then use typed dispatch to call the correct method

for model_name, model in original_models.items():
    exchanges += exchange_creator.create_exchanges(
        model_name, model
    )

In the ExchangeCreator:

@typedispatch
def create_exchanges(
        self, model_name: str, model: GroundwaterFlowModel
    ) -> List[GWFGWF]:
....

@typedispatch
def create_exchanges(
        self, model_name: str, model: GroundwaterTransportModel
    ) -> List[GWFGWF]:
    
    return []

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may become a better alternative if the number of supported model types increases.

@luitjansl luitjansl merged commit a79ad0a into model_splitting_transport_feature Feb 1, 2024
@luitjansl luitjansl deleted the issue_#788_gwf-gwt_exchanges branch February 1, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants