You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue has come up coupling Thetis to a goal-based mesh-adaptivity framework goalie but would equally be important coupling Thetis to other models via a coupling framework: Thetis only provides per timestep control via callbacks, which keeps Thetis in charge of runtime, and does not cater for an external framework to request a single timestep to be performed.
Two potential implementations that I can think of:
Simply separate the timestep code into a separate (user callable) method
Use a generator approach.
So change the current code
def iterate(self, ...):
<prep-stuff>
while t<t_end:
<timestep-code>
This issue has come up coupling Thetis to a goal-based mesh-adaptivity framework goalie but would equally be important coupling Thetis to other models via a coupling framework: Thetis only provides per timestep control via callbacks, which keeps Thetis in charge of runtime, and does not cater for an external framework to request a single timestep to be performed.
Two potential implementations that I can think of:
So change the current code
to either 1:
or 2:
where in both cases the user can use
solver_obj.iterate()
in exactly the same way as before.To get per time-step control, in case 1, the user (coupling framework) would have to do three things
whereas in case 2, that would simply be:
or if there's some further logic, or other looping requirements:
So at the moment I'm inclined to go for option 2.
The text was updated successfully, but these errors were encountered: