Skip to content

Function for tracers #2361

Mar 16, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

I think you'll have to chain | logic in a discrete_form forcing function. I tried to make it readable:

@inline t_unforced(t) = t < ti
@inline i_unforced(i) = i < 1 | i > 3
@inline k_unforced(k) = k < 1 | k > 3
@inline unforced(i, k, t) = t_unforced(t) | i_unforced(i) | k_unforced(k)
@inline forcing(i, j, k, grid, clock, fields) = ifelse(unforced(i, k, clock.time), 0.0, 1.0)

c_forcing = Forcing(forcing, discrete_form=true)

I think that will work...

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ammtD
Comment options

@glwagner
Comment options

@ammtD
Comment options

Answer selected by ammtD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants