Easiest way to zero negative values for some tracers? #2409
Answered
by
glwagner
iuryt
asked this question in
Computational science!
-
This a spin off from #2385 but I am creating a new discussion because I think that this is useful for other situations. I am also open for other alternatives to avoid these negative values on a NP model. |
Beta Was this translation helpful? Give feedback.
Answered by
glwagner
Mar 31, 2022
Replies: 1 comment 6 replies
-
Maybe zero_tracer(sim) = map!(c -> ifelse(c < 0, 0.0, c), parent(sim.model.tracers.c), parent(sim.model.tracers.c))
simulation.callbacks[:zero_tracer] = Callback(zero_tracer) |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
iuryt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe