-
Notifications
You must be signed in to change notification settings - Fork 3
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
Issue #788 and # 789 gwf gwt exchanges and ims #791
Conversation
There was a problem hiding this 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
review comment Co-authored-by: Joeri van Engelen <[email protected]>
review comment Co-authored-by: Joeri van Engelen <[email protected]>
new_simulation["solver"]["modelnames"] = xr.DataArray( | ||
list(get_models(new_simulation).keys()) | ||
) | ||
if isinstance(model, GroundwaterFlowModel): |
There was a problem hiding this comment.
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 []
There was a problem hiding this comment.
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.
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
Issue #nr
, e.g.Issue #737