-
Notifications
You must be signed in to change notification settings - Fork 201
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
Automatically adding mandatory simulation callbacks #3962
Comments
Yes, there is a notion of "dependencies": Oceananigans.jl/src/Simulations/run.jl Lines 162 to 166 in fe4123f
the What specifically do you have in mind? |
Ah would it be correct to describe
? Maybe I was thinking of something more along the lines of
|
Oh sorry for giving an incomplete answer! If you have something that requires updating every time-step, can that model feature be constructed as a If so, we have built up some functionality for using Oceananigans.jl/src/Models/NonhydrostaticModels/update_nonhydrostatic_model_state.jl Lines 27 to 28 in 325866b
I think the primary use case here is for components that are loaded from data, which is where there's a lot of functionality around which Now, if you cannot construe this model component as a |
Then we could generalize the Oceananigans.jl/src/Models/Models.jl Line 143 in 325866b
which can be generalized to something like update!(obj, model) then we have update!(fts::FieldTimeSeries, model) = update_field_time_series!(fts, Time(model.clock.time))
update!(f::FunctionUpdatedField, model) = f.update(f.field, model) for example. We also need to generalize Oceananigans.jl/src/Models/Models.jl Line 139 in 325866b
This would increase reliance on Oceananigans.jl/src/Models/Models.jl Line 140 in 325866b
|
Sometimes you have a boundary condition, or Lagrangian particles, or biogeochemistry that needs updating every time step (or every n time steps).
The current method of ensuring this update occurs is to add the appropriate
boundary_conditions
,particles
, orbiogeochemistry
, then define an update function, e.g.update_particles!
, and add it as a simulation callback withIterationInterval(1)
schedule.This is perfectly fine (and not a lot of work honestly) but from a user experience perspective it would be nice and less error-prone if there was a way for this update callback to be added automatically.
Although I'm not sure how to make this happen as most of these objects that require updates are defined before the model and simulation are constructed. They can't even be added after simulation construction.
I'm wondering if there's any way of automatically adding such "mandatory" simulation callbacks.
The text was updated successfully, but these errors were encountered: